lsst.daf.base  13.0-5-g99bcfa4+11
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
lsst::daf::base::PropertyList Class Reference

Class for storing ordered metadata with comments. More...

#include <PropertyList.h>

Inheritance diagram for lsst::daf::base::PropertyList:
lsst::daf::base::PropertySet lsst::daf::base::Persistable lsst::daf::base::Citizen

Public Types

typedef std::shared_ptr< PropertyListPtr
 
typedef std::shared_ptr< PropertyList const > ConstPtr
 
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

 PropertyList (void)
 Constructor. More...
 
virtual ~PropertyList (void)
 Destructor. More...
 
virtual PropertySet::Ptr deepCopy (void) const
 Copy the PropertyList and all of its contents. More...
 
template<typename T >
get (std::string const &name) const
 Get the last value for a property name (possibly hierarchical). More...
 
template<typename T >
get (std::string const &name, T const &defaultValue) const
 Get the last value for a property name (possibly hierarchical). More...
 
template<typename T >
std::vector< T > getArray (std::string const &name) const
 
std::string const & getComment (std::string const &name) const
 Get the comment for a string property name (possibly hierarchical). More...
 
std::vector< std::stringgetOrderedNames (void) const
 
std::list< std::string >::const_iterator begin (void) const
 
std::list< std::string >::const_iterator end (void) const
 
virtual std::string toString (bool topLevelOnly=false, std::string const &indent="") const
 Generate a string representation of the PropertyList. More...
 
template<typename T >
void set (std::string const &name, T const &value)
 Replace all values for a property name (possibly hierarchical) with a new value. More...
 
void set (std::string const &name, PropertySet::Ptr const &value)
 
template<typename T >
void set (std::string const &name, std::vector< T > const &value)
 Replace all values for a property name (possibly hierarchical) with a vector of new values. More...
 
void set (std::string const &name, char const *value)
 Replace all values for a property name (possibly hierarchical) with a string value. More...
 
template<typename T >
void add (std::string const &name, T const &value)
 Appends a single value to the vector of values for a property name (possibly hierarchical). More...
 
template<typename T >
void add (std::string const &name, std::vector< T > const &value)
 Appends a vector of values to the vector of values for a property name (possibly hierarchical). More...
 
void add (std::string const &name, char const *value)
 Appends a char const* value to the vector of values for a property name (possibly hierarchical). More...
 
template<typename T >
void set (std::string const &name, T const &value, std::string const &comment)
 Replace all values for a property name (possibly hierarchical) with a new value. More...
 
template<typename T >
void set (std::string const &name, std::vector< T > const &value, std::string const &comment)
 Replace all values for a property name (possibly hierarchical) with a vector of new values. More...
 
void set (std::string const &name, char const *value, std::string const &comment)
 Replace all values for a property name (possibly hierarchical) with a string value. More...
 
template<typename T >
void add (std::string const &name, T const &value, std::string const &comment)
 Appends a single value to the vector of values for a property name (possibly hierarchical). More...
 
template<typename T >
void add (std::string const &name, std::vector< T > const &value, std::string const &comment)
 Appends a vector of values to the vector of values for a property name (possibly hierarchical). More...
 
void add (std::string const &name, char const *value, std::string const &comment)
 Appends a char const* value to the vector of values for a property name (possibly hierarchical). More...
 
template<typename T >
void set (std::string const &name, T const &value, char const *comment)
 
template<typename T >
void set (std::string const &name, std::vector< T > const &value, char const *comment)
 
void set (std::string const &name, char const *value, char const *comment)
 
template<typename T >
void add (std::string const &name, T const &value, char const *comment)
 
template<typename T >
void add (std::string const &name, std::vector< T > const &value, char const *comment)
 
void add (std::string const &name, char const *value, char const *comment)
 
virtual void copy (std::string const &dest, PropertySet::ConstPtr source, std::string const &name)
 Replaces a single value vector in the destination with one from the source. More...
 
virtual void combine (PropertySet::ConstPtr source)
 Appends all value vectors from the source to their corresponding properties. More...
 
virtual void remove (std::string const &name)
 Removes all values for a property name (possibly hierarchical). More...
 
template<typename T >
vector< T > getArray (string const &name) const
 Get the vector of values for a property name (possibly hierarchical). More...
 
