Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros
Teuchos_StandardCompositionMacros.hpp File Reference

Macro that adds <<std comp>="">> members as attribute members for any class. More...

#include "Teuchos_RCP.hpp"
Include dependency graph for Teuchos_StandardCompositionMacros.hpp:

Go to the source code of this file.

Macros

#define STANDARD_COMPOSITION_MEMBERS(TYPE, NAME)
 Macro that adds <<std comp>="">> members for a composition association. More...
 
#define STANDARD_NONCONST_COMPOSITION_MEMBERS(TYPE, NAME)
 Macro that adds <<std comp>="">> members for a composition association. More...
 
#define STANDARD_CONST_COMPOSITION_MEMBERS(TYPE, NAME)
 Macro that adds <<std comp>="">> members for a composition association where the contained object is always constant. More...
 

Detailed Description

Macro that adds <<std comp>="">> members as attribute members for any class.

Definition in file Teuchos_StandardCompositionMacros.hpp.

Macro Definition Documentation

#define STANDARD_COMPOSITION_MEMBERS (   TYPE,
  NAME 
)
Value:
void set_ ## NAME (const Teuchos::RCP< TYPE >& NAME ## _in ) \
{ NAME ## _ = NAME ## _in ; } \
Teuchos::RCP< TYPE > get_ ## NAME() const \
{ return NAME ## _; } \
TYPE& NAME() \
{ return *NAME ## _; } \
const TYPE& NAME() const \
{ return *NAME ## _; } \
private: \
Teuchos::RCP< TYPE > NAME ## _; \
public: \
typedef Teuchos::RCP< TYPE > NAME ## _ptr_t
Smart reference counting pointer class for automatic garbage collection.

Macro that adds <<std comp>="">> members for a composition association.

This form is for when the object being held will have const attributes the same as the this object.

For example, if you want to include a <<std comp>="">> association with an non-const 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_COMPOSITION_MEMBERS( MyClass, my_object );
};

Note that the macro adds the following data member to the class declaration:

private:
  Teuchos::RCP< TYPE > NAME_;   

Definition at line 77 of file Teuchos_StandardCompositionMacros.hpp.

#define STANDARD_NONCONST_COMPOSITION_MEMBERS (   TYPE,
  NAME 
)
Value:
void set_ ## NAME ( const Teuchos::RCP< TYPE >& NAME ## _in ) \
{ NAME ## _ = NAME ## _in ; } \
Teuchos::RCP< TYPE > get_ ## NAME() const \
{ return NAME ## _; } \
TYPE& NAME() const \
{ return *NAME ## _; } \
private: \
Teuchos::RCP< TYPE > NAME ## _; \
public: \
typedef Teuchos::RCP< TYPE > NAME ## _ptr_t
Smart reference counting pointer class for automatic garbage collection.

Macro that adds <<std comp>="">> members for a composition association.

This form is for when the object being held will have non-const attributes irrespective of the const of this.

For example, if you want to include a <<std comp>="">> association with an non-const 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_NONCONST_COMPOSITION_MEMBERS( MyClass, my_object );
};

Note that the macro adds the following data member to the class declaration:

private:
  Teuchos::RCP< TYPE > NAME_;   

Definition at line 117 of file Teuchos_StandardCompositionMacros.hpp.

#define STANDARD_CONST_COMPOSITION_MEMBERS (   TYPE,
  NAME 
)
Value:
public: \
void set_ ## NAME ( const Teuchos::RCP< const TYPE >& NAME ## _in ) \
{ NAME ## _ = NAME ## _in ; } \
Teuchos::RCP< const TYPE > get_ ## NAME() const \
{ return NAME ## _; } \
const TYPE& NAME() const \
{ return *NAME ## _; } \
private: \
Teuchos::RCP< const TYPE > NAME ## _; \
public: \
typedef Teuchos::RCP< const TYPE > NAME ## _ptr_t
Smart reference counting pointer class for automatic garbage collection.

Macro that adds <<std comp>="">> members for a composition association where the contained object is always constant.

This form is for when the object being held will have const attributes irrespective of the const of this.

For example, if you want to include a <<std comp>="">> association with a const 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_CONST_COMPOSITION_MEMBERS( MyClass, my_object );
};

Note that the macro adds the following data member to the class declaration:

private:
  NAME_ptr_t NAME_;   

Definition at line 156 of file Teuchos_StandardCompositionMacros.hpp.