Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_StandardCompositionMacros.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_STANDARD_COMPOSITION_MACROS_HPP
11 #define TEUCHOS_STANDARD_COMPOSITION_MACROS_HPP
12 
17 #include "Teuchos_RCP.hpp"
18 
45 #define STANDARD_COMPOSITION_MEMBERS( TYPE, NAME ) \
46  void set_ ## NAME (const Teuchos::RCP< TYPE >& NAME ## _in ) \
47  { NAME ## _ = NAME ## _in ; } \
48  Teuchos::RCP< TYPE > get_ ## NAME() const \
49  { return NAME ## _; } \
50  TYPE& NAME() \
51  { return *NAME ## _; } \
52  const TYPE& NAME() const \
53  { return *NAME ## _; } \
54 private: \
55  Teuchos::RCP< TYPE > NAME ## _; \
56 public: \
57  typedef Teuchos::RCP< TYPE > NAME ## _ptr_t
58 
85 #define STANDARD_NONCONST_COMPOSITION_MEMBERS( TYPE, NAME ) \
86  void set_ ## NAME ( const Teuchos::RCP< TYPE >& NAME ## _in ) \
87  { NAME ## _ = NAME ## _in ; } \
88  Teuchos::RCP< TYPE > get_ ## NAME() const \
89  { return NAME ## _; } \
90  TYPE& NAME() const \
91  { return *NAME ## _; } \
92 private: \
93  Teuchos::RCP< TYPE > NAME ## _; \
94 public: \
95  typedef Teuchos::RCP< TYPE > NAME ## _ptr_t
96 
124 #define STANDARD_CONST_COMPOSITION_MEMBERS( TYPE, NAME ) \
125 public: \
126  void set_ ## NAME ( const Teuchos::RCP< const TYPE >& NAME ## _in ) \
127  { NAME ## _ = NAME ## _in ; } \
128  Teuchos::RCP< const TYPE > get_ ## NAME() const \
129  { return NAME ## _; } \
130  const TYPE& NAME() const \
131  { return *NAME ## _; } \
132 private: \
133  Teuchos::RCP< const TYPE > NAME ## _; \
134 public: \
135  typedef Teuchos::RCP< const TYPE > NAME ## _ptr_t
136 
137 #endif // TEUCHOS_STANDARD_COMPOSITION_MACROS_HPP
Reference-counted pointer class and non-member templated function implementations.