COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Classes | Functions
cf3::common::XML Namespace Reference

Classes that implement the XML protocol for use in COOLFluiD. More...

Classes

class  Map
 
class  Protocol
 
class  SignalFrame
 Manages a set of maps. More...
 
class  SignalOptions
 Abstracts the use of XML when adding options to a signal frame. More...
 
class  XmlDoc
 
class  XmlNode
 

Functions

template<>
Common_API void to_value< bool > (XmlNode &node, bool &val)
 
template<>
Common_API void to_value< int > (XmlNode &node, int &val)
 
template<>
Common_API void to_value< Uint > (XmlNode &node, Uint &val)
 
template<>
Common_API void to_value< Real > (XmlNode &node, Real &val)
 
template<>
Common_API void to_value< std::string > (XmlNode &node, std::string &val)
 
template<>
Common_API void to_value< URI > (XmlNode &node, URI &val)
 
template<>
Common_API void to_value< UUCount > (XmlNode &node, UUCount &val)
 
template<>
Common_API bool to_value< bool > (XmlNode &node)
 
template<>
Common_API int to_value< int > (XmlNode &node)
 
template<>
Common_API Uint to_value< Uint > (XmlNode &node)
 
template<>
Common_API Real to_value< Real > (XmlNode &node)
 
template<>
Common_API std::string to_value< std::string > (XmlNode &node)
 
template<>
Common_API URI to_value< URI > (XmlNode &node)
 
template<>
Common_API UUCount to_value< UUCount > (XmlNode &node)
 
template<typename T >
void to_value (XmlNode &node, T &val)
 converts the value inside the xml node to the type More...
 
template<typename T >
to_value (XmlNode &node)
 
boost::shared_ptr< XmlDocparse_string (const std::string &str)
 
boost::shared_ptr< XmlDocparse_cstring (const char *str, std::size_t length)
 
boost::shared_ptr< XmlDocparse_file (const URI &file)
 
void to_file (const XmlNode &node, const URI &file)
 
void to_string (const XmlNode &node, std::string &str)
 
 TEMPLATE_EXPLICIT_INSTANTIATION (bool)
 explicit instantiation to avoid missing symbols on certain compilers More...
 
 TEMPLATE_EXPLICIT_INSTANTIATION (int)
 
 TEMPLATE_EXPLICIT_INSTANTIATION (std::string)
 
 TEMPLATE_EXPLICIT_INSTANTIATION (cf3::Uint)
 
 TEMPLATE_EXPLICIT_INSTANTIATION (cf3::Real)
 
 TEMPLATE_EXPLICIT_INSTANTIATION (cf3::common::URI)
 
 TEMPLATE_EXPLICIT_INSTANTIATION (cf3::common::UUCount)
 
XmlNode add_multi_array_in (Map &map, const std::string &name, const boost::multi_array< Real, 2 > &array, const std::string &delimiter=";", const std::vector< std::string > &labels=std::vector< std::string >())
 Adds a multi array in the provided Map. More...
 
void get_multi_array (const Map &map, const std::string &name, boost::multi_array< Real, 2 > &array, std::vector< std::string > &labels)
 
boost::shared_ptr< Optionmake_option (const std::string &name, XmlNode &node)
 
boost::shared_ptr< Optionmake_option_array (const std::string &name, const XmlNode &node)
 
void set_option_attributes (Option &option, const std::string &pretty_name, const std::string &descr, const XmlNode &node)
 
void add_opt_to_xml (Map &opt_map, boost::shared_ptr< Option > opt, bool is_array)
 

Detailed Description

Classes that implement the XML protocol for use in COOLFluiD.

Function Documentation

XmlNode add_multi_array_in ( Map map,
const std::string &  name,
const boost::multi_array< Real, 2 > &  array,
const std::string &  delimiter,
const std::vector< std::string > &  labels 
)

Adds a multi array in the provided Map.

Definition at line 33 of file MultiArray.cpp.

void cf3::common::XML::add_opt_to_xml ( Map opt_map,
boost::shared_ptr< Option opt,
bool  is_array 
)

Adds an option to an XML map.

Parameters
opt_mapMap the option should be added to
optOption to add
is_arrayIf true, the option is treated as an array.
Author
Quentin Gasper.

Definition at line 190 of file SignalOptions.cpp.

void get_multi_array ( const Map map,
const std::string &  name,
boost::multi_array< Real, 2 > &  array,
std::vector< std::string > &  labels 
)

Definition at line 86 of file MultiArray.cpp.

boost::shared_ptr<Option> cf3::common::XML::make_option ( const std::string &  name,
XmlNode node 
)

Creates an #OptionT option

Parameters
nameOption name
nodeThe value node.
Returns
Returns the created option.
Author
Quentin Gasper., Bart Janssens

Definition at line 44 of file SignalOptions.cpp.

