Teuchos_StandardCompositionMacros.hpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                    Teuchos: Common Tools Package
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef TEUCHOS_STANDARD_COMPOSITION_MACROS_HPP
00030 #define TEUCHOS_STANDARD_COMPOSITION_MACROS_HPP
00031 
00036 #include "Teuchos_RefCountPtr.hpp"
00037 
00063 #define STANDARD_COMPOSITION_MEMBERS( TYPE, NAME ) \
00064   void set_ ## NAME (const Teuchos::RefCountPtr< TYPE >& NAME ) \
00065   { NAME ## _ = NAME ; } \
00066   Teuchos::RefCountPtr< TYPE > get_ ## NAME() const \
00067   { return NAME ## _; } \
00068   TYPE& NAME() \
00069   { return *NAME ## _; } \
00070   const TYPE& NAME() const \
00071   { return *NAME ## _; } \
00072 private: \
00073   Teuchos::RefCountPtr< TYPE > NAME ## _; \
00074 public: \
00075   typedef Teuchos::RefCountPtr< TYPE > NAME ## _ptr_t;
00076 
00102 #define STANDARD_NONCONST_COMPOSITION_MEMBERS( TYPE, NAME ) \
00103   void set_ ## NAME ( const Teuchos::RefCountPtr< TYPE >& NAME ) \
00104   { NAME ## _ = NAME ; } \
00105   Teuchos::RefCountPtr< TYPE > get_ ## NAME() const \
00106   { return NAME ## _; } \
00107   TYPE& NAME() const \
00108   { return *NAME ## _; } \
00109 private: \
00110   Teuchos::RefCountPtr< TYPE > NAME ## _; \
00111 public: \
00112   typedef Teuchos::RefCountPtr< TYPE > NAME ## _ptr_t;
00113 
00139 #define STANDARD_CONST_COMPOSITION_MEMBERS( TYPE, NAME ) \
00140 public: \
00141   void set_ ## NAME ( const Teuchos::RefCountPtr< const TYPE >& NAME ) \
00142   { NAME ## _ = NAME ; } \
00143   Teuchos::RefCountPtr< const TYPE > get_ ## NAME() const \
00144   { return NAME ## _; } \
00145   const TYPE& NAME() const \
00146   { return *NAME ## _; } \
00147 private: \
00148   Teuchos::RefCountPtr< const TYPE > NAME ## _; \
00149 public: \
00150   typedef Teuchos::RefCountPtr< const TYPE > NAME ## _ptr_t;
00151 
00152 #endif  // TEUCHOS_STANDARD_COMPOSITION_MACROS_HPPx

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