LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
|
#include <Table.h>
Public Types | |
using | ObjectPtr = std::unique_ptr<AstObject, Deleter> |
unique pointer holding an AST raw pointer | |
Public Member Functions | |
Table (std::string const &options="") | |
virtual | ~Table () |
Table (Table const &)=default | |
Table (Table &&)=default | |
Table & | operator= (Table const &)=delete |
Table & | operator= (Table &&)=default |
std::string | columnName (int index) const |
DataType | columnType (std::string const &column) const |
int | columnLength (std::string const &column) const |
int | columnLenC (std::string const &column) const |
int | columnNdim (std::string const &column) const |
std::string | columnUnit (std::string const &column) const |
std::vector< int > | columnShape (std::string const &column) |
int | getNColumn () const |
Get NColumn: The number of columns currently in the Table. | |
int | getNRow () const |
Get NRow: The number of rows currently in the Table. | |
std::shared_ptr< KeyMap > | copy () const |
Return a deep copy of this object. | |
bool | defined (std::string const &key) const |
Does this map contain the specified key, and if so, does it have a defined value? | |
std::string | key (int ind) const |
Get the key at the specified index. | |
bool | hasKey (std::string const &key) const |
Does this map contain the specified key? | |
int | length (std::string const &key) const |
Get the size of the vector for the specified key; return 0 if key not found or value is undefined. | |
int | size () const |
Get the number of keys. | |
double | getD (std::string const &key, int ind) const |
Get one double value for a given key. | |
std::vector< double > | getD (std::string const &key) const |
Get all double values for a given key. | |
float | getF (std::string const &key, int ind) const |
Get one float value for a given key. | |
std::vector< float > | getF (std::string const &key) const |
Get all float values for a given key. | |
int | getI (std::string const &key, int ind) const |
Get one int value for a given key. | |
std::vector< int > | getI (std::string const &key) const |
Get all int values for a given key. | |
short int | getS (std::string const &key, int ind) const |
Get one short int value for a given key. | |
std::vector< short int > | getS (std::string const &key) const |
Get all short int values for a given key. | |
char unsigned | getB (std::string const &key, int ind) const |
Get one char value for a given key. | |
std::vector< char unsigned > | getB (std::string const &key) const |
Get all char values for a given key. | |
std::string | getC (std::string const &key, int ind) const |
Get one std::string value for a given key. | |
std::vector< std::string > | getC (std::string const &key) const |
Get all std::string values for a given key. | |
std::shared_ptr< Object > | getA (std::string const &key, int ind) const |
Get one Object for a given key; the object is deep copied. | |
std::vector< std::shared_ptr< Object > > | getA (std::string const &key) const |
Get all Objects for a given key; each object is deep copied. | |
void | putD (std::string const &key, double value, std::string const &comment="") |
Add a double value. | |
void | putD (std::string const &key, std::vector< double > const &vec, std::string const &comment="") |
Add a vector of double. | |
void | putF (std::string const &key, float value, std::string const &comment="") |
Add a float. | |
void | putF (std::string const &key, std::vector< float > const &vec, std::string const &comment="") |
Add a vector of floats. | |
void | putI (std::string const &key, int value, std::string const &comment="") |
Add an int. | |
void | putI (std::string const &key, std::vector< int > const &vec, std::string const &comment="") |
Add a vector of ints. | |
void | putS (std::string const &key, short int value, std::string const &comment="") |
Add a short int. | |
void | putS (std::string const &key, std::vector< short int > const &vec, std::string const &comment="") |
Add a vector of short int. | |
void | putB (std::string const &key, char unsigned value, std::string const &comment="") |
Add a char. | |
void | putB (std::string const &key, std::vector< char unsigned > const &vec, std::string const &comment="") |
Add a vector of chars. | |
void | putC (std::string const &key, std::string const &value, std::string const &comment="") |
Add a string. | |
void | putC (std::string const &key, std::vector< std::string > const &vec, std::string const &comment="") |
Add a vector of strings. | |
void | putA (std::string const &key, Object const &obj, std::string const &comment="") |
Add an Object, which is deep copied. | |
void | putA (std::string const &key, std::vector< std::shared_ptr< Object const > > const &vec, std::string const &comment="") |
Add a vector of shared pointer to Object; the objects are deep copied. | |
void | putU (std::string const &key, std::string const &comment="") |
Add a new entry, but no value is stored with the entry. | |
void | append (std::string const &key, double value) |
Append an element to a vector of doubles in a KeyMap. | |
void | append (std::string const &key, float value) |
Append an element to a vector of floats in a KeyMap. | |
void | append (std::string const &key, int value) |
Append an element to a vector of ints in a KeyMap. | |
void | append (std::string const &key, short int value) |
Append an element to a vector of short int in a KeyMap. | |
void | append (std::string const &key, char unsigned value) |
Append an element to a vector of char in a KeyMap. | |
void | append (std::string const &key, std::string const &value) |
Append an element to a vector of strings in a KeyMap. | |
void | append (std::string const &key, Object const &value) |
Append an element to a vector of Objects in a KeyMap. | |
void | replace (std::string const &key, int i, double value) |
Replace an element of a vector of doubles in a KeyMap. | |
void | replace (std::string const &key, int i, float value) |
Replace an element of a vector of floats in a KeyMap. | |
void | replace (std::string const &key, int i, int value) |
Replace an element of a vector of ints in a KeyMap. | |
void | replace (std::string const &key, int i, short int value) |
Replace an element of a vector of short int in a KeyMap. | |
void | replace (std::string const &key, int i, char unsigned value) |
Replace an element of a vector of char in a KeyMap. | |
void | replace (std::string const &key, int i, std::string const &value) |
Replace an element of a vector of strings in a KeyMap. | |
void | replace (std::string const &key, int i, Object const &value) |
Replace an element of a vector of Objects in a KeyMap. | |
void | remove (std::string const &key) |
Remove the specified entry. | |
void | rename (std::string const &oldKey, std::string const &newKey) |
Rename the specified entry. | |
DataType | type (std::string const &key) |
Get the type suffix for a given key. | |
bool | operator== (Object const &rhs) const |
Return True if this and rhs are the equal. | |
bool | operator!= (Object const &rhs) const |
Return True if this and rhs are not equal. | |
void | clear (std::string const &attrib) |
Clear the values of a specified set of attributes for an Object. | |
bool | hasAttribute (std::string const &attrib) const |
Does this object have an attribute with the specified name? | |
std::string | getClassName () const |
Get Class: the name of the class (e.g. | |
std::string | getID () const |
Get ID: object identification string that is not copied. | |
std::string | getIdent () const |
Get Ident: object identification string that is copied. | |
int | getNObject () const |
Get NObject: number of AST objects in existence of the same type as the underlying AST class. | |
int | getObjSize () const |
Get ObjSize: the in-memory size of the AST object in bytes. | |
int | getRefCount () const |
Get RefCount: number of active pointers to the underlying AST object. | |
bool | getUseDefs () const |
Get UseDefs: allow use of default values for Object attributes? | |
void | lock (bool wait) |
Lock this object for exclusive use by the calling thread. | |
bool | same (Object const &other) const |
Does this contain the same AST object as another? | |
void | setID (std::string const &id) |
Set ID: object identification string that is not copied. | |
void | setIdent (std::string const &ident) |
Set Ident: object identification string that is copied. | |
void | setUseDefs (bool usedefs) |
Set UseDefs: allow use of default values for Object attributes? | |
void | show (std::ostream &os, bool showComments=true) const |
Print a textual description the object to an ostream. | |
std::string | show (bool showComments=true) const |
Return a textual description the object as a string. | |
bool | test (std::string const &attrib) const |
Has this attribute been explicitly set (and not subsequently cleared)? | |
void | unlock (bool report=false) |
Unlock this object previously locked using lock, so that other threads can use this object. | |
AstObject const * | getRawPtr () const |
Get the raw AST pointer. | |
AstObject * | getRawPtr () |
Get the raw AST pointer. | |
Static Public Member Functions | |
static std::shared_ptr< Object > | fromString (std::string const &str) |
Construct an Object from a string, using astFromString. | |
template<typename Class > | |
static std::shared_ptr< Class > | fromAstObject (AstObject *rawObj, bool copy) |
Given a bare AST object pointer return a shared pointer to an ast::Object of the correct type. | |
Protected Member Functions | |
Table (AstTable *rawTable) | |
Construct a Table from a raw AstTable. | |
virtual std::shared_ptr< Object > | copyPolymorphic () const override |
Return a deep copy of this object. | |
template<typename T , typename AstT > | |
std::shared_ptr< T > | copyImpl () const |
Implementation of deep copy. | |
long int | getL (std::string const &attrib) const |
Get the value of an attribute as a long int. | |
void | set (std::string const &setting) |
Assign a set of attribute values, over-riding any previous values. | |
void | setB (std::string const &attrib, bool value) |
Set the value of an attribute as a bool. | |
void | setC (std::string const &attrib, std::string const &value) |
Set the value of an attribute as a string. | |
void | setD (std::string const &attrib, double value) |
Set the value of an attribute as a double. | |
void | setF (std::string const &attrib, float value) |
Set the value of an attribute as a float. | |
void | setI (std::string const &attrib, int value) |
Set the value of an attribute as an int. | |
void | setL (std::string const &attrib, long int value) |
Set the value of an attribute as a long int. | |
Static Protected Member Functions | |
template<typename ShimT , typename AstT > | |
static std::shared_ptr< ShimT > | makeShim (AstObject *p) |
Functor to make an astshim instance from a raw AST pointer of the corresponding type. | |
Friends | |
class | Object |
|
inherited |
|
inlineexplicit |
Definition at line 39 of file Table.h.
|
default |
|
default |
|
inlineexplicitprotected |
Construct a Table from a raw AstTable.
Definition at line 113 of file Table.h.
|
inlineinherited |
Append an element to a vector of char in a KeyMap.
Definition at line 482 of file KeyMap.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Clear the values of a specified set of attributes for an Object.
Clearing an attribute cancels any value that has previously been explicitly set for it, so that the standard default attribute value will subsequently be used instead. This also causes the astTest function to return the value zero for the attribute, indicating that no value has been set.
|
inline |
Definition at line 69 of file Table.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 81 of file Table.h.
|
inlineinherited |
Return a deep copy of this object.
Definition at line 107 of file KeyMap.h.
|
inlineprotectedinherited |
|
inlineoverrideprotectedvirtualinherited |
Return a deep copy of this object.
This is called by copy.
Each subclass must override this method. The standard implementation is:
for example Frame implements this as:
Implements ast::Object.
Definition at line 584 of file KeyMap.h.
|
inlineinherited |
Does this map contain the specified key, and if so, does it have a defined value?
See also hasKey, which does not check if the value is defined
|
staticinherited |
Given a bare AST object pointer return a shared pointer to an ast::Object of the correct type.
The returned object takes ownership of the pointer. This is almost always what you want, for instance astDecompose returns shallow copies of the internal pointers.
Class | The class of the returned shared pointer. (The actual class will be the correct class of rawPtr.) |
[in] | rawObj | A bare AST object pointer |
[in] | copy | If True then make a deep copy of the pointer (and free the original) |
Definition at line 138 of file Object.cc.
|
inlinestaticinherited |
|
inlineinherited |
Get all Objects for a given key; each object is deep copied.
Definition at line 321 of file KeyMap.h.
|
inlineinherited |
Get one Object for a given key; the object is deep copied.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get all std::string values for a given key.
Definition at line 291 of file KeyMap.h.
|
inlineinherited |
Get one std::string value for a given key.
|
inlineinherited |
Get Class: the name of the class (e.g.
Note: if AST returns "CmpMap" then the name will be changed to "SeriesMap" or "ParallelMap", as appropriate.
Definition at line 139 of file Object.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprotectedinherited |
Get the value of an attribute as a long int.
If possible, the attribute value is converted to the type you request.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get UseDefs: allow use of default values for Object attributes?
Definition at line 166 of file Object.h.
|
inlineinherited |
|
inlineinherited |
Does this map contain the specified key?
See also defined, which also checks that the value is defined
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Lock this object for exclusive use by the calling thread.
The thread-safe public interface to AST is designed so that an error is reported if any thread attempts to use an Object that it has not previously locked for its own exclusive use using this function. When an Object is created, it is initially locked by the thread that creates it, so newly created objects do not need to be explicitly locked. However, if an Object pointer is passed to another thread, the original thread must first unlock it (using astUnlock) and the new thread must then lock it (using astLock) before the new thread can use the Object.
[in] | wait | If the Object is curently locked by another thread then this function will either report an error or block. If a non-zero value is supplied for "wait", the calling thread waits until the object is available for it to use. Otherwise, an error is reported and the function returns immediately without locking the Object. |
|
inlinestaticprotectedinherited |
Functor to make an astshim instance from a raw AST pointer of the corresponding type.
ShimT | Output astshim class |
AstT | Output AST class |
|
inlineinherited |
|
inherited |
Return True if this and rhs
are the equal.
For two objects be equal, they both must have the same attributes and all contained objects must be equal.
Definition at line 85 of file Object.cc.
|
inlineinherited |
|
inlineinherited |
Add a vector of shared pointer to Object; the objects are deep copied.
Definition at line 428 of file KeyMap.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Add a vector of strings.
Definition at line 408 of file KeyMap.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Add a new entry, but no value is stored with the entry.
The entry has a special data type represented by symbolic constant AST__UNDEFTYPE. Such entries can act as placeholders for values that can be added to the KeyMap later.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Replace an element of a vector of Objects in a KeyMap.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprotectedinherited |
Assign a set of attribute values, over-riding any previous values.
The attributes and their new values are specified via a character string, which should contain a comma-separated list of the form: "attribute_1 = value_1, attribute_2 = value_2, ... " where "attribute_n" specifies an attribute name, and the value to the right of each " =" sign should be a suitable textual representation of the value to be assigned. This value will be interpreted according to the attribute's data type.
std::runtime_error | if the attribute is read-only |
|
inlineprotectedinherited |
Set the value of an attribute as a bool.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineprotectedinherited |
Set the value of an attribute as a string.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineprotectedinherited |
Set the value of an attribute as a double.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineprotectedinherited |
Set the value of an attribute as a float.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineprotectedinherited |
Set the value of an attribute as an int.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineinherited |
Set ID: object identification string that is not copied.
Definition at line 215 of file Object.h.
|
inlineinherited |
|
inlineprotectedinherited |
Set the value of an attribute as a long int.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineinherited |
Set UseDefs: allow use of default values for Object attributes?
Definition at line 221 of file Object.h.
|
inherited |
Return a textual description the object as a string.
[in] | showComments | Show comments? |
|
inherited |
Print a textual description the object to an ostream.
[in,out] | os | The stream to which to write the string representation. |
[in] | showComments | Show comments? |
Definition at line 158 of file Object.cc.
|
inlineinherited |
|
inlineinherited |
Has this attribute been explicitly set (and not subsequently cleared)?
false
.std::runtime_error | if an error results. |
|
inlineinherited |
|
inlineinherited |
Unlock this object previously locked using lock, so that other threads can use this object.
See lock for further details.
[in] | report | If true, an error will be reported if the supplied Object, or any Object contained within the supplied Object, is not currently locked by the running thread. If false, such Objects will be left unchanged, and no error will be reported. |