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);
69 DEBTRACE(
"server_loadcontainer: " << name )
71 std::map<std::string,YACS::ENGINE::Container *>::const_iterator it(currentProc->
containerMap.find(name));
74 this->
_node->setContainer((*it).second);
80 this->
_node->setContainer(cont);
92 std::string fullname = currentProc->
names.back()+
name;
93 if(currentProc->
inlineMap.count(name) != 0)
99 else if(currentProc->
inlineMap.count(fullname) != 0)
114 DEBTRACE(
"server_method: " << 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);
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;
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;
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]);
218 currentProc->
containerMap[
"DefaultContainer"]->checkCapabilityToDealWith(this->
_node->getComponent());
219 this->
_node->getComponent()->setContainer(currentProc->
containerMap[
"DefaultContainer"]);
225 std::cerr <<
"WARNING: Unknown container " << this->
_container <<
" ignored" << std::endl;
231 template <
class T> servertypeParser<T> servertypeParser<T>::serverParser;
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);