size_t nameCount (bool topLevelOnly=true) const
 Get the number of names in the PropertySet, optionally including those in subproperties. More...
 
std::vector< std::stringnames (bool topLevelOnly=true) const
 Get the names in the PropertySet, optionally including those in subproperties. More...
 
std::vector< std::stringparamNames (bool topLevelOnly=true) const
 Get the names of parameters (non-subproperties) in the PropertySet, optionally including those in subproperties. More...
 
std::vector< std::stringpropertySetNames (bool topLevelOnly=true) const
 Get the names of subproperties in the PropertySet, optionally including those in subproperties. More...
 
bool exists (std::string const &name) const
 Determine if a name (possibly hierarchical) exists. More...
 
bool isArray (std::string const &name) const
 Determine if a name (possibly hierarchical) has multiple values. More...
 
bool isPropertySetPtr (std::string const &name) const
 Determine if a name (possibly hierarchical) is a subproperty. More...
 
size_t valueCount (std::string const &name) const
 Get number of values for a property name (possibly hierarchical). More...
 
std::type_info const & typeOf (std::string const &name) const
 Get the type of values for a property name (possibly hierarchical). More...
 
bool getAsBool (std::string const &name) const
 Get the last value for a bool property name (possibly hierarchical). More...
 
int getAsInt (std::string const &name) const
 Get the last value for a bool/char/short/int property name (possibly hierarchical). More...
 
int64_t getAsInt64 (std::string const &name) const
 Get the last value for a bool/char/short/int/int64_t property name (possibly hierarchical). More...
 
double getAsDouble (std::string const &name) const
 Get the last value for any arithmetic property name (possibly hierarchical). More...
 
std::string getAsString (std::string const &name) const
 Get the last value for a string property name (possibly hierarchical). More...
 
PropertySet::Ptr getAsPropertySetPtr (std::string const &name) const
 Get the last value for a subproperty name (possibly hierarchical). More...
 
Persistable::Ptr getAsPersistablePtr (std::string const &name) const
 Get the last value for a Persistable name (possibly hierarchical). More...
 
template<class Archive >
void serialize (Archive &, unsigned int const)
 Template boost::serialization function for the base class. 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 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

virtual void _add (std::string const &name, std::shared_ptr< std::vector< boost::any > > vp)
 Finds the property name (possibly hierarchical) and appends or sets its value with the given vector of values. More...
 
virtual std::string _format (std::string const &name) const
 

Detailed Description

Class for storing ordered metadata with comments.

This class stores key/value pairs like PropertySet, of which it is a subclass. The difference is that the PropertyList maintains the order of the key/value pairs according to how they were inserted. By default, replacing the value of an existing key does not change its ordering. In addition, a comment string may be associated with each key/value pair.

The main motivating use case for PropertyList is FITS headers.

PropertyLists are not truly hierarchical, although they accept dotted paths as keys. If a PropertySet or PropertyList is added as a value to a PropertyList, the hierarchical pathnames are flattened into the resulting PropertyList.

Definition at line 82 of file PropertyList.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 86 of file PropertyList.h.

◆ memCallback

typedef memId(* lsst::daf::base::Citizen::memCallback) (const Citizen *ptr)
inherited

Definition at line 59 of file Citizen.h.

◆ memId

typedef unsigned long lsst::daf::base::Citizen::memId
inherited

Type of the block's ID.

Definition at line 56 of file Citizen.h.

◆ memNewCallback

typedef memId(* lsst::daf::base::Citizen::memNewCallback) (const memId cid)
inherited

A function used to register a callback.

Definition at line 58 of file Citizen.h.

◆ Ptr

Definition at line 85 of file PropertyList.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
magicSentinel 

Definition at line 86 of file Citizen.h.

Constructor & Destructor Documentation

◆ PropertyList()

lsst::daf::base::PropertyList::PropertyList ( void  )

Constructor.

Definition at line 57 of file PropertyList.cc.

◆ ~PropertyList()

lsst::daf::base::PropertyList::~PropertyList ( void  )
virtual

Destructor.

Definition at line 62 of file PropertyList.cc.

Member Function Documentation

◆ _add()

