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

CP_Object Class Reference

Base class for objects used in CPLAT. More...

Inheritance diagram for CP_Object:

CP_NoCopy CP_Application_Imp CP_Application_Imp CP_Application_Imp CP_Cursor CP_DataEncoder CP_DataSource CP_DataValueList CP_Date CP_Dialog CP_Idler CP_M_Persist CP_NetProtoBase CP_TableGeometry_Base CP_TimedTask CP_TimeZone CP_TV_DataBrowser_CH_Base CP_View_Imp_MLTE CP_View_Imp_Rich List of all members.

Public Member Functions

 CP_Object ()
virtual ~CP_Object ()
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))

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_Signals_ArrayfSignals
CP_Slots_ArrayfSlots
FourCharCode fObjectID

Static Protected Attributes

static FourCharCode fObjectIDCount = 0

Private Member Functions

 CP_Object (const CP_Object &)
CP_Objectoperator= (const CP_Object &)

Detailed Description

This base class provides lists for registering and finding CP_Signal1 and CP_Slot1 objects that can be identified by a CP_String name to provide a signal / slot connection between objects.

CP_DataValueSignal *signal = object->FindSignal( signalName ); CP_DataValueSlot *slotConnection = object->FindSlot( slotName );

signal->connect( slotConnection );


Constructor & Destructor Documentation

CP_Object::CP_Object  ) 
 

Constructor.

CP_Object::~CP_Object  )  [virtual]
 

Destructor.

CP_Object::CP_Object const CP_Object  )  [private]
 


Member Function Documentation

void CP_Object::SetID FourCharCode  inIdentifier  ) 
 

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  ) 
 

Returns the objects identifier.

Returns:
FourCharCode The identifier of this object.

void CP_Object::RegisterSignal const CP_SignalHolder inSignal  ) 
 

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  ) 
 

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  ) 
 

Returns the number of signals for this object.

Returns:
UInt32 The number of signals.

CP_String CP_Object::GetNthSignalName UInt32  inSignalIndex  ) 
 

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  ) 
 

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  ) 
 

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  ) 
 

Returns the number of slots for this object.

Returns:
UInt32 The number of slots.

CP_String CP_Object::GetNthSlotName UInt32  inSlotIndex  ) 
 

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
 

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

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

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]
 

CP_Object& CP_Object::operator= const CP_Object  )  [private]
 


Member Data Documentation

CP_Signals_Array* CP_Object::fSignals [protected]
 

CP_Slots_Array* CP_Object::fSlots [protected]
 

List of registered signals for this object.

FourCharCode CP_Object::fObjectID [protected]
 

List of registered slots for this object.

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

Object identifier.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:54 2005 for CPLAT by  doxygen 1.4.0