Safir SDK Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Safir::Utilities::Synchronized Class Referenceabstract

Interface for a synchronized object. More...

#include <StartupSynchronizer.h>

Public Member Functions

virtual ~Synchronized ()
 
virtual void Create ()=0
 Guarantees are that only one call to Create in all processes will be made. More...
 
virtual void Use ()=0
 All processes will get a call to Use, even the one that got the Create callback. More...
 
virtual void Destroy ()=0
 This callback will be called when the last process destroys its StartupSynchronizer. More...
 

Detailed Description

Interface for a synchronized object.

Note that NONE of these callbacks are exception safe! If you let an exception propagate through the callback anything could happen!

Constructor & Destructor Documentation

virtual Safir::Utilities::Synchronized::~Synchronized ( )
virtual

Member Function Documentation

virtual void Safir::Utilities::Synchronized::Create ( )
pure virtual

Guarantees are that only one call to Create in all processes will be made.

Even the process that gets a call to Create will get a call to Use after Create is finished. Use this callback to create the shared resource.

Note that this callback must not assume that a previous instance has been able to call Destroy (see below), but may have to perform cleanup before creating the shared resource.

virtual void Safir::Utilities::Synchronized::Destroy ( )
pure virtual

This callback will be called when the last process destroys its StartupSynchronizer.

Use it to perform any cleanup.

Note that a call to Destroy is not guaranteed, only a best effort is made to call this. The last instance could be killed by a signal anyway, so there is no point in making this a strong guarantee.

virtual void Safir::Utilities::Synchronized::Use ( )
pure virtual

All processes will get a call to Use, even the one that got the Create callback.

Use this callback to open the shared resource for use.


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