void lsst::daf::base::PropertySet::_add ( std::string const &  name,
std::shared_ptr< std::vector< boost::any > >  vp 
)
protectedvirtualinherited

Finds the property name (possibly hierarchical) and appends or sets its value with the given vector of values.

Parameters
[in]nameProperty name to find, possibly hierarchical.
[in]vpshared_ptr to vector of values.
Exceptions
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 848 of file PropertySet.cc.

◆ _format()

std::string lsst::daf::base::PropertySet::_format ( std::string const &  name) const
protectedvirtualinherited

Definition at line 507 of file PropertySet.cc.

◆ add() [1/9]

template<typename T >
void lsst::daf::base::PropertyList::add ( std::string const &  name,
T const &  value 
)

Appends a single value to the vector of values for a property name (possibly hierarchical).

Sets the value if the property does not exist.

Parameters
[in]nameProperty name to append to, possibly hierarchical.
[in]valueValue to append.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 238 of file PropertyList.cc.

◆ add() [2/9]

template<typename T >
void lsst::daf::base::PropertyList::add ( std::string const &  name,
std::vector< T > const &  value 
)

Appends a vector of values to the vector of values for a property name (possibly hierarchical).

Sets the values if the property does not exist.

Parameters
[in]nameProperty name to append to, possibly hierarchical.
[in]valueVector of values to append.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorHierarchical name uses non-PropertySet.
Note
May only partially add the vector if an exception occurs.

Definition at line 266 of file PropertyList.cc.

◆ add() [3/9]

void lsst::daf::base::PropertyList::add ( std::string const &  name,
char const *  value 
)

Appends a char const* value to the vector of values for a property name (possibly hierarchical).

Sets the value if the property does not exist.

Parameters
[in]nameProperty name to append to, possibly hierarchical.
[in]valueValue to append.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 251 of file PropertyList.cc.

◆ add() [4/9]

template<typename T >
void lsst::daf::base::PropertyList::add ( std::string const &  name,
T const &  value,
std::string const &  comment 
)

Appends a single value to the vector of values for a property name (possibly hierarchical).

Sets the value if the property does not exist.

Parameters
[in]nameProperty name to append to, possibly hierarchical.
[in]valueValue to append.
[in]commentComment to set.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 327 of file PropertyList.cc.

◆ add() [5/9]

template<typename T >
void lsst::daf::base::PropertyList::add ( std::string const &  name,
std::vector< T > const &  value,
std::string const &  comment 
)

Appends a vector of values to the vector of values for a property name (possibly hierarchical).

Sets the values if the property does not exist.

Parameters
[in]nameProperty name to append to, possibly hierarchical.
[in]valueVector of values to append.
[in]commentComment to set.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorHierarchical name uses non-PropertySet.
Note
May only partially add the vector if an exception occurs.

Definition at line 361 of file PropertyList.cc.

◆ add() [6/9]

void lsst::daf::base::PropertyList::add ( std::string const &  name,
char const *  value,
std::string const &  comment 
)

Appends a char const* value to the vector of values for a property name (possibly hierarchical).

Sets the value if the property does not exist.

Parameters
[in]nameProperty name to append to, possibly hierarchical.
[in]valueString value to append.
[in]commentComment to set.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 344 of file PropertyList.cc.

◆ add() [7/9]

template<typename T >
void lsst::daf::base::PropertyList::add ( std::string const &  name,
T const &  value,
char const *  comment 
)
inline

Definition at line 166 of file PropertyList.h.

◆ add() [8/9]

template<typename T >
void lsst::daf::base::PropertyList::add ( std::string const &  name,
std::vector< T > const &  value,
char const *  comment 
)
inline

Definition at line 171 of file PropertyList.h.

◆ add() [9/9]

void lsst::daf::base::PropertyList::add ( std::string const &  name,
char const *  value,
char const *  comment 
)
inline

Definition at line 176 of file PropertyList.h.

◆ begin()

std::list< std::string >::const_iterator lsst::daf::base::PropertyList::begin ( void  ) const

Definition at line 143 of file PropertyList.cc.

◆ census() [1/3]

int lsst::daf::base::Citizen::census ( int  ,
memId  startingMemId = 0 
)
staticinherited

How many active Citizens are there?

Parameters
startingMemIdDon't print Citizens with lower IDs

