Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
Classes | Namespaces | Macros
Teuchos_Handle.hpp File Reference
#include "Teuchos_ConfigDefs.hpp"
#include "Teuchos_RCP.hpp"
#include "Teuchos_Describable.hpp"
#include "Teuchos_Handleable.hpp"
Include dependency graph for Teuchos_Handle.hpp:

Go to the source code of this file.

Classes

class  Teuchos::ConstHandle< PointerType >
 Templated handle class with strong const protection. More...
 
class  Teuchos::Handle< PointerType >
 Generic templated handle class. More...
 

Namespaces

 Teuchos
 

Macros

#define TEUCHOS_HANDLE_CTORS(handle, contents)
 This helper macro defines boilerplate constructors for classes deriving from Handle. More...
 
#define TEUCHOS_CONST_HANDLE_CTORS(handle, contents)
 . This helper macro defines boilerplate constructors for classes deriving from ConstHandle. More...
 

Macro Definition Documentation

◆ TEUCHOS_HANDLE_CTORS

#define TEUCHOS_HANDLE_CTORS (   handle,
  contents 
)
Value:
handle() : Teuchos::Handle<contents >() {;} \
handle(Teuchos::Handleable<contents >* rawPtr) : Teuchos::Handle<contents >(rawPtr) {;} \
handle(const Teuchos::RCP<contents >& smartPtr) : Teuchos::Handle<contents >(smartPtr){;}

This helper macro defines boilerplate constructors for classes deriving from Handle.

If class MyHandle is a handle to a type MyType, simply put

TEUCHOS_HANDLE_CTORS(MyHandle, MyType);

in the class declaration of MyHandle and the macro will create an empty ctor, a ctor from a smart ptr, and a ctor from a raw pointer. The macro will also create appropriate doxygen for the handle ctors

Definition at line 179 of file Teuchos_Handle.hpp.

◆ TEUCHOS_CONST_HANDLE_CTORS

#define TEUCHOS_CONST_HANDLE_CTORS (   handle,
  contents 
)
Value:
handle( Teuchos::ENull _null = Teuchos::null ) : Teuchos::ConstHandle<contents >() {;} \
handle(const Teuchos::ConstHandleable<contents >* rawPtr) : Teuchos::ConstHandle<contents >(rawPtr) {;} \
handle(const Teuchos::RCP<const contents >& smartPtr) : Teuchos::ConstHandle<contents >(smartPtr){;}

. This helper macro defines boilerplate constructors for classes deriving from ConstHandle.

If class MyHandle is a const handle to a type MyType, simply put

TEUCHOS_CONST_HANDLE_CTORS(MyHandle, MyType);

in the class declaration of MyHandle and the macro will create an empty ctor, a ctor from a smart ptr, and a ctor from a raw pointer. The macro will also create appropriate doxygen for the handle ctors

Definition at line 195 of file Teuchos_Handle.hpp.

Teuchos::ConstHandleable
Class ConstHandleable provides an abstract interface for polymorphic conversion from raw pointers to ...
Definition: Teuchos_Handleable.hpp:66
Teuchos::Handleable
Class Handleable provides an abstract interface for polymorphic conversion from raw pointers to smart...
Definition: Teuchos_Handleable.hpp:92
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition: Teuchos_RCPDecl.hpp:429
Teuchos::null
Definition: Teuchos_ENull.hpp:54
TEUCHOS_CONST_HANDLE_CTORS
#define TEUCHOS_CONST_HANDLE_CTORS(handle, contents)
. This helper macro defines boilerplate constructors for classes deriving from ConstHandle.
Definition: Teuchos_Handle.hpp:195
Teuchos
Definition: Teuchos_AbstractFactory.hpp:47
TEUCHOS_HANDLE_CTORS
#define TEUCHOS_HANDLE_CTORS(handle, contents)
This helper macro defines boilerplate constructors for classes deriving from Handle.
Definition: Teuchos_Handle.hpp:179