11 #include <boost/algorithm/string.hpp>
19 , CVariableAttributes()
25 , CVariableAttributes()
43 StdString variableName = attributes[
"name"];
48 error <<
"The variable id = " <<
id <<
" and name = " << variableName <<
" does not have any content. Please define it!" << std::endl
49 <<
"This variable is inside another element whose attributes are :" << std::endl;
51 for (xml::THashAttributes::iterator it = attributes.begin(); it != attributes.end(); ++it)
53 error << it->first <<
"=\"" << it->second.c_str() <<
"\" ";
57 ERROR(
"CVariable::parse(xml::CXMLNode & node)",
58 <<
"[ variable id = " <<
id
59 <<
" ] variable is not defined !. It does not have any content. See error log for more details.");
66 return name.isEmpty() ?
getId() : name;
85 oss <<
" id=\"" << this->
getId() <<
"\" ";
86 oss << SuperClassAttribute::toString() <<
">" << std::endl
105 for (
int i = 0; i < nbSrvPools; ++i)
118 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
119 event.push(*itRank,1,msg);
122 else contextClientTmp->
sendEvent(event) ;
136 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
137 event.
push(*itRank,1,msg);
179 ERROR(
"bool CVariable::dispatchEvent(CEventServer& event)",<<
"Unknown Event") ;
205 void CVariableGroup::parse(
xml::CXMLNode & node,
bool withAttr)
207 CVariableGroup* group_ptr = (this->hasId())
208 ? CVariableGroup::get(this->getId()) : CVariableGroup::get(
this);
211 if (this->getId().compare(CVariableGroup::GetDefName()) != 0 && node.
getContent(content))
213 StdSize beginid = 0, endid = 0, begindata = 0, enddata = 0;
216 while ((beginid = content.find_first_not_of (
" \r\n\t;", enddata)) != StdString::npos)
218 endid = content.find_first_of (
" \r\n\t=", beginid );
219 subid = content.substr ( beginid, endid-beginid);
220 subid = boost::to_lower_copy(boost::trim_copy(subid)) ;
222 begindata = content.find_first_of (
"=", endid ) + 1;
223 enddata = content.find_first_of (
";", begindata );
224 subdata = content.substr ( begindata, enddata-begindata);
225 subdata = boost::trim_copy(subdata) ;
226 group_ptr->createChild(subid)->content = subdata ;
231 SuperClass::parse(node, withAttr);
StdString getElementName(void) const
Accesseurs ///.
void sendEvent(CEventClient &event)
In case of attached mode, the current context must be reset to context for client.
bool goToParentElement(void)
static void recvValue(CEventServer &event)
bool getContent(StdString &content)
static bool dispatchEvent(CEventServer &event)
virtual ~CVariable(void)
Destructeur ///.
virtual void parse(xml::CXMLNode &node)
Autres ///.
static StdString GetName(void)
Accesseurs statiques ///.
std::vector< CContextClient * > clientPrimServer
const StdString & getContent(void) const
static ENodeType GetType(void)
static StdString GetDefName(void)
const std::list< int > & getRanksServerLeader(void) const
Get leading server in the group of connected server.
void setContent(const StdString &content)
const StdString & getId(void) const
Accesseurs ///.
virtual StdString toString(void) const
Autres ///.
const StdString & getVariableOutputName(void) const
Accesseur ///.
CATCH CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar *scalarDestination, CScalar *scalarSource, CReduceScalarToScalar *algo ERROR)("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",<< "Operation must be defined."<< "Scalar source "<< scalarSource->getId()<< std::endl<< "Scalar destination "<< scalarDestination->getId())
A context can be both on client and on server side.
std::map< StdString, StdString > THashAttributes
////////////////////// Déclarations ////////////////////// ///
////////////////////// Déclarations ////////////////////// ///
void push(int rank, int nbSender, CMessage &msg)
CLog error("error", cerr.rdbuf())
virtual void parse(xml::CXMLNode &node)
bool hasId(void) const
Tests ///.
CVariable(void)
Constructeurs ///.
enum xios::_node_type ENodeType
////////////////////// Définitions ////////////////////// ///
StdString id
Propriétés ///.
ENodeType getType(void) const
Accesseurs ///.
std::ostringstream StdOStringStream
Définition de types (issus de la bibliothèque standard)///.
THashAttributes getAttributes(void) const
void sendValue()
Sending a request to set up variable data.
static CContext * getCurrent(void)
Get current context.
CContextClient * client
Concrete contex client.
bool isServerLeader(void) const
Check if client connects to leading server.
static bool dispatchEvent(CEventServer &event)