Definition at line 267 of file Citizen.cc.

◆ census() [2/3]

void lsst::daf::base::Citizen::census ( std::ostream stream,
memId  startingMemId = 0 
)
staticinherited

Print a list of all active Citizens to stream, sorted by ID.

Parameters
streamstream to print to
startingMemIdDon't print Citizens with lower IDs

Definition at line 290 of file Citizen.cc.

◆ census() [3/3]

std::vector< dafBase::Citizen const * > const * lsst::daf::base::Citizen::census ( )
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 322 of file Citizen.cc.

◆ combine()

void lsst::daf::base::PropertyList::combine ( PropertySet::ConstPtr  source)
virtual

Appends all value vectors from the source to their corresponding properties.

Sets values if a property does not exist.

Parameters
[in]sourcePropertySet::Ptr for the source PropertySet.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorHierarchical name uses non-PropertySet.
Note
May only partially combine the PropertySets if an exception occurs.

Reimplemented from lsst::daf::base::PropertySet.

Definition at line 401 of file PropertyList.cc.

◆ copy()

void lsst::daf::base::PropertyList::copy ( std::string const &  dest,
PropertySet::ConstPtr  source,
std::string const &  name 
)
virtual

Replaces a single value vector in the destination with one from the source.

Parameters
[in]destDestination property name.
[in]sourcePropertySet::Ptr for the source PropertySet.
[in]nameProperty name to extract.
Exceptions
TypeErrorType does not match existing values.
InvalidParameterErrorName does not exist in source.
InvalidParameterErrorHierarchical name uses non-PropertySet.

Reimplemented from lsst::daf::base::PropertySet.

Definition at line 381 of file PropertyList.cc.

◆ deepCopy()

PropertySet::Ptr lsst::daf::base::PropertyList::deepCopy ( void  ) const
virtual

Copy the PropertyList and all of its contents.

Returns
PropertySet::Ptr pointing to the new copy.

Reimplemented from lsst::daf::base::PropertySet.

Definition at line 72 of file PropertyList.cc.

◆ end()

std::list< std::string >::const_iterator lsst::daf::base::PropertyList::end ( void  ) const

Definition at line 148 of file PropertyList.cc.

◆ exists()

bool lsst::daf::base::PropertySet::exists ( std::string const &  name) const
inherited

Determine if a name (possibly hierarchical) exists.

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
true if property exists.

Definition at line 190 of file PropertySet.cc.

◆ get() [1/2]

template<typename T >
T lsst::daf::base::PropertyList::get ( std::string const &  name) const

Get the last value for a property name (possibly hierarchical).

Note that the type must be explicitly specified for this template:

int i = propertyList.get<int>("foo")
Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Last value set or added.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue does not match desired type.

Definition at line 91 of file PropertyList.cc.

◆ get() [2/2]

template<typename T >
T lsst::daf::base::PropertyList::get ( std::string const &  name,
T const &  defaultValue 
) const

Get the last value for a property name (possibly hierarchical).

Returns the provided defaultValue if the property does not exist. Note that the type must be explicitly specified for this template:

int i = propertyList.get<int>("foo", 42)
Parameters
[in]nameProperty name to examine, possibly hierarchical.
[in]defaultValueDefault value to return if property does not exist.
Returns
Last value set or added.
Exceptions
TypeErrorValue does not match desired type.

Definition at line 105 of file PropertyList.cc.

◆ getArray() [1/2]

template<typename T >
std::vector<T> lsst::daf::base::PropertyList::getArray ( std::string const &  name) const

◆ getArray() [2/2]

template<typename T >
vector<T> lsst::daf::base::PropertyList::getArray ( string const &  name) const

Get the vector of values for a property name (possibly hierarchical).

Note that the type must be explicitly specified for this template:

vector<int> v = propertyList.getArray<int>("foo")
Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Vector of values.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue does not match desired type.

Definition at line 118 of file PropertyList.cc.

◆ getAsBool()

bool lsst::daf::base::PropertySet::getAsBool ( std::string const &  name) const
inherited

Get the last value for a bool property name (possibly hierarchical).

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Value as a bool.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue is not a bool.

Definition at line 321 of file PropertySet.cc.

◆ getAsDouble()

double lsst::daf::base::PropertySet::getAsDouble ( std::string const &  name) const
inherited

Get the last value for any arithmetic property name (possibly hierarchical).

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Value as a double.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue cannot be converted to double.

Definition at line 406 of file PropertySet.cc.

◆ getAsInt()

int lsst::daf::base::PropertySet::getAsInt ( std::string const &  name) const
inherited

Get the last value for a bool/char/short/int property name (possibly hierarchical).

Unsigned int properties are not acceptable, but unsigned versions of smaller types are.

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Value as an int.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue cannot be converted to int.

Definition at line 333 of file PropertySet.cc.

◆ getAsInt64()

int64_t lsst::daf::base::PropertySet::getAsInt64 ( std::string const &  name) const
inherited

Get the last value for a bool/char/short/int/int64_t property name (possibly hierarchical).

Unsigned int64_t properties are not acceptable, but unsigned versions of smaller types are, except possibly unsigned long, depending on compiler.

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Value as an int64_t.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue cannot be converted to int64_t.

Definition at line 372 of file PropertySet.cc.

◆ getAsPersistablePtr()

dafBase::Persistable::Ptr lsst::daf::base::PropertySet::getAsPersistablePtr ( std::string const &  name) const
inherited

Get the last value for a Persistable name (possibly hierarchical).

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Persistable::Ptr value.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue is not a Persistable::Ptr.

Definition at line 466 of file PropertySet.cc.

◆ getAsPropertySetPtr()

dafBase::PropertySet::Ptr lsst::daf::base::PropertySet::getAsPropertySetPtr ( std::string const &  name) const
inherited

Get the last value for a subproperty name (possibly hierarchical).

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
PropertySet::Ptr value.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue is not a PropertySet::Ptr.

Definition at line 455 of file PropertySet.cc.

◆ getAsString()

std::string lsst::daf::base::PropertySet::getAsString ( std::string const &  name) const
inherited

Get the last value for a string property name (possibly hierarchical).

Note that properties set with char const* can be retrieved as strings using this method.

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
String value.
Exceptions
NotFoundErrorProperty does not exist.
TypeErrorValue is not a string.

Definition at line 444 of file PropertySet.cc.

◆ getComment()

std::string const & lsst::daf::base::PropertyList::getComment ( std::string const &  name) const

Get the comment for a string property name (possibly hierarchical).

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Comment string.
Exceptions
NotFoundErrorProperty does not exist.

Definition at line 128 of file PropertyList.cc.

◆ getId()

dafBase::Citizen::memId lsst::daf::base::Citizen::getId ( ) const
inherited

Return the Citizen's ID.

Definition at line 224 of file Citizen.cc.

◆ getNextMemId()

dafBase::Citizen::memId lsst::daf::base::Citizen::getNextMemId ( )
staticinherited

Return the memId of the next object to be allocated.

Definition at line 229 of file Citizen.cc.

◆ getOrderedNames()

std::vector< std::string > lsst::daf::base::PropertyList::getOrderedNames ( void  ) const

Definition at line 133 of file PropertyList.cc.

◆ hasBeenCorrupted()

bool lsst::daf::base::Citizen::hasBeenCorrupted ( )
staticinherited

Check all allocated blocks for corruption.

Definition at line 353 of file Citizen.cc.

◆ init()

int lsst::daf::base::Citizen::init ( )
staticinherited

Called once when the memory system is being initialised.

Definition at line 214 of file Citizen.cc.

◆ isArray()

bool lsst::daf::base::PropertySet::isArray ( std::string const &  name) const
inherited

Determine if a name (possibly hierarchical) has multiple values.

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
true if property exists and has more than one value.

Definition at line 198 of file PropertySet.cc.

◆ isPropertySetPtr()

bool lsst::daf::base::PropertySet::isPropertySetPtr ( std::string const &  name) const
inherited

Determine if a name (possibly hierarchical) is a subproperty.

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
true if property exists and its values are PropertySet::Ptrs.

Definition at line 207 of file PropertySet.cc.

◆ markPersistent()

void lsst::daf::base::Citizen::markPersistent ( void  )
inherited

Mark a Citizen as persistent and not destroyed until process end.

Definition at line 254 of file Citizen.cc.

◆ nameCount()

