OMKBasicTypes.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  OMK

Defines

#define DECLARE_TYPE_EVENT(TheType, TheName)
 Macro to encapsulate data.
#define DECLARE_TYPE_EVENT_LISTENER(TheType, TheName, TheCallerType)
 Macro to encapsulate data.
#define DECLARE_EVENT_LISTENER(TheType, TheName, TheCallerType)
 Macro to encapsulate data.

Typedefs

typedef int OMK::Frequency
typedef long OMK::Date


Define Documentation

#define DECLARE_EVENT_LISTENER ( TheType,
TheName,
TheCallerType   ) 

Value:

/* Data event */ \
  typedef OMK::ValuedEvent< TheType > TheName ## Event ; \
  /* Data event listener */ \
  typedef OMK::ValuedEventListenerCallBack< TheCallerType, TheType > TheName ## EventListener
Macro to encapsulate data.

Parameters:
TheType The type of the data.
TheName The base name for the defined types.
TheCallerType The type for the call back owner class.
This macro is similar to DECLARE_TYPE_EVENT_LISTENER, the only difference is that it doesn't encapsulate TheType in a OMK::Type::SimpleTypeT.

This macro declares the following types:

See also DECLARE_TYPE_EVENT and DECLARE_TYPE_EVENT_LISTENER.

Definition at line 128 of file OMKBasicTypes.h.

#define DECLARE_TYPE_EVENT ( TheType,
TheName   ) 

Value:

/* Data type */ \
  typedef OMK::Type::SimpleTypeT< TheType > TheName ## Type ; \
  /* Data event */ \
  typedef OMK::ValuedEvent< TheName ## Type > TheName ## Event
Macro to encapsulate data.

Parameters:
TheType The type of the data.
TheName The base name for the defined types.
When data are used in event you must encapsulate it in a ValuedEvent which encapsulates a OMK::Type::SimpleTypeT. The aim of this macro is to help the user to declare such data.

Example:

    struct MyStruct { ... } ;
    DECLARE_PRM_TYPE_EVENT( MyStruct, MyData ) ;
This macro declares the following types: Example for a std::pair
    typedef std::pair< int, int > MyDataPrm ;
    DECLARE_PRM_TYPE_EVENT( MyDataPrm, MyData ) ;
See DECLARE_TYPE_EVENT_LISTENER for example of use.

Definition at line 57 of file OMKBasicTypes.h.

#define DECLARE_TYPE_EVENT_LISTENER ( TheType,
TheName,
TheCallerType   ) 

Value:

DECLARE_TYPE_EVENT( TheType, TheName ) ; \
  /* Data event listener */ \
  typedef OMK::ValuedEventListenerCallBack< TheCallerType, TheName ## Type > TheName ## EventListener
Macro to encapsulate data.

Parameters:
TheType The type of the data.
TheName The base name for the defined types.
TheCallerType The type for the call back owner class.
When data are used in event you must encapsulate it in a ValuedEvent which encapsulates a OMK::Type::SimpleTypeT. The aim of this macro is to help the user to declare such data.

Example:

    struct MyStruct { ... } ;
    DECLARE_PRM_TYPE_EVENT_LISTENER( MyStruct, MyData, MyObject ) ;
This macro declares the following types: You can use these types to declare a call back for event:
  typedef std::pair< Name, Name > MyDataPrm ;
  DECLARE_TYPE_EVENT_LISTENER( MyDataPrm, MyData, MyObject ) ;
  bool MyObject::loadParameters( const ConfigurationParameterDescriptor * node )
  {
    bool ok = ExtensibleSimulatedObject::loadParameters( node ) ;
    new MyDataEventListener( this, &MyObject::processMyEvent, EventID ) ;
    ...
  }
  bool MyObject::processMyEvent( MyDataEvent* e ) 
  {
    const MyDataPrm& tmp = e->value.getValue() ;
    ...
  }
To send the event
    sendValuedEvent( "target", EventID, MyDataType( MyDataPrm( "FirstName", "SecondName" ) ) ) ;

See also DECLARE_TYPE_EVENT and DECLARE_EVENT_LISTENER.

Definition at line 108 of file OMKBasicTypes.h.


logo OpenMask

Documentation generated on Mon Jun 9 11:45:58 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007