GLIP-Lib
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
Glip::Modules::UniformsLoader::Node Class Reference

Container structure (filter, pipeline). More...

#include <UniformsLoader.hpp>

Public Member Functions

void softCopy (const Node &cpy, bool appendNewNodes=true, bool appendNewResources=true, bool removeAbsentNodes=true, bool removeAbsentResources=true)
 Perform a soft copy from another node (copy the existing data, with possible filters). More...
 
void softCopy (const Node &cpy, LoadingFilter loadingFilter)
 Perform a soft copy from another node (copy the existing data, with possible filters). More...
 
const std::string & getName (void) const
 Get the name of the node. More...
 
bool isFilter (void) const
 Get the name of the resource. More...
 
bool isPipeline (void) const
 Test if a Node is a pipeline (either the node is empty or it has sub-nodes only). More...
 
bool empty (void) const
 Test if a Node is a filter (either the node is empty or it has resources only). More...
 
void clear (void)
 Removes all resources and sub-nodes from this node.
 
bool hasModifications (void) const
 Test if this branch contains modified variables. More...
 
void clearModifiedFlags (bool value=false)
 Go through all sub-nodes and change any Resource::modified flag. More...
 
int getNumSubNodes (void) const
 Get the number of sub-nodes. More...
 
std::vector< std::string > getSubNodesNamesList (void) const
 Get a list of the name of all sub-nodes. More...
 
bool subNodeExists (const std::string &nodeName) const
 Test if a sub-node exist. More...
 
const NodesubNode (const std::string &nodeName) const
 Access a sub-node by its name. More...
 
NodesubNode (const std::string &nodeName)
 Access a sub-node by its name. More...
 
void eraseNode (const std::string &nodeName)
 Remove a node by its name or raise an exception if any error occurs. More...
 
NodeConstIterator nodeBegin (void) const
 Get the 'begin' iterator on the sub-nodes list. More...
 
NodeConstIterator nodeEnd (void) const
 Get the 'end' iterator on the sub-nodes list. More...
 
NodeConstIterator findNode (const std::string &nodeName) const
 Find node. More...
 
NodeIterator nodeBegin (void)
 Get the 'begin' iterator on the sub-nodes list. More...
 
NodeIterator nodeEnd (void)
 Get the 'end' iterator on the sub-nodes list. More...
 
NodeIterator findNode (const std::string &nodeName)
 Find node. More...
 
int getNumResources (void) const
 Get the number of resources. More...
 
std::vector< std::string > getResourcesNamesList (void) const
 Get a list of the name of all resources. More...
 
bool resourceExists (const std::string &resourceName) const
 Test if a resource exist. More...
 
const Resourceresource (const std::string &resourceName) const
 Access a resource by its name. More...
 
Resourceresource (const std::string &resourceName)
 Access a resource by its name. More...
 
void eraseResource (const std::string &resourceName)
 Remove a resource by its name or raise an exception if any error occurs. More...
 
ResourceConstIterator resourceBegin (void) const
 Get the 'begin' iterator on the resources list. More...
 
ResourceConstIterator resourceEnd (void) const
 Get the 'end' iterator on the resources list. More...
 
ResourceConstIterator findResource (const std::string &resourceName) const
 Find resource. More...
 
ResourceIterator resourceBegin (void)
 Get the 'begin' iterator on the resources list. More...
 
ResourceIterator resourceEnd (void)
 Get the 'end' iterator on the resources list. More...
 
ResourceIterator findResource (const std::string &resourceName)
 Find resource. More...
 

Detailed Description

Container structure (filter, pipeline).

Member Function Documentation

void UniformsLoader::Node::clearModifiedFlags ( bool  value = false)

Go through all sub-nodes and change any Resource::modified flag.

Parameters
valueThe new value to set for the flags (true, will set all the subsequent modified flags to true).
bool UniformsLoader::Node::empty ( void  ) const

Test if a Node is a filter (either the node is empty or it has resources only).

Returns
True if the Node corresponds to a Filter structure.
void UniformsLoader::Node::eraseNode ( const std::string &  nodeName)

Remove a node by its name or raise an exception if any error occurs.

Parameters
nodeNameThe name of the targeted node.
void UniformsLoader::Node::eraseResource ( const std::string &  resourceName)

Remove a resource by its name or raise an exception if any error occurs.

Parameters
resourceNameThe name of the targeted resource.
UniformsLoader::NodeConstIterator UniformsLoader::Node::findNode ( const std::string &  nodeName) const

Find node.

Parameters
nodeNameName of the targeted node.
Returns
A constant iterator to the node or UniformsLoader::Node::nodeEnd() if no match is found.
UniformsLoader::NodeIterator UniformsLoader::Node::findNode ( const std::string &  nodeName)

Find node.

Parameters
nodeNameName of the targeted node.
Returns
An iterator to the node or UniformsLoader::Node::nodeEnd() if no match is found.
UniformsLoader::ResourceConstIterator UniformsLoader::Node::findResource ( const std::string &  resourceName) const

Find resource.

Parameters
resourceNameName of the targeted resource.
Returns
A constant iterator to the resource or UniformsLoader::Node::resourceEnd() if no match is found.
UniformsLoader::ResourceIterator UniformsLoader::Node::findResource ( const std::string &  resourceName)

Find resource.

Parameters
resourceNameName of the targeted resource.
Returns
An iterator to the resource or UniformsLoader::Node::resourceEnd() if no match is found.
const std::string & UniformsLoader::Node::getName ( void  ) const

