Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Member Functions | Friends | List of all members
PLMD::Register Class Referenceabstract

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

#include <RegisterBase.h>

Inheritance diagram for PLMD::Register:
Inheritance graph
[legend]

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

Static Public Member Functions

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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

std::shared_mutex mutex
 Mutex protecting access to map. More...
 

Static Private Member Functions

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

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 >.

◆ 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 Function 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: