20 #ifndef _SERVERPARSERS_HXX_
21 #define _SERVERPARSERS_HXX_
31 static std::string
t22[]={
"ref",
"node",
"component",
"componentinstance",
""};
33 template <
class T=YACS::ENGINE::ServerNode*>
41 DEBTRACE(
"servertypeParser::onEnd: " << el )
42 std::string element(el);
74 this->
_node->setContainer((*it).second);
80 this->
_node->setContainer(cont);
97 this->_node =
n->createNode(this->_name);
104 this->_node =
n->createNode(this->_name);
116 throw YACS::Exception(
"ServerNode must be completely defined before defining its method");
119 this->
logError(
"a server name must be a non empty string");
122 this->
_node->setFname(name);
127 DEBTRACE(
"server_load: " <<
l._container);
137 throw YACS::Exception(
"ServerNode must be completely defined before defining its ports");
144 std::string msg=
"Unknown InStreamPort Type: ";
145 msg=msg+
p._type+
" for node: "+this->
_node->getName()+
" port name: "+p.
_name;
157 std::map<std::string, std::string>::const_iterator pt;
158 for(pt=
p._props.begin();pt!=
p._props.end();pt++)
167 throw YACS::Exception(
"ServerNode must be completely defined before defining its ports");
174 std::string msg=
"Unknown OutStreamPort Type: ";
175 msg=msg+
p._type+
" for node: "+this->
_node->getName()+
" port name: "+p.
_name;
187 std::map<std::string, std::string>::const_iterator pt;
188 for(pt=
p._props.begin();pt!=
p._props.end();pt++)
195 if(this->
_state ==
"disabled")this->
_node->exDisabledState();
198 if(!this->
_node->getComponent())
204 if(this->
_node->getComponent()->getContainer())
209 if(this->
_node->getComponent()->isAnonymous())
211 if(currentProc->
containerMap.count(this->_container) != 0)
212 this->
_node->getComponent()->setContainer(currentProc->
containerMap[this->_container]);
219 this->
_node->getComponent()->setContainer(currentProc->
containerMap[
"DefaultContainer"]);
225 std::cerr <<
"WARNING: Unknown container " << this->
_container <<
" ignored" << std::endl;
237 DEBTRACE(
"servertypeParser::onStart: " << el )
238 std::string element(el);
240 this->maxcount(
"kind",1,element);
241 this->maxcount(
"ref",1,element);
242 this->maxcount(
"node",1,element);
243 this->maxcount(
"component",1,element);
244 this->maxcount(
"componentinstance",1,element);
245 this->maxcount(
"loadcontainer",1,element);
246 this->maxcount(
"script",1,element);
247 this->maxcount(
"method",1,element);
248 this->maxcount(
"load",1,element);
249 this->maxchoice(
t22,1,element);
264 this->SetUserDataAndPush(pp);
void setName(std::string name)
WARNING ! name is used in edition to identify different containers, it is not the runtime name of the...
virtual void setProperty(const std::string &name, const std::string &value)
Set a new value for a property of the port.
Base class for all schema objects.
std::map< std::string, InlineNode * > inlineMap
virtual Container * createContainer(const std::string &name, const std::string &kind="")
Create a new Container and store it in containerMap.
std::map< std::string, TypeCode * > typeMap
std::vector< std::string > names
std::map< std::string, Container * > containerMap
virtual InlineFuncNode * createFuncNode(const std::string &kind, const std::string &name)
virtual TypeCode * getTypeCode(const std::string &name)
Get a typecode by its name from runtime catalogs.
Base class for all type objects.
YACS::ENGINE::Runtime * theRuntime
YACS::ENGINE::Proc * currentProc
Class for code parser in inline nodes.
static codetypeParser codeParser
virtual void outport(const myoutport &p)
virtual void kind(const std::string &name)
virtual void inport(const myinport &p)
Class for loading parser.
static loadtypeParser loadParser
virtual void property(const myprop &prop)
virtual void name(const std::string &name)
Class for Outport parser.
virtual void mincount(std::string name, int min)
virtual void buildAttr(const XML_Char **attr)
static parser main_parser
void logError(const std::string &reason)
Class for property parser.
static propertytypeParser propertyParser
virtual void method(const std::string &name)
virtual void node(const std::string &name)
virtual void outstream(const myoutport &p)
static servertypeParser< T > serverParser
virtual void script(const myfunc &f)
virtual void onStart(const XML_Char *el, const XML_Char **attr)
virtual void loadcontainer(const std::string &name)
virtual void load(const loadon &l)
virtual void onEnd(const char *el, parser *child)
virtual void instream(const myinport &p)
static stringtypeParser stringParser