Get the name of the node.

Returns
Constant reference to the standard string containing the name of the Node.
int UniformsLoader::Node::getNumResources ( void  ) const

Get the number of resources.

Returns
The number of resources.
int UniformsLoader::Node::getNumSubNodes ( void  ) const

Get the number of sub-nodes.

Returns
The number of sub-nodes.
std::vector< std::string > UniformsLoader::Node::getResourcesNamesList ( void  ) const

Get a list of the name of all resources.

Returns
A list of all resources names.
std::vector< std::string > UniformsLoader::Node::getSubNodesNamesList ( void  ) const

Get a list of the name of all sub-nodes.

Returns
A list of all sub-nodes names.
bool UniformsLoader::Node::hasModifications ( void  ) const

Test if this branch contains modified variables.

Returns
True, if variable contained declared modification (see UniformsLoader::Resource::modified).
bool UniformsLoader::Node::isFilter ( void  ) const

Get the name of the resource.

Returns
True if the node is empty (no sub-node or no resource).
bool UniformsLoader::Node::isPipeline ( void  ) const

Test if a Node is a pipeline (either the node is empty or it has sub-nodes only).

Returns
True if the Node corresponds to a Pipeline structure.
UniformsLoader::NodeConstIterator UniformsLoader::Node::nodeBegin ( void  ) const

Get the 'begin' iterator on the sub-nodes list.

Returns
A UniformsLoader::NodeConstIterator on 'begin'.
UniformsLoader::NodeIterator UniformsLoader::Node::nodeBegin ( void  )

Get the 'begin' iterator on the sub-nodes list.

Returns
A UniformsLoader::NodeIterator on 'begin'.
UniformsLoader::NodeConstIterator UniformsLoader::Node::nodeEnd ( void  ) const

Get the 'end' iterator on the sub-nodes list.

Returns
A UniformsLoader::NodeConstIterator on 'end'.
UniformsLoader::NodeIterator UniformsLoader::Node::nodeEnd ( void  )

Get the 'end' iterator on the sub-nodes list.

Returns
A UniformsLoader::NodeIterator on 'end'.
const UniformsLoader::Resource & UniformsLoader::Node::resource ( const std::string &  resourceName) const

Access a resource by its name.

Parameters
resourceNameThe name of the targeted resource.
Returns
A (constant) reference to the targeted resource or raise an exception is any error occurs.
UniformsLoader::Resource & UniformsLoader::Node::resource ( const std::string &  resourceName)

Access a resource by its name.

Parameters
resourceNameThe name of the targeted resource.
Returns
A reference to the targeted resource or raise an exception is any error occurs.
UniformsLoader::ResourceConstIterator UniformsLoader::Node::resourceBegin ( void  ) const

Get the 'begin' iterator on the resources list.

Returns
A UniformsLoader::ResourceConstIterator on 'begin'.
UniformsLoader::ResourceIterator UniformsLoader::Node::resourceBegin ( void  )

Get the 'begin' iterator on the resources list.

Returns
A UniformsLoader::ResourceIterator on 'begin'.
UniformsLoader::ResourceConstIterator UniformsLoader::Node::resourceEnd ( void  ) const

Get the 'end' iterator on the resources list.

Returns
A UniformsLoader::ResourceConstIterator on 'end'.
UniformsLoader::ResourceIterator UniformsLoader::Node::resourceEnd ( void  )

Get the 'end' iterator on the resources list.

Returns
A UniformsLoader::ResourceIterator on 'end'.
bool UniformsLoader::Node::resourceExists ( const std::string &  resourceName) const

Test if a resource exist.

Parameters
resourceNameThe name of the targeted resource.
Returns
True if the resource exists, false otherwise.
void UniformsLoader::Node::softCopy ( const Node cpy,
bool  appendNewNodes = true,
bool  appendNewResources = true,
bool  removeAbsentNodes = true,
bool  removeAbsentResources = true 
)

Perform a soft copy from another node (copy the existing data, with possible filters).

Parameters
cpyThe node to be copied (the source).
appendNewNodesIf true, nodes existing in the source but not in this will be added to this.
appendNewResourcesIf true, resources existing in the source but not in this will be added to this.
removeAbsentNodesIf true, remove the nodes existing in this but not in the source.
removeAbsentResourcesIf true, remove the resources existing in this but not in the source.
void UniformsLoader::Node::softCopy ( const Node cpy,
LoadingFilter  loadingFilter 
)

Perform a soft copy from another node (copy the existing data, with possible filters).

The nodes existing in this but not in the source will not be modified.

Parameters
cpyThe node to be copied (the source).
loadingFilterSelect a specific method of loading.
const UniformsLoader::Node & UniformsLoader::Node::subNode ( const std::string &  nodeName) const

Access a sub-node by its name.

Parameters
nodeNameThe name of the targeted node.
Returns
A (constant) reference to the targeted node or raise an exception is any error occurs.
UniformsLoader::Node & UniformsLoader::Node::subNode ( const std::string &  nodeName)

Access a sub-node by its name.

Parameters
nodeNameThe name of the targeted node.
Returns
A reference to the targeted node or raise an exception is any error occurs.
bool UniformsLoader::Node::subNodeExists ( const std::string &  nodeName) const

Test if a sub-node exist.

Parameters
nodeNameThe name of the targeted node.
Returns
True if the node exists, false otherwise.

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