本文整理汇总了C++中properties_t类的典型用法代码示例。如果您正苦于以下问题:C++ properties_t类的具体用法?C++ properties_t怎么用?C++ properties_t使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了properties_t类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void DecoratorTime::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
behaviac::string p_name(p.name);
behaviac::string p_value(p.value);
if (p_name == "Time")
{
if (StringUtils::IsValidString(p.value))
{
size_t pParenthesis = p_value.find_first_of('(');
if (pParenthesis == (size_t)-1)
{
behaviac::string typeName;
this->m_time_var = Condition::LoadRight(p.value, typeName);
}
else
{
this->m_time_m = Action::LoadMethod(p.value);
}
}
}
}
}
示例2: load
void State::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "Method") == 0)
{
if (p.value[0] != '\0')
{
this->m_method = Action::LoadMethod(p.value);
}
}
else if (strcmp(p.name, "IsEndState") == 0)
{
if (p.value[0] != '\0')
{
if (StringUtils::StrEqual(p.value, "true"))
{
this->m_bIsEndState = true;
}
}//if (p.value[0] != '\0')
}
}
}
示例3: load
void BehaviorNode::load(int version, const char* agentType, const properties_t& properties)
{
BEHAVIAC_UNUSED_VAR(version);
BEHAVIAC_UNUSED_VAR(agentType);
BEHAVIAC_UNUSED_VAR(properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (StringUtils::StrEqual(p.name, "EnterAction"))
{
if (p.value[0] != '\0')
{
this->m_enterAction = Action::LoadMethod(p.value);
}//if (p.value[0] != '\0')
}
else if (StringUtils::StrEqual(p.name, "ExitAction"))
{
if (p.value[0] != '\0')
{
this->m_exitAction = Action::LoadMethod(p.value);
}//if (p.value[0] != '\0')
}
}
{
const char* nodeType = this->GetObjectTypeName();
Workspace::GetInstance()->BehaviorNodeLoaded(nodeType, properties);
}
}
示例4: load
void WaitFrames::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (!strcmp(p.name, "Frames"))
{
const char* pParenthesis = strchr(p.value, '(');
if (pParenthesis == 0)
{
behaviac::string typeName;
behaviac::string propertyName;
this->m_frames_var = Condition::LoadRight(p.value, typeName);
}
else
{
//method
this->m_frames_method = Action::LoadMethod(p.value);
}
}
}
}
示例5: load
void Query::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
if (properties.size() > 0)
{
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "Domain") == 0)
{
m_domain = p.value;
}
else if (strcmp(p.name, "Descriptors") == 0)
{
SetDescriptors(p.value);
}
else
{
//BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
}
}
}
}
示例6: load
void ReferencedBehavior::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "ReferenceFilename") == 0)
{
this->m_referencedBehaviorPath = p.value;
bool bOk = Workspace::GetInstance()->Load(this->m_referencedBehaviorPath.c_str());
BEHAVIAC_UNUSED_VAR(bOk);
BEHAVIAC_ASSERT(bOk);
}
else if (strcmp(p.name, "Task") == 0)
{
BEHAVIAC_ASSERT(!StringUtils::IsNullOrEmpty(p.value));
CMethodBase* m = Action::LoadMethod(p.value);
//BEHAVIAC_ASSERT(m is CTaskMethod);
this->m_taskMethod = (CTaskMethod*)m;
}
else
{
//BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
}
}
}
示例7: load
void Condition::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
behaviac::string typeName;
behaviac::string comparatorName;
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "Operator") == 0)
{
comparatorName = p.value;
}
else if (strcmp(p.name, "Opl") == 0)
{
const char* pParenthesis = strchr(p.value, '(');
if (pParenthesis == 0)
{
this->m_opl = LoadLeft(p.value, typeName);
}
else
{
this->m_opl_m = Action::LoadMethod(p.value);
}
}
else if (strcmp(p.name, "Opr") == 0)
{
const char* pParenthesis = strchr(p.value, '(');
if (pParenthesis == 0)
{
this->m_opr = LoadRight(p.value, typeName);
}
else
{
this->m_opr_m = Action::LoadMethod(p.value);
if (this->m_opr_m)
{
this->m_opr_m->GetReturnTypeName(typeName);
}
}
}
else
{
//BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
}
}
if (!comparatorName.empty() && (this->m_opl || this->m_opl_m) && (this->m_opr || this->m_opr_m))
{
this->m_comparator = Condition::Create(typeName.c_str(), comparatorName.c_str(), this->m_opl, this->m_opl_m, this->m_opr, this->m_opr_m);
}
}
示例8: load
void Event::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
behaviac::string typeName;
behaviac::string propertyName;
behaviac::string comparatorName;
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "EventName") == 0)
{
//method
this->m_event = Action::LoadMethod(p.value);
}
else if (strcmp(p.name, "ReferenceFilename") == 0)
{
this->m_referencedBehaviorPath = p.value;
}
else if (strcmp(p.name, "TriggeredOnce") == 0)
{
if (string_icmp(p.value, "true") == 0)
{
this->m_bTriggeredOnce = true;
}
}
else if (strcmp(p.name, "TriggerMode") == 0)
{
if (string_icmp(p.value, "Transfer") == 0)
{
this->m_triggerMode = TM_Transfer;
}
else if (string_icmp(p.value, "Return") == 0)
{
this->m_triggerMode = TM_Return;
}
else
{
BEHAVIAC_ASSERT(0, "unrecognised trigger mode %s", p.value);
}
}
else
{
//BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
}
}
}
示例9:
bool zmq::stream_engine_t::init_properties (properties_t & properties) {
if (peer_address.empty()) return false;
properties.insert (std::make_pair("Peer-Address", peer_address));
// Private property to support deprecated SRCFD
std::ostringstream stream;
stream << (int)s;
std::string fd_string = stream.str();
properties.insert(std::make_pair("__fd", fd_string));
return true;
}
示例10: load
void DecoratorLog::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "Log") == 0)
{
this->m_message = p.value;
}
}
}
示例11: load
void Action::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "Method") == 0)
{
if (p.value[0] != '\0')
{
this->m_method = Action::LoadMethod(p.value);
}
}
else if (strcmp(p.name, "ResultOption") == 0)
{
if (strcmp(p.value, "BT_INVALID") == 0)
{
m_resultOption = BT_INVALID;
}
else if (strcmp(p.value, "BT_FAILURE") == 0)
{
m_resultOption = BT_FAILURE;
}
else if (strcmp(p.value, "BT_RUNNING") == 0)
{
m_resultOption = BT_RUNNING;
}
else
{
m_resultOption = BT_SUCCESS;
}
}
else if (strcmp(p.name, "ResultFunctor") == 0)
{
if (p.value[0] != '\0')
{
this->m_resultFunctor = LoadMethod(p.value);
}
}
else
{
//BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
}
}
}
示例12: load
void FSM::load(int version, const char* agentType, const properties_t& properties)
{
super::load(version, agentType, properties);
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it)
{
const property_t& p = (*it);
if (strcmp(p.name, "initialid") == 0)
{
this->m_initialId = atoi(p.value);
}
}
}
示例13: load
void Compute::load(int version, const char* agentType, const properties_t& properties) {
super::load(version, agentType, properties);
behaviac::string typeName;
behaviac::string propertyName;
for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it) {
const property_t& p = (*it);
if (StringUtils::StringEqual(p.name, "Opl")) {
//this->m_opl = Condition::LoadLeft(p.value, typeName);
this->m_opl = AgentMeta::ParseProperty(p.value);
} else if (StringUtils::StringEqual(p.name, "Operator")) {
BEHAVIAC_ASSERT(StringUtils::StringEqual(p.value, "Add")
|| StringUtils::StringEqual(p.value, "Sub")
|| StringUtils::StringEqual(p.value, "Mul")
|| StringUtils::StringEqual(p.value, "Div"));
this->m_operator = OperationUtils::ParseOperatorType(p.value);
} else if (StringUtils::StringEqual(p.name, "Opr1")) {
const char* pParenthesis = strchr(p.value, '(');
if (pParenthesis == 0) {
//this->m_opr1 = Condition::LoadRight(p.value, typeName);
this->m_opr1 = AgentMeta::ParseProperty(p.value);
} else {
//method
//this->m_opr1_m = Action::LoadMethod(p.value);
this->m_opr1 = AgentMeta::ParseMethod(p.value);
}
} else if (StringUtils::StringEqual(p.name, "Opr2")) {
const char* pParenthesis = strchr(p.value, '(');
if (pParenthesis == 0) {
this->m_opr2 = AgentMeta::ParseProperty(p.value);
//this->m_opr2 = Condition::LoadRight(p.value, typeName);
} else {
//method
//this->m_opr2_m = Action::LoadMethod(p.value);
this->m_opr2 = AgentMeta::ParseMethod(p.value);
}
} else {
//BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
}
}
this->m_typeName = typeName;
}
示例14:
bool zmq::stream_engine_t::init_properties (properties_t &properties_)
{
if (_peer_address.empty ())
return false;
properties_.ZMQ_MAP_INSERT_OR_EMPLACE (
std::string (ZMQ_MSG_PROPERTY_PEER_ADDRESS), _peer_address);
// Private property to support deprecated SRCFD
std::ostringstream stream;
stream << static_cast<int> (_s);
std::string fd_string = stream.str ();
properties_.ZMQ_MAP_INSERT_OR_EMPLACE (std::string ("__fd"),
ZMQ_MOVE (fd_string));
return true;
}
示例15: load_property_pars
bool BehaviorNode::load_property_pars(properties_t& properties, rapidxml::xml_node<>* c, int version, const char* agentType)
{
if (StringUtils::StrEqual(c->name(), kStrProperty))
{
if (rapidxml::xml_attribute<>* attr = c->first_attribute())
{
//std::cout << attr->name() << ":" << attr->value() << std::endl;
const char* pPropertyName = attr->name();
const char* pPropertyValue = attr->value();
properties.push_back(property_t(pPropertyName, pPropertyValue));
}
return true;
}
else if (StringUtils::StrEqual(c->name(), kStrPars))
{
rapidxml::xml_node<>* children = c->first_node();
if (children != NULL)
{
for (rapidxml::xml_node<>* child = children; child; child = child->next_sibling())
{
if (StringUtils::StrEqual(child->name(), kStrPar))
{
this->load_par(version, agentType, child);
}
}
}
return true;
}
return false;
}