LSSTApplications
16.0-1-gce273f5+20,16.0-10-gc1446dd+20,16.0-12-g569485f+3,16.0-13-g5e87145+4,16.0-13-g5f20d24,16.0-13-g80874fd+2,16.0-13-gb122224+11,16.0-13-gd9b1b71+20,16.0-14-g08f9460+3,16.0-15-g77ef378+6,16.0-17-g6a7bfb3b+20,16.0-17-ged3ab9d,16.0-18-gdf247dd+1,16.0-2-g0febb12+16,16.0-2-g839ba83+58,16.0-2-g9d5294e+45,16.0-2-gc6e0ed0+4,16.0-23-ge8a9b866+2,16.0-3-g404ea43+12,16.0-3-gbc759ec+18,16.0-3-gcfd6c53+43,16.0-4-g03cf288+34,16.0-4-g13a27c5+20,16.0-4-g5f3a788+15,16.0-4-g8a0f11a+42,16.0-4-ga3eb747+5,16.0-5-g1991253+20,16.0-5-g1e9226d+3,16.0-5-g865efd9+22,16.0-5-gb3f8a4b+52,16.0-5-gd0f1235+9,16.0-51-gb4b4a8566+2,16.0-7-g6043bfc+8,16.0-7-gd2eeba5+2,16.0-7-gde5bd64+2,16.0-8-g0e813a6,16.0-8-g4dec96c+33,16.0-8-gfd407c0+5,16.0-9-g2f60796+2,master-g5768c874b9+4,w.2018.41
LSSTDataManagementBasePackage
|
Abstract base class for all formatters. More...
#include <Formatter.h>
Public Types | |
typedef std::shared_ptr< Formatter > | Ptr |
typedef Ptr(* | FactoryPtr) (lsst::pex::policy::Policy::Ptr) |
Pointer to a (static) factory function for a Formatter subclass. More... | |
enum | { magicSentinel = 0xdeadbeef } |
typedef unsigned long | memId |
Type of the block's ID. More... | |
typedef memId(* | memNewCallback) (const memId cid) |
A function used to register a callback. More... | |
typedef memId(* | memCallback) (const Citizen *ptr) |
Public Member Functions | |
virtual | ~Formatter (void) |
Minimal destructor. More... | |
virtual void | write (lsst::daf::base::Persistable const *persistable, FormatterStorage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Write a Persistable instance to a FormatterStorage instance. More... | |
virtual lsst::daf::base::Persistable * | read (FormatterStorage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Read a Persistable instance from a FormatterStorage instance. More... | |
virtual void | update (lsst::daf::base::Persistable *persistable, FormatterStorage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Update an existing Persistable instance with information from an additional FormatterStorage instance. More... | |
std::string | repr () const |
Return a string representation of a Citizen. More... | |
void | markPersistent (void) |
Mark a Citizen as persistent and not destroyed until process end. More... | |
memId | getId () const |
Return the Citizen's ID. More... | |
Static Public Member Functions | |
static Formatter::Ptr | lookupFormatter (std::string const &persistableType, lsst::pex::policy::Policy::Ptr policy) |
Lookup Formatter subclass by name of Persistable subclass. More... | |
static Formatter::Ptr | lookupFormatter (std::type_info const &persistableType, lsst::pex::policy::Policy::Ptr policy) |
Lookup Formatter subclass by its type_info from typeid(). More... | |
static bool | hasBeenCorrupted () |
Check all allocated blocks for corruption. More... | |
static memId | getNextMemId () |
Return the memId of the next object to be allocated. More... | |
static int | init () |
Called once when the memory system is being initialised. More... | |
Census | |
Provide a list of current Citizens | |
static int | census (int, memId startingMemId=0) |
How many active Citizens are there? More... | |
static void | census (std::ostream &stream, memId startingMemId=0) |
Print a list of all active Citizens to stream, sorted by ID. More... | |
static const std::vector< const Citizen * > * | census () |
Return a (newly allocated) std::vector of active Citizens sorted by ID. More... | |
callbackIDs | |
Set callback Ids. The old Id is returned | |
static memId | setNewCallbackId (memId id) |
Call the NewCallback when block is allocated. More... | |
static memId | setDeleteCallbackId (memId id) |
Call the current DeleteCallback when block is deleted. More... | |
callbacks | |
Set the New/Delete callback functions; in each case the previously installed callback is returned. These callback functions return a value which is Added to the previously registered id. The default callback functions are called default{New,Delete}Callback; you may want to set a break point in these callbacks from your favourite debugger | |
static memNewCallback | setNewCallback (memNewCallback func) |
Set the NewCallback function. More... | |
static memCallback | setDeleteCallback (memCallback func) |
Set the DeleteCallback function. More... | |
static memCallback | setCorruptionCallback (memCallback func) |
Set the CorruptionCallback function. More... | |
Protected Member Functions | |
Formatter (std::type_info const &type) | |
Constructor. More... | |
Abstract base class for all formatters.
Formatters map Persistable subclasses into an appropriate form for output to FormatterStorage subclasses and vice versa upon retrieval. They also may use an additional piece of data to select the appropriate data for retrieval.
Subclasses of Formatter must register themselves by creating a static instance of the FormatterRegistration class with the name and type_info of the Persistable class they are formatting and a factory method to create instances of the subclass using a Policy. If they are to be used with boost::serialization, subclasses of Formatter must also implement a public static delegateSerialize() template (or a set of static delegateSerialize() functions for each supported archive type).
Definition at line 79 of file Formatter.h.
typedef Ptr(* lsst::daf::persistence::Formatter::FactoryPtr) (lsst::pex::policy::Policy::Ptr) |
Pointer to a (static) factory function for a Formatter subclass.
Definition at line 85 of file Formatter.h.
|
inherited |
Definition at line 81 of file Formatter.h.
|
virtual |
|
explicitprotected |
Constructor.
[in] | type | typeid() of subclass |
Definition at line 68 of file Formatter.cc.
|
staticinherited |
How many active Citizens are there?
startingMemId | Don't print Citizens with lower IDs |
Definition at line 238 of file Citizen.cc.
|
staticinherited |
Print a list of all active Citizens to stream, sorted by ID.
stream | stream to print to |
startingMemId | Don't print Citizens with lower IDs |
Definition at line 259 of file Citizen.cc.
|
staticinherited |
Return a (newly allocated) std::vector of active Citizens sorted by ID.
You are responsible for deleting it; or you can say std::unique_ptr<std::vector<Citizen const*> const> leaks(Citizen::census()); and not bother (that becomes std::unique_ptr in C++11)
Definition at line 287 of file Citizen.cc.
|
inherited |
|
staticinherited |
Return the memId of the next object to be allocated.
Definition at line 209 of file Citizen.cc.
|
staticinherited |
Check all allocated blocks for corruption.
Definition at line 316 of file Citizen.cc.
|
staticinherited |
Called once when the memory system is being initialised.
Definition at line 196 of file Citizen.cc.
|
static |
Lookup Formatter subclass by name of Persistable subclass.
[in] | name | Name of Persistable subclass |
[in] | policy | Policy for configuring the Formatter |
Returned pointer is not owned and should not be deleted.
Definition at line 84 of file Formatter.cc.
|
static |
Lookup Formatter subclass by its type_info from typeid().
[in] | type | std::type_info of Formatter subclass from typeid() |
[in] | policy | Policy for configuring the Formatter |
Definition at line 94 of file Formatter.cc.
|
inherited |
Mark a Citizen as persistent and not destroyed until process end.
Definition at line 225 of file Citizen.cc.
|
pure virtual |
Read a Persistable instance from a FormatterStorage instance.
[in] | storage | Pointer to the FormatterStorage instance. |
[in] | additionalData | Additional data used to find the proper instance within the FormatterStorage. |
|
inherited |
Return a string representation of a Citizen.
Definition at line 219 of file Citizen.cc.
|
staticinherited |
Set the CorruptionCallback function.
func | function be called when block is found to be corrupted |
Definition at line 391 of file Citizen.cc.
|
staticinherited |
Set the DeleteCallback function.
func | function be called when desired block is deleted |
Definition at line 381 of file Citizen.cc.
|
staticinherited |
Call the current DeleteCallback when block is deleted.
id | Desired ID |
Definition at line 347 of file Citizen.cc.
|
staticinherited |
Set the NewCallback function.
func | The new function to be called when a designated block is allocated |
Definition at line 371 of file Citizen.cc.
|
staticinherited |
Call the NewCallback when block is allocated.
id | Desired ID |
Definition at line 337 of file Citizen.cc.
|
pure virtual |
Update an existing Persistable instance with information from an additional FormatterStorage instance.
[in,out] | persistable | Pointer to the Persistable instance. |
[in] | storage | Shared pointer to the additional FormatterStorage instance. |
[in] | additionalData | Additional data used to find the proper instance within the FormatterStorage. |
|
pure virtual |
Write a Persistable instance to a FormatterStorage instance.
[in] | persistable | Pointer to the Persistable instance. |
[in] | storage | Shared pointer to the FormatterStorage instance. |
[in] | additionalData | Additional data used to find the proper place to put the instance into the FormatterStorage. |