• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ properties_t类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中properties_t的典型用法代码示例。如果您正苦于以下问题:C++ properties_t类的具体用法?C++ properties_t怎么用?C++ properties_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了properties_t类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
					}
				}
			}
        }
    }
开发者ID:WilliamChao,项目名称:behaviac,代码行数:29,代码来源:decoratortime.cpp


示例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')
			}
		}
	}
开发者ID:Evilcoolkings,项目名称:behaviac,代码行数:27,代码来源:fsmstate.cpp


示例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);
        }
    }
开发者ID:haolly,项目名称:behaviac,代码行数:32,代码来源:behaviortree.cpp


示例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);
                }
            }
        }
    }
开发者ID:Evilcoolkings,项目名称:behaviac,代码行数:27,代码来源:waitframes.cpp


示例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);
                }
            }
        }
    }
开发者ID:1414648814,项目名称:behaviac,代码行数:25,代码来源:query.cpp


示例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);
            }
        }
    }
开发者ID:pjkui,项目名称:behaviac,代码行数:33,代码来源:referencebehavior.cpp


示例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);
        }
    }
开发者ID:Evilcoolkings,项目名称:behaviac,代码行数:57,代码来源:condition.cpp


示例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);
            }
        }
    }
开发者ID:pjkui,项目名称:behaviac,代码行数:55,代码来源:event.cpp


示例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;
}
开发者ID:PKRoma,项目名称:libzmq,代码行数:11,代码来源:stream_engine.cpp


示例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;
            }
        }
    }
开发者ID:Evilcoolkings,项目名称:behaviac,代码行数:14,代码来源:decoratorlog.cpp


示例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);
            }
        }
    }
开发者ID:Evilcoolkings,项目名称:behaviac,代码行数:50,代码来源:action.cpp


示例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);
			}
		}
	}
开发者ID:dengyangli,项目名称:behaviac,代码行数:14,代码来源:fsm.cpp


示例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;
    }
开发者ID:YaleCheung,项目名称:behaviac,代码行数:49,代码来源:compute.cpp


示例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;
}
开发者ID:dand-oss,项目名称:libzmq,代码行数:15,代码来源:stream_engine.cpp


示例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;
    }
开发者ID:haolly,项目名称:behaviac,代码行数:35,代码来源:behaviortree.cpp


示例16: load

    void DecoratorWeight::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, "Weight") == 0)
            {
                behaviac::string typeName;
                behaviac::string propertyName;
                this->m_weight_var = Condition::LoadRight(p.value, typeName);
            }
        }
    }
开发者ID:1414648814,项目名称:behaviac,代码行数:16,代码来源:decoratorweight.cpp


示例17: load

    void SelectorProbability::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 (StringUtils::StringEqual(p.name, "RandomGenerator")) {
                if (p.value[0] != '\0') {
                    this->m_method = AgentMeta::ParseMethod(p.value);
                }//if (p.value[0] != '\0')

            } else {
                //BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
            }
        }
    }
开发者ID:YaleCheung,项目名称:behaviac,代码行数:16,代码来源:selectorprobability.cpp


示例18: load

    void DecoratorIterator::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 p = properties.begin(); p != properties.end(); ++p)
        {
            if (strcmp(p->name, "Opl") == 0)
            {
                behaviac::string str(p->value);
                size_t pParenthesis = str.find_first_of('(');

				if (pParenthesis == (size_t)-1)
                {
                    this->m_opl = Condition::LoadLeft(p->value);

                }
                else
                {
                    BEHAVIAC_ASSERT(false);
                }
            }
            else if (strcmp(p->name, "Opr") == 0)
            {
                behaviac::string str(p->value);
                size_t pParenthesis = str.find_first_of('(');

				if (pParenthesis == (size_t)-1)
                {
                    this->m_opr = Condition::LoadRight(p->value, typeName);

                }
                else
                {
                    //method
                    this->m_opr_m = Action::LoadMethod(p->value);
                }
            }
            else
            {
                //BEHAVIAC_ASSERT(0, "unrecognised property %s", p->name);
            }
        }
    }
开发者ID:AdamHyl,项目名称:behaviac,代码行数:46,代码来源:decoratoriterator.cpp


示例19: __strace

void __strace(const properties_t& properties, const char* str, ...)
{
  va_list vl;
  va_start(vl,str);
  if(properties.get_int("appserver.strace"))
    vprintf(str,vl);
  va_end(vl);
}
开发者ID:kstraube,项目名称:hysim,代码行数:8,代码来源:syscall.cpp


示例20: load

    void DecoratorLoop::load(int version, const char* agentType, const properties_t& properties) {
        DecoratorCount::load(version, agentType, properties);

        for (propertie_const_iterator_t it = properties.begin(); it != properties.end(); ++it) {
            const property_t& p = (*it);

            if (StringUtils::StringEqual(p.name, "DoneWithinFrame")) {
                if (p.value[0] != '\0') {
                    if (StringUtils::StringEqual(p.value, "true")) {
                        this->m_bDoneWithinFrame = true;
                    }
                }//if (p.value[0] != '\0')
            } else {
                //BEHAVIAC_ASSERT(0, "unrecognised property %s", p.name);
            }
        }

    }
开发者ID:YaleCheung,项目名称:behaviac,代码行数:18,代码来源:decoratorloop.cpp



注:本文中的properties_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ protein类代码示例发布时间:2022-05-31
下一篇:
C++ prop_convt类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap