|
GiNaC
1.6.2
|
This class stores all properties needed to record/retrieve the state of one object of class basic (or a derived class). More...
#include <archive.h>
Classes | |
| struct | property |
| Archived property (data type, name and associated data) More... | |
| struct | property_info |
| Information about a stored property. More... | |
Public Types | |
| enum | property_type { PTYPE_BOOL, PTYPE_UNSIGNED, PTYPE_STRING, PTYPE_NODE } |
| Property data types. More... | |
| typedef std::vector < property_info > | propinfovector |
| typedef std::vector< property > ::const_iterator | archive_node_cit |
Public Member Functions | |
| archive_node () | |
| archive_node (archive &ar) | |
| archive_node (archive &ar, const ex &expr) | |
| Recursively construct archive node from expression. | |
| const archive_node & | operator= (const archive_node &other) |
| Assignment operator of archive_node. | |
| void | add_bool (const std::string &name, bool value) |
| Add property of type "bool" to node. | |
| void | add_unsigned (const std::string &name, unsigned value) |
| Add property of type "unsigned int" to node. | |
| void | add_string (const std::string &name, const std::string &value) |
| Add property of type "string" to node. | |
| void | add_ex (const std::string &name, const ex &value) |
| Add property of type "ex" to node. | |
| bool | find_bool (const std::string &name, bool &ret, unsigned index=0) const |
| Retrieve property of type "bool" from node. | |
| bool | find_unsigned (const std::string &name, unsigned &ret, unsigned index=0) const |
| Retrieve property of type "unsigned" from node. | |
| bool | find_string (const std::string &name, std::string &ret, unsigned index=0) const |
| Retrieve property of type "string" from node. | |
| archive_node_cit | find_first (const std::string &name) const |
| Find the location in the vector of properties of the first/last property with a given name. | |
| archive_node_cit | find_last (const std::string &name) const |
| bool | find_ex (const std::string &name, ex &ret, lst &sym_lst, unsigned index=0) const |
| Retrieve property of type "ex" from node. | |
| void | find_ex_by_loc (archive_node_cit loc, ex &ret, lst &sym_lst) const |
| Retrieve property of type "ex" from the node if it is known that this node in fact contains such a property at the given location. | |
| const archive_node & | find_ex_node (const std::string &name, unsigned index=0) const |
| Retrieve property of type "ex" from node, returning the node of the sub-expression. | |
| void | get_properties (propinfovector &v) const |
| Return vector of properties stored in node. | |
| ex | unarchive (lst &sym_lst) const |
| Convert archive node to GiNaC expression. | |
| bool | has_same_ex_as (const archive_node &other) const |
| Check if the archive_node stores the same expression as another archive_node. | |
| bool | has_ex () const |
| ex | get_ex () const |
| void | forget () |
| Delete cached unarchived expressions from node (for debugging). | |
| void | printraw (std::ostream &os) const |
| Output archive_node to stream in ugly raw format (for debugging). | |
Static Private Member Functions | |
| static archive * | dummy_ar_creator () |
| Create a dummy archive. | |
Private Attributes | |
| archive & | a |
| Reference to the archive to which this node belongs. | |
| std::vector< property > | props |
| Vector of stored properties. | |
| bool | has_expression |
| Flag indicating whether a cached unarchived representation of this node exists. | |
| ex | e |
| The cached unarchived representation of this node (if any). | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const archive_node &ar) |
| Write archive_node to binary data stream. | |
| std::istream & | operator>> (std::istream &is, archive_node &ar) |
| Read archive_node from binary data stream. | |
This class stores all properties needed to record/retrieve the state of one object of class basic (or a derived class).
Each property is addressed by its name and data type.
| typedef std::vector<property_info> GiNaC::archive_node::propinfovector |
| typedef std::vector<property>::const_iterator GiNaC::archive_node::archive_node_cit |
| GiNaC::archive_node::archive_node | ( | ) | [inline] |
Recursively construct archive node from expression.
Definition at line 338 of file archive.cpp.
References GiNaC::ex::bp.
| const archive_node & GiNaC::archive_node::operator= | ( | const archive_node & | other | ) |
Assignment operator of archive_node.
Definition at line 325 of file archive.cpp.
References e, has_expression, and props.
| void GiNaC::archive_node::add_bool | ( | const std::string & | name, |
| bool | value | ||
| ) |
Add property of type "bool" to node.
Definition at line 377 of file archive.cpp.
References a, GiNaC::archive::atomize(), props, PTYPE_BOOL, and value.
Referenced by GiNaC::minkmetric::archive(), GiNaC::varidx::archive(), GiNaC::tensepsilon::archive(), and GiNaC::spinidx::archive().
| void GiNaC::archive_node::add_unsigned | ( | const std::string & | name, |
| unsigned | value | ||
| ) |
Add property of type "unsigned int" to node.
Definition at line 382 of file archive.cpp.
References a, GiNaC::archive::atomize(), props, PTYPE_UNSIGNED, and value.
Referenced by GiNaC::wildcard::archive(), GiNaC::color::archive(), GiNaC::clifford::archive(), GiNaC::relational::archive(), GiNaC::fderivative::archive(), GiNaC::symmetry::archive(), and GiNaC::matrix::archive().
| void GiNaC::archive_node::add_string | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Add property of type "string" to node.
Definition at line 387 of file archive.cpp.
References a, GiNaC::archive::atomize(), props, and PTYPE_STRING.
Referenced by GiNaC::constant::archive(), GiNaC::symbol::archive(), GiNaC::numeric::archive(), GiNaC::basic::archive(), and GiNaC::function::archive().
| void GiNaC::archive_node::add_ex | ( | const std::string & | name, |
| const ex & | value | ||
| ) |
Add property of type "ex" to node.
Definition at line 392 of file archive.cpp.
References a, GiNaC::archive::add_node(), archive_node(), GiNaC::archive::atomize(), props, and PTYPE_NODE.
Referenced by GiNaC::clifford::archive(), GiNaC::idx::archive(), GiNaC::integral::archive(), GiNaC::pseries::archive(), GiNaC::relational::archive(), GiNaC::power::archive(), GiNaC::symmetry::archive(), GiNaC::expairseq::archive(), GiNaC::matrix::archive(), GiNaC::indexed::archive(), and GiNaC::container< C >::archive().
| bool GiNaC::archive_node::find_bool | ( | const std::string & | name, |
| bool & | ret, | ||
| unsigned | index = 0 |
||
| ) | const |
Retrieve property of type "bool" from node.
Definition at line 400 of file archive.cpp.
References a, GiNaC::archive::atomize(), props, and PTYPE_BOOL.
Referenced by GiNaC::minkmetric::read_archive(), GiNaC::varidx::read_archive(), GiNaC::tensepsilon::read_archive(), and GiNaC::spinidx::read_archive().
| bool GiNaC::archive_node::find_unsigned | ( | const std::string & | name, |
| unsigned & | ret, | ||
| unsigned | index = 0 |
||
| ) | const |
Retrieve property of type "unsigned" from node.
Definition at line 418 of file archive.cpp.
References a, GiNaC::archive::atomize(), props, and PTYPE_UNSIGNED.
Referenced by GiNaC::wildcard::read_archive(), GiNaC::color::read_archive(), GiNaC::clifford::read_archive(), GiNaC::relational::read_archive(), GiNaC::fderivative::read_archive(), GiNaC::symmetry::read_archive(), GiNaC::matrix::read_archive(), and GiNaC::indexed::read_archive().
| bool GiNaC::archive_node::find_string | ( | const std::string & | name, |
| std::string & | ret, | ||
| unsigned | index = 0 |
||
| ) | const |
Retrieve property of type "string" from node.
Definition at line 436 of file archive.cpp.
References a, GiNaC::archive::atomize(), props, PTYPE_STRING, and GiNaC::archive::unatomize().
Referenced by GiNaC::constant::read_archive(), GiNaC::symbol::read_archive(), GiNaC::numeric::read_archive(), GiNaC::function::read_archive(), and unarchive().
| archive_node::archive_node_cit GiNaC::archive_node::find_first | ( | const std::string & | name | ) | const |
Find the location in the vector of properties of the first/last property with a given name.
Definition at line 356 of file archive.cpp.
References a, GiNaC::archive::atomize(), and props.
Referenced by GiNaC::pseries::read_archive(), GiNaC::expairseq::read_archive(), GiNaC::matrix::read_archive(), and GiNaC::container< C >::read_archive().
| archive_node::archive_node_cit GiNaC::archive_node::find_last | ( | const std::string & | name | ) | const |
Definition at line 366 of file archive.cpp.
References a, GiNaC::archive::atomize(), and props.
Referenced by GiNaC::pseries::read_archive(), GiNaC::expairseq::read_archive(), GiNaC::matrix::read_archive(), and GiNaC::container< C >::read_archive().
| bool GiNaC::archive_node::find_ex | ( | const std::string & | name, |
| ex & | ret, | ||
| lst & | sym_lst, | ||
| unsigned | index = 0 |
||
| ) | const |
Retrieve property of type "ex" from node.
Definition at line 460 of file archive.cpp.
References a, GiNaC::archive::atomize(), GiNaC::archive::get_node(), props, PTYPE_NODE, and unarchive().
Referenced by GiNaC::clifford::read_archive(), GiNaC::idx::read_archive(), GiNaC::integral::read_archive(), GiNaC::relational::read_archive(), GiNaC::pseries::read_archive(), GiNaC::power::read_archive(), GiNaC::symmetry::read_archive(), GiNaC::expairseq::read_archive(), and GiNaC::indexed::read_archive().
| void GiNaC::archive_node::find_ex_by_loc | ( | archive_node_cit | loc, |
| ex & | ret, | ||
| lst & | sym_lst | ||
| ) | const |
Retrieve property of type "ex" from the node if it is known that this node in fact contains such a property at the given location.
This is much more efficient than the preceding function.
Definition at line 454 of file archive.cpp.
References a, GiNaC::archive::get_node(), and unarchive().
Referenced by GiNaC::pseries::read_archive(), GiNaC::expairseq::read_archive(), GiNaC::matrix::read_archive(), and GiNaC::container< C >::read_archive().
| const archive_node & GiNaC::archive_node::find_ex_node | ( | const std::string & | name, |
| unsigned | index = 0 |
||
| ) | const |
Retrieve property of type "ex" from node, returning the node of the sub-expression.
Definition at line 478 of file archive.cpp.
References a, GiNaC::archive::atomize(), GiNaC::archive::get_node(), props, and PTYPE_NODE.
| void GiNaC::archive_node::get_properties | ( | propinfovector & | v | ) | const |
Return vector of properties stored in node.
Definition at line 495 of file archive.cpp.
References a, props, and GiNaC::archive::unatomize().
Convert archive node to GiNaC expression.
Definition at line 527 of file archive.cpp.
References GiNaC::status_flags::dynallocated, e, GiNaC::find_factory_fcn(), find_string(), and has_expression.
Referenced by find_ex(), and find_ex_by_loc().
| bool GiNaC::archive_node::has_same_ex_as | ( | const archive_node & | other | ) | const |
Check if the archive_node stores the same expression as another archive_node.
Definition at line 348 of file archive.cpp.
References GiNaC::ex::bp, e, and has_expression.
| bool GiNaC::archive_node::has_ex | ( | ) | const [inline] |
Definition at line 139 of file archive.h.
References has_expression.
Referenced by GiNaC::archive::add_node().
| ex GiNaC::archive_node::get_ex | ( | ) | const [inline] |
| void GiNaC::archive_node::forget | ( | ) |
Delete cached unarchived expressions from node (for debugging).
Definition at line 599 of file archive.cpp.
References e, and has_expression.
Referenced by GiNaC::archive::forget().
| void GiNaC::archive_node::printraw | ( | std::ostream & | os | ) | const |
Output archive_node to stream in ugly raw format (for debugging).
Definition at line 647 of file archive.cpp.
References a, GiNaC::ex::bp, e, has_expression, props, PTYPE_BOOL, PTYPE_NODE, PTYPE_STRING, PTYPE_UNSIGNED, and GiNaC::archive::unatomize().
| archive * GiNaC::archive_node::dummy_ar_creator | ( | ) | [static, private] |
Create a dummy archive.
The intention is to fill archive_node's default ctor, which is currently a Cint-requirement.
Definition at line 673 of file archive.cpp.
| std::ostream& operator<< | ( | std::ostream & | os, |
| const archive_node & | ar | ||
| ) | [friend] |
Write archive_node to binary data stream.
Definition at line 201 of file archive.cpp.
| std::istream& operator>> | ( | std::istream & | is, |
| archive_node & | ar | ||
| ) | [friend] |
Read archive_node from binary data stream.
Definition at line 246 of file archive.cpp.
archive& GiNaC::archive_node::a [private] |
Reference to the archive to which this node belongs.
Definition at line 149 of file archive.h.
Referenced by add_bool(), add_ex(), add_string(), add_unsigned(), find_bool(), find_ex(), find_ex_by_loc(), find_ex_node(), find_first(), find_last(), find_string(), find_unsigned(), get_properties(), and printraw().
std::vector<property> GiNaC::archive_node::props [private] |
Vector of stored properties.
Definition at line 152 of file archive.h.
Referenced by add_bool(), add_ex(), add_string(), add_unsigned(), find_bool(), find_ex(), find_ex_node(), find_first(), find_last(), find_string(), find_unsigned(), get_properties(), GiNaC::operator<<(), operator=(), GiNaC::operator>>(), and printraw().
bool GiNaC::archive_node::has_expression [mutable, private] |
Flag indicating whether a cached unarchived representation of this node exists.
Definition at line 155 of file archive.h.
Referenced by forget(), has_ex(), has_same_ex_as(), operator=(), printraw(), and unarchive().
ex GiNaC::archive_node::e [mutable, private] |
The cached unarchived representation of this node (if any).
Definition at line 158 of file archive.h.
Referenced by forget(), get_ex(), has_same_ex_as(), operator=(), printraw(), and unarchive().