Macros that add <<std aggr>> members for an association.

For example, if you want to include a <<std aggr>="">> association with an object of type MyClass of the name my_object you would include the macro in the public section of YourClass declaration as follows:. More...

Defines

#define STANDARD_AGGREGATION_MEMBERS(TYPE, NAME)
 Insert class members for a non-const association.
#define STANDARD_CONST_AGGREGATION_MEMBERS(TYPE, NAME)
 Insert class members for a constant association.

Detailed Description

For example, if you want to include a <<std aggr>="">> association with an object of type MyClass of the name my_object you would include the macro in the public section of YourClass declaration as follows:.

  class YourClass {
  public:
    STANDARD_AGGREGATION_MEMBERS( MyClass, my_object )
  };
 

Note that the macro addes the private member TYPE* NAME_# to the class declaration and therefore the member NAME_ is available for direct access (in a constructor for example).

In order to have a const only association use:

  class YourClass {
  public:
    STANDARD_CONST_AGGREGATION_MEMBERS( MyClass, my_object )
  };
 

Define Documentation

#define STANDARD_AGGREGATION_MEMBERS ( TYPE,
NAME   ) 

Value:

public:                                 \
  void set_ ## NAME ( TYPE* NAME )                  \
  { NAME ## _ = NAME; }                       \
  TYPE* get_ ## NAME()                        \
  { return NAME ## _; }                       \
  const TYPE* get_ ## NAME() const                  \
  { return NAME ## _; }                       \
  TYPE& NAME()                            \
  {                                 \
    return StandardCompositionRelationshipsPack::role_name(     \
      NAME ## _, false, " ## NAME ## " );             \
  }                                 \
  const TYPE& NAME() const                      \
  {                                 \
    return StandardCompositionRelationshipsPack::role_name(     \
      NAME ## _, false, " ## NAME ## " );             \
  }                                 \
private:                                \
  TYPE* NAME ## _;                          \
public:
Insert class members for a non-const association.

Definition at line 64 of file StandardAggregationMacros.hpp.

#define STANDARD_CONST_AGGREGATION_MEMBERS ( TYPE,
NAME   ) 

Value:

public:                                 \
  void set_ ## NAME ( const TYPE* NAME )                \
  { NAME ## _ = NAME; }                       \
  const TYPE* get_ ## NAME() const                  \
  { return NAME ## _; }                       \
  const TYPE& NAME() const                      \
  {                                 \
    return StandardCompositionRelationshipsPack::const_role_name( \
      NAME ## _, false, " ## NAME ## " );             \
  }                                 \
private:                                \
  const TYPE* NAME ## _;                        \
public:
Insert class members for a constant association.

Definition at line 87 of file StandardAggregationMacros.hpp.


Generated on Tue Oct 20 12:54:02 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7