00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CJNP_LINKNODES_H_
00021 #define _CJNP_LINKNODES_H_ 1
00022
00023 #include <string>
00024 #include "CjNetworkProcess.hh"
00025 #include "CjNetworkDimensioner.hh"
00026 #include "CjNodeSelector.hh"
00027
00028 namespace jmitie {
00029 namespace corelib {
00030 class CjNP_linkNodes : public CjNetworkProcess {
00031
00032 private:
00033 ctor_va_t::CjDimFactory_t::Visitor_shared_ptr m_link_dimensioner;
00034 ctor_va_t::CjNodeSelectorFactory_t::Visitor_shared_ptr m_dest_selector_a;
00035 ctor_va_t::CjNodeSelectorFactory_t::Visitor_shared_ptr m_dest_selector_b;
00036 bool m_dupe_ok;
00037 bool m_loop_ok;
00038 bool m_retry_src;
00039
00040 public:
00041 std::string getName() const { return getName_static(); }
00042 static std::string getName_static() { return "linkNodes"; }
00043 std::string getProperty(const std::string & prop) const { return getProperty_static(prop); }
00044 static std::string getProperty_static(const std::string & opt) {
00045 if(opt=="desc") return "Add a link between two nodes, selecting each node with two node selectors.";
00046 if(opt=="usage") return getProperty_static("desc") + "\n" \
00047 "node_selector_name1\n"\
00048 "node_selector_name2\tThe names of the two nodes selectors to use to chose a node pair which to connect.\n"\
00049 "link_dimensioner_name\tThe name of the link dimensioner to use on the new link.\n"\
00050 "[dupe_ok]\tIf specified a node pairs which are already connected are included in the node-pair selection(only applies when adding links).\n"\
00051 "[loop_ok]\tIf specified then it is allowable for the destination and source nodes to be the same.\n"\
00052 "[retry_src]\tIf present the source node selector will be executed again if the destination node selector cannot find a suitable destination.\n";
00053 throw std::invalid_argument("CjNP_linkNodes::getProperty_static(" + opt + "): Unknown property requested.");
00054 }
00055
00056 CjNP_linkNodes(const std::string & args, const ctor_va_t & var_arg );
00057 virtual void performAction( const action_va_t & opts );
00058
00059 ~CjNP_linkNodes() { }
00060
00061 };
00062 }
00063 }
00064
00065 #endif // _CJNP_LINKNODES_H_