Macro that adds <<std member comp>> attributes to any class

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

Defines

#define STANDARD_MEMBER_COMPOSITION_MEMBERS(TYPE, NAME)

Detailed Description

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


	class YourClass {
	public:
		STANDARD_MEMBER_COMPOSITION_MEMBERS( MyClass, my_attribute )
	};
  
This macro adds the following data member to the class declaration:

	private:
		My_Class my_attribute_;
  
and the following methods to your class declaration:

	public:

        void my_attribute( const My_Class & my_attribute )
	{ my_attribute_ = my_attribute; }
	const My_Class& my_attribute() const
	{ return my_attribute_; }
  
The advantage of using this type of declaration is that it saves you a lot of typing and space. Later if you need to override these operations you can just implement the member functions by hand.

Define Documentation

#define STANDARD_MEMBER_COMPOSITION_MEMBERS TYPE,
NAME   ) 
 

Value:

public:                               \
  void NAME (const TYPE & NAME )                  \
  { NAME ## _ = NAME ; }                    \
  const TYPE& NAME() const                    \
  { return NAME ## _; }                     \
private:                              \
  TYPE NAME ## _;                         \
public:

Definition at line 76 of file Teuchos_StandardMemberCompositionMacros.hpp.


Generated on Thu Sep 18 12:42:52 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1