size_t lsst::daf::base::PropertySet::nameCount ( bool  topLevelOnly = true) const
inherited

Get the number of names in the PropertySet, optionally including those in subproperties.

The name of the subproperty is counted in that case.

Parameters
[in]topLevelOnlytrue (default) = don't include subproperties.
Returns
Number of names.

Definition at line 97 of file PropertySet.cc.

◆ names()

vector< string > lsst::daf::base::PropertySet::names ( bool  topLevelOnly = true) const
inherited

Get the names in the PropertySet, optionally including those in subproperties.

The name of the subproperty is included in that case. Hierarchical subproperty names are separated by a period.

Parameters
[in]topLevelOnlytrue (default) = don't include subproperties.
Returns
Vector of names.

Definition at line 117 of file PropertySet.cc.

◆ paramNames()

vector< string > lsst::daf::base::PropertySet::paramNames ( bool  topLevelOnly = true) const
inherited

Get the names of parameters (non-subproperties) in the PropertySet, optionally including those in subproperties.

Hierarchical subproperty names are separated by a period.

Parameters
[in]topLevelOnlytrue (default) = don't include subproperties.
Returns
Vector of parameter names.

Definition at line 142 of file PropertySet.cc.

◆ propertySetNames()

vector< string > lsst::daf::base::PropertySet::propertySetNames ( bool  topLevelOnly = true) const
inherited

Get the names of subproperties in the PropertySet, optionally including those in subproperties.

Hierarchical subproperty names are separated by a period.

Parameters
[in]topLevelOnlytrue (default) = don't include subproperties.
Returns
Vector of subproperty names.

Definition at line 168 of file PropertySet.cc.

◆ remove()

void lsst::daf::base::PropertyList::remove ( std::string const &  name)
virtual

Removes all values for a property name (possibly hierarchical).

Does nothing if the property does not exist.

Parameters
[in]nameProperty name to remove, possibly hierarchical.

Reimplemented from lsst::daf::base::PropertySet.

Definition at line 430 of file PropertyList.cc.

◆ repr()

std::string lsst::daf::base::Citizen::repr ( ) const
inherited

Return a string representation of a Citizen.

Definition at line 245 of file Citizen.cc.

◆ serialize()

template<class Archive >
void lsst::daf::base::Persistable::serialize ( Archive &  ,
unsigned int  const 
)
inlineinherited

Template boost::serialization function for the base class.

Doesn't actually do anything, since there is no data associated with the base. Inline to allow expansion wherever needed.

Definition at line 86 of file Persistable.h.

◆ set() [1/10]

template<typename T >
void lsst::daf::base::PropertyList::set ( std::string const &  name,
T const &  value 
)

Replace all values for a property name (possibly hierarchical) with a new value.

Parameters
[in]nameProperty name to set, possibly hierarchical.
[in]valueValue to set.
Exceptions
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 187 of file PropertyList.cc.

◆ set() [2/10]

void lsst::daf::base::PropertyList::set ( std::string const &  name,
PropertySet::Ptr const &  value 
)

Definition at line 192 of file PropertyList.cc.

◆ set() [3/10]

template<typename T >
void lsst::daf::base::PropertyList::set ( std::string const &  name,
std::vector< T > const &  value 
)

Replace all values for a property name (possibly hierarchical) with a vector of new values.

Parameters
[in]nameProperty name to set, possibly hierarchical.
[in]valueVector of values to set.
Exceptions
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 225 of file PropertyList.cc.

◆ set() [4/10]

void lsst::daf::base::PropertyList::set ( std::string const &  name,
char const *  value 
)

Replace all values for a property name (possibly hierarchical) with a string value.

Parameters
[in]nameProperty name to set, possibly hierarchical.
[in]valueCharacter string (converted to std::string ).
Exceptions
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 213 of file PropertyList.cc.

◆ set() [5/10]

template<typename T >
void lsst::daf::base::PropertyList::set ( std::string const &  name,
T const &  value,
std::string const &  comment 
)

Replace all values for a property name (possibly hierarchical) with a new value.

Parameters
[in]nameProperty name to set, possibly hierarchical.
[in]valueValue to set.
[in]commentComment to set.
Exceptions
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 283 of file PropertyList.cc.

◆ set() [6/10]

