|
| Object (AstObject *object) |
| Construct an Object from a pointer to a raw AstObject.
|
|
template<typename T , typename AstT > |
std::shared_ptr< T > | copyImpl () const |
| Implementation of deep copy.
|
|
virtual std::shared_ptr< Object > | copyPolymorphic () const =0 |
| Return a deep copy of this object.
|
|
bool | getB (std::string const &attrib) const |
| Get the value of an attribute as a bool.
|
|
std::string const | getC (std::string const &attrib) const |
| Get the value of an attribute as a string.
|
|
double | getD (std::string const &attrib) const |
| Get the value of an attribute as a double.
|
|
float | getF (std::string const &attrib) const |
| Get the value of an attribute as a float.
|
|
int | getI (std::string const &attrib) const |
| Get the value of an attribute as an int.
|
|
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.
|
|
Abstract base class for all AST objects.
Attributes
Object provides the following attributes:
Definition at line 51 of file Object.h.
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.
Definition at line 119 of file Object.h.
Return a deep copy of this object.
This is called by copy.
Each subclass must override this method. The standard implementation is:
return copyImpl<astshim_class, ast_class>();
for example Frame implements this as:
return copyImpl<Frame, AstFrame>();
Implemented in ast::Channel, ast::ChebyMap, ast::CmpFrame, ast::CmpMap, ast::Frame, ast::FrameDict, ast::FrameSet, ast::KeyMap, ast::LutMap, ast::Mapping, ast::MathMap, ast::MatrixMap, ast::NormMap, ast::ParallelMap, ast::PcdMap, ast::PermMap, ast::PolyMap, ast::RateMap, ast::SeriesMap, ast::ShiftMap, ast::SkyFrame, ast::SlaMap, ast::SpecFrame, ast::SphMap, ast::TimeFrame, ast::TimeMap, ast::TranMap, ast::UnitMap, ast::UnitNormMap, ast::WcsMap, ast::WinMap, and ast::ZoomMap.
template<typename Class >
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.
- Template Parameters
-
Class | The class of the returned shared pointer. (The actual class will be the correct class of rawPtr.) |
- Parameters
-
[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.
void ast::Object::lock |
( |
bool | wait | ) |
|
|
inline |
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.
- Parameters
-
[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. |
Notes
- The Locked object will belong to the current AST context.
- This function returns without action if the Object is already locked by the calling thread.
- If simultaneous use of the same object is required by two or more threads, Object::copy should be used to to produce a deep copy of the Object for each thread. Each copy should then be unlocked by the parent thread (i.e. the thread that created the copy), and then locked by the child thread (i.e. the thread that wants to use the copy).
- This function returns without action if the AST library has been built without POSIX thread support (i.e. the "-with-pthreads" option was not specified when running the "configure" script).
Definition at line 202 of file Object.h.
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.
Notes
- Attribute names are not case sensitive and may be surrounded by white space
- Attribute names are not case sensitive and may be surrounded by white space.
- White space may also surround attribute values, where it will generally be ignored (except for string-valued attributes where it is significant and forms part of the value to be assigned).
- To include a literal comma or percent sign in the value assigned to an attribute, the whole attribute value should be enclosed in quotation markes.
- Exceptions
-
Definition at line 436 of file Object.h.