TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/NodeListArg.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_HOST_CORE_NODELISTARG_HPP_
00002 #define _TUTTLE_HOST_CORE_NODELISTARG_HPP_
00003 
00004 #include <string>
00005 #include <list>
00006 
00007 namespace tuttle {
00008 namespace host {
00009 
00010 class INode;
00011 
00012 /**
00013  * @brief An utility class to use as function argument. It allows to create a list of nodes from multiple inputs.
00014  * 
00015  * All constructors are not "explicit", so we could automatically convert the
00016  * input inside when we use it as a function argument.
00017  */
00018 class NodeListArg
00019 {
00020 public:
00021         NodeListArg()
00022         {}
00023         NodeListArg( const std::list<std::string>& nodes )
00024         : _nodes( nodes )
00025         {}
00026         NodeListArg( const std::list<INode*>& nodes );
00027         
00028         NodeListArg( const std::string& node )
00029         {
00030                 _nodes.push_back( node );
00031         }
00032         NodeListArg( const INode& node );
00033 
00034 public:
00035         const std::list<std::string>& getNodes() const { return _nodes; }
00036 
00037 private:
00038         std::list<std::string> _nodes;
00039 };
00040 
00041 }
00042 }
00043 
00044 #endif