template<typename T >
void lsst::daf::base::PropertyList::set ( std::string const &  name,
std::vector< T > const &  value,
std::string const &  comment 
)

Replace all values for a property name (possibly hierarchical) with a vector of new values.

Parameters
[in]nameProperty name to set, possibly hierarchical.
[in]valueVector of values to set.
[in]commentComment to set.
Exceptions
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 311 of file PropertyList.cc.

◆ set() [7/10]

void lsst::daf::base::PropertyList::set ( std::string const &  name,
char const *  value,
std::string const &  comment 
)

Replace all values for a property name (possibly hierarchical) with a string value.

Parameters
[in]nameProperty name to set, possibly hierarchical.
[in]valueCharacter string value to set.
[in]commentComment to set.
Exceptions
InvalidParameterErrorHierarchical name uses non-PropertySet.

Definition at line 297 of file PropertyList.cc.

◆ set() [8/10]

template<typename T >
void lsst::daf::base::PropertyList::set ( std::string const &  name,
T const &  value,
char const *  comment 
)
inline

Definition at line 151 of file PropertyList.h.

◆ set() [9/10]

template<typename T >
void lsst::daf::base::PropertyList::set ( std::string const &  name,
std::vector< T > const &  value,
char const *  comment 
)
inline

Definition at line 156 of file PropertyList.h.

◆ set() [10/10]

void lsst::daf::base::PropertyList::set ( std::string const &  name,
char const *  value,
char const *  comment 
)
inline

Definition at line 161 of file PropertyList.h.

◆ setCorruptionCallback()

dafBase::Citizen::memCallback lsst::daf::base::Citizen::setCorruptionCallback ( Citizen::memCallback  func)
staticinherited

Set the CorruptionCallback function.

Parameters
funcfunction be called when block is found to be corrupted

Definition at line 432 of file Citizen.cc.

◆ setDeleteCallback()

dafBase::Citizen::memCallback lsst::daf::base::Citizen::setDeleteCallback ( Citizen::memCallback  func)
staticinherited

Set the DeleteCallback function.

Parameters
funcfunction be called when desired block is deleted

Definition at line 422 of file Citizen.cc.

◆ setDeleteCallbackId()

dafBase::Citizen::memId lsst::daf::base::Citizen::setDeleteCallbackId ( Citizen::memId  id)
staticinherited

Call the current DeleteCallback when block is deleted.

Parameters
idDesired ID

Definition at line 387 of file Citizen.cc.

◆ setNewCallback()

dafBase::Citizen::memNewCallback lsst::daf::base::Citizen::setNewCallback ( Citizen::memNewCallback  func)
staticinherited

Set the NewCallback function.

Parameters
funcThe new function to be called when a designated block is allocated

Definition at line 412 of file Citizen.cc.

◆ setNewCallbackId()

dafBase::Citizen::memId lsst::daf::base::Citizen::setNewCallbackId ( Citizen::memId  id)
staticinherited

Call the NewCallback when block is allocated.

Parameters
idDesired ID

Definition at line 376 of file Citizen.cc.

◆ toString()

std::string lsst::daf::base::PropertyList::toString ( bool  topLevelOnly = false,
std::string const &  indent = "" 
) const
virtual

Generate a string representation of the PropertyList.

Use this for debugging, not for serialization/persistence.

Parameters
[in]topLevelOnlyfalse (default) = do include subproperties.
[in]indentString to indent lines by (default none).
Returns
String representation of the PropertyList.

Reimplemented from lsst::daf::base::PropertySet.

Definition at line 158 of file PropertyList.cc.

◆ typeOf()

type_info const & lsst::daf::base::PropertySet::typeOf ( std::string const &  name) const
inherited

Get the type of values for a property name (possibly hierarchical).

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Type of values for that property.
Exceptions
NotFoundErrorProperty does not exist.

Definition at line 227 of file PropertySet.cc.

◆ valueCount()

size_t lsst::daf::base::PropertySet::valueCount ( std::string const &  name) const
inherited

Get number of values for a property name (possibly hierarchical).

Parameters
[in]nameProperty name to examine, possibly hierarchical.
Returns
Number of values for that property. 0 if it doesn't exist.

Definition at line 216 of file PropertySet.cc.


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