Loading...
Searching...
No Matches
PLMD::Register Class Referenceabstract

Base class, with type independent information. More...

#include <RegisterBase.h>

Inheritance diagram for PLMD::Register:

Classes

class  RegistrationLock
 Small class to manage registration lock This is used during dlopen, to avoid data races in registrations. More...
 

Public Member Functions

 Register ()
 Constructor.
 
 Register (const Register &)=delete
 Disable copy.
 
 Register (Register &&)=delete
 Disable move.
 
virtual ~Register () noexcept
 Destructor.
 
std::vector< std::string > getKeysWithDLHandle (void *handle) const
 Get only keys registered specifically by a given image.
 

Static Public Member Functions

static void completeAllRegistrations (void *image)
 Save all staged objects in all registers.
 
static RegistrationLock registrationLock (const std::string &fullpath)
 return a registration lock
 

Protected Member Functions

virtual void clearStaged () noexcept=0
 Clear staged objects.
 
virtual void completeRegistration (void *image)=0
 Save all staged objects from a register.
 
virtual std::vector< std::string > getKeys () const =0
 Get all registered keys.
 

Static Protected Member Functions

static const std::string getRegisteringFullPath () noexcept
 Return the path of the currently-loading library.
 
static std::string imageToString (void *image)
 Internal tool to format image addresses.
 
static bool isDLRegistering () noexcept
 Check if we are in a dlopen section.
 

Protected Attributes

std::shared_mutex mutex
 Mutex protecting access to map.
 

Static Private Member Functions

static void popDLRegistration () noexcept
 Finalize registration - only used by registrationLock()
 
static void pushDLRegistration (const std::string &fullpath)
 Initialize registration - only used by registrationLock()
 

Friends

std::ostream & operator<< (std::ostream &log, const Register &reg)
 

Detailed Description

Base class, with type independent information.

Actual registers should inherit through the RegisterBase class below

Constructor & Destructor Documentation

◆ Register() [1/3]

PLMD::Register::Register ( )

Constructor.

This keeps track of all created instances.

◆ ~Register()

PLMD::Register::~Register ( )
virtualnoexcept

Destructor.

◆ Register() [2/3]

PLMD::Register::Register ( Register && )
delete

Disable move.

◆ Register() [3/3]

PLMD::Register::Register ( const Register & )
delete

Disable copy.

Member Function Documentation

◆ clearStaged()

virtual void PLMD::Register::clearStaged ( )
protectedpure virtualnoexcept

Clear staged objects.

Should be used when leaving the dlopen section to remove any dangling object.

Implemented in PLMD::RegisterBase< Content >, PLMD::RegisterBase< ActionRegisterPointers >, and PLMD::RegisterBase< CLToolRegisterPointers >.

◆ completeAllRegistrations()

void PLMD::Register::completeAllRegistrations ( void * image)
static

Save all staged objects in all registers.

◆ completeRegistration()

virtual void PLMD::Register::completeRegistration ( void * image)
protectedpure virtual

◆ getKeys()

virtual std::vector< std::string > PLMD::Register::getKeys ( ) const
protectedpure virtual

Get all registered keys.

These are the keys in the map, not the plumed keywords!

Implemented in PLMD::RegisterBase< Content >, PLMD::RegisterBase< ActionRegisterPointers >, and PLMD::RegisterBase< CLToolRegisterPointers >.

◆ getKeysWithDLHandle()

std::vector< std::string > PLMD::Register::getKeysWithDLHandle ( void * handle) const

Get only keys registered specifically by a given image.

◆ getRegisteringFullPath()

const std::string PLMD::Register::getRegisteringFullPath ( )
staticprotectednoexcept

Return the path of the currently-loading library.

◆ imageToString()

std::string PLMD::Register::imageToString ( void * image)
staticprotected

Internal tool to format image addresses.

◆ isDLRegistering()

bool PLMD::Register::isDLRegistering ( )
staticprotectednoexcept

Check if we are in a dlopen section.

◆ popDLRegistration()

void PLMD::Register::popDLRegistration ( )
staticprivatenoexcept

Finalize registration - only used by registrationLock()

◆ pushDLRegistration()

void PLMD::Register::pushDLRegistration ( const std::string & fullpath)
staticprivate

Initialize registration - only used by registrationLock()

◆ registrationLock()

Register::RegistrationLock PLMD::Register::registrationLock ( const std::string & fullpath)
static

return a registration lock

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & log,
const Register & reg )
friend

Member Data Documentation

◆ mutex

std::shared_mutex PLMD::Register::mutex
mutableprotected

Mutex protecting access to map.


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