All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
PLMD::Plumed Class Reference

C++ wrapper for plumed. More...

#include <Plumed.h>

Public Member Functions

 Plumed ()
 Constructor. More...
 
 Plumed (const char *c)
 Clone a Plumed object from a FORTRAN char* handler. More...
 
 Plumed (plumed p)
 Clone a Plumed object from a C plumed structure. More...
 
 operator plumed () const
 Retrieve the C plumed structure for this object. More...
 
void toFortran (char *c) const
 Retrieve a FORTRAN handler for this object. More...
 
void cmd (const char *key, const void *val=NULL)
 Send a command to this plumed object. More...
 
virtual ~Plumed ()
 Destructor. More...
 

Static Public Member Functions

static bool installed ()
 Check if plumed is installed (for runtime binding) More...
 
static bool ginitialized ()
 Check if global-plumed has been initialized. More...
 
static void gcreate ()
 Initialize global-plumed. More...
 
static void gcmd (const char *key, const void *val)
 Send a command to global-plumed. More...
 
static void gfinalize ()
 Finalize global-plumed. More...
 
static Plumed global ()
 Returns the Plumed global object. More...
 

Private Member Functions

 Plumed (const Plumed &)
 Copy constructor is disabled (private and unimplemented) The problem here is that after copying it will not be clear who is going to finalize the corresponding plumed structure. More...
 
Plumedoperator= (const Plumed &)
 Assignment operator is disabled (private and unimplemented) The problem here is that after copying it will not be clear who is going to finalize the corresponding plumed structure. More...
 

Private Attributes

plumed main
 
bool cloned
 keeps track if the object was created from scratch using the defaults destructor (cloned=false) or if it was imported from C or FORTRAN (cloned-true). More...
 

Detailed Description

C++ wrapper for plumed.

This class provides a C++ interface to PLUMED.

Definition at line 314 of file Plumed.h.

Constructor & Destructor Documentation

PLMD::Plumed::Plumed ( )
inline

Constructor.

Definition at line 427 of file Plumed.h.

PLMD::Plumed::Plumed ( const char *  c)
inline

Clone a Plumed object from a FORTRAN char* handler.

Parameters
cThe FORTRAN handler (a char[32]).
Attention
The Plumed object created in this manner will not finalize the corresponding plumed structure. It is expected that the FORTRAN code calls plumed_c_finalize for it

Definition at line 433 of file Plumed.h.

PLMD::Plumed::Plumed ( plumed  p)
inline

Clone a Plumed object from a C plumed structure.

Parameters
pThe C plumed structure.
Attention
The Plumed object created in this manner will not finalize the corresponding plumed structure. It is expected that the C code calls plumed_finalize for it

Definition at line 439 of file Plumed.h.

PLMD::Plumed::Plumed ( const Plumed )
private

Copy constructor is disabled (private and unimplemented) The problem here is that after copying it will not be clear who is going to finalize the corresponding plumed structure.

PLMD::Plumed::~Plumed ( )
inlinevirtual

Destructor.

Destructor is virtual so as to allow correct inheritance from Plumed object. To avoid linking problems with g++, I specify "inline" also here (in principle it should be enough to specify it down in the definition of the function, but for some reason that I do not understand g++ does not inline it properly in that case and complains when Plumed.h is included but Plumed.o is not linked. Anyway, the way it is done here seems to work properly).

Definition at line 460 of file Plumed.h.

Member Function Documentation

void PLMD::Plumed::cmd ( const char *  key,
const void *  val = NULL 
)
inline

Send a command to this plumed object.

Parameters
keyThe name of the command to be executed
valThe argument. It is declared as const to allow calls like p.cmd("A","B"), but for some choice of key it can change the content

Definition at line 455 of file Plumed.h.

void PLMD::Plumed::gcmd ( const char *  key,
const void *  val 
)
inlinestatic

Send a command to global-plumed.

Parameters
keyThe name of the command to be executed
valThe argument. It is declared as const to allow calls like gcmd("A","B"), but for some choice of key it can change the content

Definition at line 475 of file Plumed.h.

void PLMD::Plumed::gcreate ( )
inlinestatic

Initialize global-plumed.

Definition at line 470 of file Plumed.h.

void PLMD::Plumed::gfinalize ( )
inlinestatic

Finalize global-plumed.

Definition at line 480 of file Plumed.h.

bool PLMD::Plumed::ginitialized ( )
inlinestatic

Check if global-plumed has been initialized.

Returns
true if global plumed object (see global()) is initialized (i.e. if gcreate() has been called), false otherwise.

Definition at line 465 of file Plumed.h.

Plumed PLMD::Plumed::global ( )
inlinestatic

Returns the Plumed global object.

Returns
The Plumed global object

Definition at line 485 of file Plumed.h.

bool PLMD::Plumed::installed ( )
inlinestatic

Check if plumed is installed (for runtime binding)

Returns
true if plumed is installed, false otherwise

Definition at line 422 of file Plumed.h.

PLMD::Plumed::operator plumed ( ) const
inline

Retrieve the C plumed structure for this object.

Definition at line 445 of file Plumed.h.

Plumed& PLMD::Plumed::operator= ( const Plumed )
private

Assignment operator is disabled (private and unimplemented) The problem here is that after copying it will not be clear who is going to finalize the corresponding plumed structure.

void PLMD::Plumed::toFortran ( char *  c) const
inline

Retrieve a FORTRAN handler for this object.

Parameters
cThe FORTRAN handler (a char[32]).

Definition at line 450 of file Plumed.h.

Member Data Documentation

bool PLMD::Plumed::cloned
private

keeps track if the object was created from scratch using the defaults destructor (cloned=false) or if it was imported from C or FORTRAN (cloned-true).

In the latter case, the plumed_finalize() method is not called when destructing the object, since it is expected to be finalized in the C/FORTRAN code

Definition at line 323 of file Plumed.h.

plumed PLMD::Plumed::main
private

Definition at line 315 of file Plumed.h.


The documentation for this class was generated from the following file: