JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JContainer Class Reference

#include <JContainer.h>

Inheritance diagram for JContainer:
[legend]

Public Member Functions

 JContainer ()
 
 JContainer (const JContainer &source)
 
JContaineroperator= (const JContainer &source)
 
- Public Member Functions inherited from JCollection
 JCollection ()
 
 JCollection (const JCollection &source)
 
 ~JCollection () override
 
JCollectionoperator= (const JCollection &source)
 
JSize GetItemCount () const
 
bool IsEmpty () const
 
bool IndexValid (const JIndex index) const
 
JIndex GetIndexFromEnd (const JIndex index) const
 
JString ToString () const override
 
- Public Member Functions inherited from JBroadcaster
 JBroadcaster ()
 
virtual ~JBroadcaster ()
 
JBroadcasteroperator= (const JBroadcaster &source)
 
bool HasSenders () const
 
JSize GetSenderCount () const
 
bool HasRecipients () const
 
JSize GetRecipientCount () const
 
template<class T >
void ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f)
 

Protected Member Functions

void InstallCollection (JCollection *list)
 
const JCollectionGetList () const
 
void Receive (JBroadcaster *sender, const Message &message) override
 
- Protected Member Functions inherited from JCollection
void ItemAdded ()
 
void ItemRemoved ()
 
void SetItemCount (const JSize newItemCount)
 
- Protected Member Functions inherited from JBroadcaster
 JBroadcaster (const JBroadcaster &source)
 
void ListenTo (const JBroadcaster *sender)
 
void StopListening (const JBroadcaster *sender)
 
void ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember)
 
void StopListening (const JBroadcaster *sender, const std::type_info &messageType)
 
template<class T >
void Send (JBroadcaster *recipient, const T &message)
 
template<class T >
void Broadcast (const T &message)
 
void SendWithFeedback (JBroadcaster *recipient, Message *message)
 
void BroadcastWithFeedback (Message *message)
 
virtual void ReceiveWithFeedback (JBroadcaster *sender, Message *message)
 
virtual void ReceiveGoingAway (JBroadcaster *sender)
 

Detailed Description

Interface for the JContainer class

                        The JContainer Class

Class for a collection of objects stored in a JList.

By calling InstallCollection in the constructors and copy constructors,
derived classes need not worry about keeping JCollection::itsItemCount
up to date.  This class does it automatically by listening to Broadcast
from the specified JList.

Implementation notes:

We store a JCollection* only to avoid making this class a template.
We should actually store an JList*.  But instantiating templates
is such a pain, and, in this case, is conceptually unnecessary.

Constructor & Destructor Documentation

◆ JContainer() [1/2]

JContainer::JContainer ( )

◆ JContainer() [2/2]

JContainer::JContainer ( const JContainer source)

Member Function Documentation

◆ GetList()

const JCollection * JContainer::GetList ( ) const
inlineprotected

◆ InstallCollection()

void JContainer::InstallCollection ( JCollection list)
protected

◆ operator=()

JContainer & JContainer::operator= ( const JContainer source)

◆ Receive()

void JContainer::Receive ( JBroadcaster sender,
const Message message 
)
overrideprotectedvirtual

Keep the number of items up to date.

Reimplemented from JBroadcaster.

Reimplemented in JNamedTreeList, JTreeList, and JXCheckboxGroup.


The documentation for this class was generated from the following files: