Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_DataSource Class Reference

Mix-in class for objects that serve as a data source for various CPLAT objects.

Inheritance diagram for CP_DataSource:

CP_M_RefCounted CP_Object CP_SigSlot::CP_SlotObject CP_NoCopy CP_DataSource_Strings List of all members.

Data

virtual CP_DataValueHolder GetData (SInt32 inID)
virtual CP_DataValueHolder GetData (SInt32 inID, UInt32 inOptionalProperty)
virtual void HandleChangedData (CP_S_DataSource_ChangedData &inChangedData)

Public Member Functions

void SetID (FourCharCode inIdentifier)
FourCharCode GetID ()
void RegisterSignal (const CP_SignalHolder &inSignal)
CP_DataValueSignalFindSignal (const CP_String &inSignalName)
UInt32 GetNumberSignals ()
CP_String GetNthSignalName (UInt32 inSignalIndex)
void RegisterSlot (const CP_SlotHolder &inSlot)
CP_DataValueSlot FindSlot (const CP_String &inSlotName)
UInt32 GetNumberSlots ()
CP_String GetNthSlotName (UInt32 inSlotIndex)
template<class R, class P1, class P2>
CP_CommandHandlerSignalConnect (CPLAT::CP_CommandNo cmd, void(R::*handler)(P1, P2), SInt32 mode)
template<class R, class P1, class P2>
void Connect (CP_Object *control, const CPLAT::CP_String &signalName, void(R::*handler)(P1, P2))
void disconnect_all ()
void signal_connect (CP_Signal *inSender)
void signal_disconnect (CP_Signal *inSender)
Constructor / Destructor
 CP_DataSource ()
 Constructor.
virtual ~CP_DataSource () throw ()
 Destructor.
Sorting
virtual bool Compare (SInt32 inIDLeft, SInt32 inIDRight, bool inSortUp)

Static Public Member Functions

static void Connect (CP_Object *sender, const CP_String &signalName, CP_Object *receiver, const CP_String &slotName, const bool reciprocal=false)
static void Connect (CP_Object *sender, CP_Object *receiver, const bool reciprocal=false, const CP_String &signalName=kCP_Signal_ValueChanged, const CP_String &slotName=kCP_Slot_SetValue)

Protected Attributes

CP_DataValueSignal fValueChangedSignal
CP_DataValueSlot fDataChangedSlot
CP_Signals_ArrayfSignals
CP_Slots_ArrayfSlots
FourCharCode fObjectID
sender_set fSenders

Static Protected Attributes

static FourCharCode fObjectIDCount = 0

Private Member Functions

void DataChangedSlot (CP_DataValueHolder &inValue, OSStatus &inOutStatus)

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_DataSource::CP_DataSource  ) 
 

Constructor.

Exceptions:
none 

CP_DataSource::~CP_DataSource  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_DataValueHolder CP_DataSource::GetData SInt32  inID  )  [virtual]
 

Returns the data for the passed in identifier. Subclasses neet to override this to return the actual data. This base class just returns an empty data value.

Parameters:
inID Not used.
Exceptions:
none 
Returns:
CP_DataValueHolder A CP_DataValueHolder that contains the data located at the specified identifier passed in. In this base class, an empty data value is returned.

Reimplemented in CP_DataSource_Strings.

CP_DataValueHolder CP_DataSource::GetData SInt32  inID,
UInt32  inOptionalProperty
[virtual]
 

Returns the data for the passed in identifier. Subclasses neet to override this to return the actual data. This base class just returns an empty data value.

Parameters:
inID Not used.
inOptionalProperty Not used.
Exceptions:
none 
Returns:
CP_DataValueHolder A CP_DataValueHolder that contains the data located at the specified identifier passed in. In this base class, an empty data value is returned.

Reimplemented in CP_DataSource_Strings.

virtual void CP_DataSource::HandleChangedData CP_S_DataSource_ChangedData inChangedData  )  [virtual]
 

void CP_DataSource::DataChanged SInt32  inID = -1  )  [virtual]
 

Method to call when something has caused the data value stored by this class with the passed in id to change. This will send out a kCP_Signal_ValueChanged signal to notifiy users of this data that the data has changed in someway.

Parameters:
inID Identifier for the data.
Exceptions:
none 
Returns:
void

bool CP_DataSource::Compare SInt32  inIDLeft,
SInt32  inIDRight,
bool  inSortUp
[virtual]
 

Method that can be called when the data managed by this class needs to be sorted. Subclasses need to override to provide the actual sorting. This base class method always returns true.

Parameters:
inIDLeft Not used.
inIDRight Not used.
inSortUp Not used.
Exceptions:
none 
Returns:
bool Returns true for this base class.

Reimplemented in CP_DataSource_Strings.

void CP_DataSource::DataChangedSlot CP_DataValueHolder inValue,
OSStatus inOSStatus
[private]
 

Slot to allow users of this data to notify this class when they have done something to cause the underlying data to change. When called, this will call the HandleChangedData method to allow subclasses to handle the changed data.

Parameters:
inValue Contains a CP_S_DataSource_ChangedData structure that describes the data and its identifier.
inOSStatus Notification of the status of the calling of this slot, currently returns CP_noErr.
Exceptions:
none 
Returns:
void

UInt32 CP_M_RefCounted::AddReference  )  const [inherited]
 

Add a reference to our object, returning the new reference count.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

UInt32 CP_M_RefCounted::RemoveReference  )  const [inherited]
 

Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

void CP_M_RefCounted::Autorelease  )  const [inherited]
 

Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.

See also:
CP_AutoReleasePool
Exceptions:
none 
Returns:
void

UInt32 CP_M_RefCounted::GetRefCount  )  const [inherited]
 

Returns the current ref count.

Exceptions:
none 
Returns:
UInt32 The current referencce count.

void CP_Object::SetID FourCharCode  inIdentifier  )  [inherited]
 

Sets the identifier for this object. If a specific identifier is not set with this function, then a default id is used, which is simply a running count of the number of objects created.

Parameters:
inIdentifier The objects identifier.
Returns:
void

FourCharCode CP_Object::GetID  )  [inherited]
 

Returns the objects identifier.

Returns:
FourCharCode The identifier of this object.

void CP_Object::RegisterSignal const CP_SignalHolder inSignal  )  [inherited]
 

Registers the signal / signal name contained in the passed in inSignal object.

Parameters:
inSignal CP_SignalHolder that holds a signal and string identifier.
Returns:
void

CP_DataValueSignal * CP_Object::FindSignal const CP_String inSignalName  )  [inherited]
 

Finds the CP_DataValueSignal object that matches the passed in inSignalName.

Parameters:
inSignalName CP_String containing the identifier of the signal to return.
Returns:
CP_DataValueSignal * Returns a pointer to a CP_DataValueSignal object.

UInt32 CP_Object::GetNumberSignals  )  [inherited]
 

Returns the number of signals for this object.

Returns:
UInt32 The number of signals.

CP_String CP_Object::GetNthSignalName UInt32  inSignalIndex  )  [inherited]
 

Returns the signal name of the passed in signal index.

Parameters:
inSignalIndex Index of the name of the signal to return.
Returns:
CP_String The name of the nth signal being returned.

void CP_Object::RegisterSlot const CP_SlotHolder inSlot  )  [inherited]
 

Registers the slot / slot name contained in the passed in inSlot object.

Parameters:
inSlot CP_SignalHolder that holds a slot and string identifier.
Returns:
void

CP_DataValueSlot CP_Object::FindSlot const CP_String inSlotName  )  [inherited]
 

Finds the CP_Slot1 object that matches the passed in inSlotName.

Parameters:
inSlotName CP_String containing the identifier of the slot to return.
Returns:
CP_DataValueSlot Returns a pointer to a CP_DataValueSlot object.

UInt32 CP_Object::GetNumberSlots  )  [inherited]
 

Returns the number of slots for this object.

Returns:
UInt32 The number of slots.

CP_String CP_Object::GetNthSlotName UInt32  inSlotIndex  )  [inherited]
 

Returns the slot name of the passed in signal index.

Parameters:
inSlotIndex Index of the name of the slot to return.
Returns:
CP_String The name of the nth slot being returned.

template<class R, class P1, class P2>
CP_CommandHandlerSignal* CP_Object::Connect CPLAT::CP_CommandNo  cmd,
void(R::*)(P1, P2)  handler,
SInt32  mode
[inherited]
 

template<class R, class P1, class P2>
void CP_Object::Connect CP_Object control,
const CPLAT::CP_String &  signalName,
void(R::*)(P1, P2)  handler
[inherited]
 

void CP_Object::Connect CP_Object sender,
const CP_String signalName,
CP_Object receiver,
const CP_String slotName,
const bool  reciprocal = false
[static, inherited]
 

void CP_Object::Connect CP_Object sender,
CP_Object receiver,
const bool  reciprocal = false,
const CP_String signalName = kCP_Signal_ValueChanged,
const CP_String slotName = kCP_Slot_SetValue
[static, inherited]
 

void CP_SigSlot::CP_SlotObject::disconnect_all  )  [inherited]
 

void CP_SigSlot::CP_SlotObject::signal_connect CP_Signal inSender  )  [inherited]
 

void CP_SigSlot::CP_SlotObject::signal_disconnect CP_Signal inSender  )  [inherited]
 


Member Data Documentation

CP_DataValueSignal CP_DataSource::fValueChangedSignal [protected]
 

CP_DataValueSlot CP_DataSource::fDataChangedSlot [protected]
 

Signal sent when the value of any item changes.

CP_Signals_Array* CP_Object::fSignals [protected, inherited]
 

CP_Slots_Array* CP_Object::fSlots [protected, inherited]
 

List of registered signals for this object.

FourCharCode CP_Object::fObjectID [protected, inherited]
 

List of registered slots for this object.

CPLAT_Begin_Namespace_CPLAT FourCharCode CP_Object::fObjectIDCount = 0 [static, protected, inherited]
 

Object identifier.

sender_set CP_SigSlot::CP_SlotObject::fSenders [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:37 2005 for CPLAT_MacOS by  doxygen 1.4.0