boost::shared_ptr< Option > cf3::common::XML::make_option_array ( const std::string &  name,
const XmlNode node 
)

Creates an #OptionArray option

Parameters
nameOption name
nodeThe value node.
Returns
Returns the created option.
Author
Quentin Gasper, Bart Janssens

Definition at line 56 of file SignalOptions.cpp.

boost::shared_ptr< XmlDoc > parse_cstring ( const char *  str,
std::size_t  length = 0 
)

Parses a XML C-string

Parameters
strString with the XML contents, cannot be null.
lengthThe length of the string
Returns
Returns a shared pointer with the built XML document.
Exceptions
XmlErrorIf the string could not be parsed.

Definition at line 30 of file FileOperations.cpp.

boost::shared_ptr< XmlDoc > parse_file ( const URI path)

Parses a XML file

Parameters
fpathPath to file with xml contents
Returns
Returns a shared pointer with the built XML document.
Exceptions
FileSystemErrorIf the file cannot be read.

Definition at line 63 of file FileOperations.cpp.

boost::shared_ptr< XmlDoc > parse_string ( const std::string &  str)

Parses a XML string

Parameters
strString with the XML contents
Returns
Returns a shared pointer with the built XML document.

Definition at line 25 of file FileOperations.cpp.

void cf3::common::XML::set_option_attributes ( Option option,
const std::string &  pretty_name,
const std::string &  descr,
const XmlNode node 
)

Set description, pretty name and restricted list, if any

Parameters
optionTHe option for which to set the attributes
pretty_nameThe option pretty name
descrOption description
nodeThe value node. If it has a sibling node, this node is taken as the restricted values list.
Author
Quentin Gasper, Bart Janssens

Definition at line 77 of file SignalOptions.cpp.

TEMPLATE_EXPLICIT_INSTANTIATION ( bool  )

explicit instantiation to avoid missing symbols on certain compilers

TEMPLATE_EXPLICIT_INSTANTIATION ( int  )
TEMPLATE_EXPLICIT_INSTANTIATION ( std::string  )
TEMPLATE_EXPLICIT_INSTANTIATION ( cf3::Uint  )
TEMPLATE_EXPLICIT_INSTANTIATION ( cf3::Real  )
TEMPLATE_EXPLICIT_INSTANTIATION ( cf3::common::URI  )
cf3::common::XML::TEMPLATE_EXPLICIT_INSTANTIATION ( cf3::common::UUCount  )
void to_file ( const XmlNode node,
const URI fpath 
)

Writes the provided XML node to a file.

Parameters
nodeThe node to write.
fpathThe file path to which the node has to be written.

Definition at line 103 of file FileOperations.cpp.

void to_string ( const XmlNode node,
std::string &  str 
)

Writes the provided XML node to a string.

Parameters
strThe string to which the node has to be written.
nodeThe node to write.

Definition at line 114 of file FileOperations.cpp.

void cf3::common::XML::to_value ( XmlNode node,
T &  val 
)

converts the value inside the xml node to the type

T cf3::common::XML::to_value ( XmlNode node)
Common_API void cf3::common::XML::to_value< bool > ( XmlNode node,
bool &  val 
)

Definition at line 24 of file CastingFunctions.cpp.

Common_API bool cf3::common::XML::to_value< bool > ( XmlNode node)

Definition at line 75 of file CastingFunctions.cpp.

Common_API void cf3::common::XML::to_value< int > ( XmlNode node,
int &  val 
)

Definition at line 31 of file CastingFunctions.cpp.

Definition at line 81 of file CastingFunctions.cpp.

Common_API void cf3::common::XML::to_value< Real > ( XmlNode node,
Real &  val 
)

Definition at line 45 of file CastingFunctions.cpp.

Common_API Real cf3::common::XML::to_value< Real > ( XmlNode node)

Definition at line 93 of file CastingFunctions.cpp.

Common_API void cf3::common::XML::to_value< std::string > ( XmlNode node,
std::string &  val 
)

Definition at line 52 of file CastingFunctions.cpp.

Common_API std::string cf3::common::XML::to_value< std::string > ( XmlNode node)

Definition at line 99 of file CastingFunctions.cpp.

Common_API void cf3::common::XML::to_value< Uint > ( XmlNode node,
Uint val 
)

Definition at line 38 of file CastingFunctions.cpp.

Definition at line 87 of file CastingFunctions.cpp.

Common_API void cf3::common::XML::to_value< URI > ( XmlNode node,
URI val 
)

Definition at line 59 of file CastingFunctions.cpp.

Definition at line 105 of file CastingFunctions.cpp.

Common_API void cf3::common::XML::to_value< UUCount > ( XmlNode node,
UUCount val 
)

Definition at line 66 of file CastingFunctions.cpp.

Definition at line 111 of file CastingFunctions.cpp.

Send comments to:
COOLFluiD Web Admin