⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 property.cxx

📁 ecos实时嵌入式操作系统
💻 CXX
📖 第 1 页 / 共 3 页
字号:
    data = value_arg;    cdlproperty_stringbody_cookie = CdlProperty_StringBody_Magic;    CYGDBG_MEMLEAK_CONSTRUCTOR();        CYG_POSTCONDITION_THISC();    CYG_REPORT_RETURN();}CdlProperty_StringBody::~CdlProperty_StringBody(){    CYG_REPORT_FUNCNAME("CdlProperty_String:: destructor");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    cdlproperty_stringbody_cookie = CdlProperty_StringBody_Invalid;    data = "";    CYGDBG_MEMLEAK_DESTRUCTOR();        CYG_REPORT_RETURN();}std::stringCdlProperty_StringBody::get_string(void) const{    CYG_REPORT_FUNCNAME("CdlProperty_String::get_string");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    CYG_REPORT_RETURN();    return data;}boolCdlProperty_StringBody::check_this(cyg_assert_class_zeal zeal) const{    if (CdlProperty_StringBody_Magic != cdlproperty_stringbody_cookie) {        return false;    }    CYGDBG_MEMLEAK_CHECKTHIS();    return inherited::check_this(zeal);}//}}}`//{{{  CdlProperty_TclCode class        // ----------------------------------------------------------------------------CdlProperty_TclCodeCdlProperty_TclCodeBody::make(CdlNode node_arg, std::string name_arg, cdl_tcl_code code_arg,                              int argc_arg, const char* argv_arg[],                              std::vector<std::pair<std::string,std::string> >& options_arg){    return new CdlProperty_TclCodeBody(node_arg, name_arg, 0, code_arg, argc_arg, argv_arg, options_arg);}CdlProperty_TclCodeCdlProperty_TclCodeBody::make(CdlNode node_arg, std::string name_arg, cdl_int number_arg, cdl_tcl_code code_arg,                              int argc_arg, const char* argv_arg[],                              std::vector<std::pair<std::string,std::string> >& options_arg)                              {    return new CdlProperty_TclCodeBody(node_arg, name_arg, number_arg, code_arg, argc_arg, argv_arg, options_arg);}CdlProperty_TclCodeBody::CdlProperty_TclCodeBody(CdlNode node_arg, std::string name_arg,                                                 cdl_int number_arg, cdl_tcl_code code_arg,                                                 int argc_arg, const char* argv_arg[],                                                 std::vector<std::pair<std::string,std::string> >& options_arg)    : inherited(node_arg, name_arg, argc_arg, argv_arg, options_arg){    CYG_REPORT_FUNCNAME("CdlProperty_TclCode:: constructor");    CYG_REPORT_FUNCARG2("this %p, number_arg %d", this, number_arg);    code   = code_arg;    number = number_arg;    cdlproperty_tclcodebody_cookie = CdlProperty_TclCodeBody_Magic;    CYGDBG_MEMLEAK_CONSTRUCTOR();        CYG_POSTCONDITION_THISC();    CYG_REPORT_RETURN();}CdlProperty_TclCodeBody::~CdlProperty_TclCodeBody(){    CYG_REPORT_FUNCNAME("CdlProperty_TclCode:: destructor");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    cdlproperty_tclcodebody_cookie = CdlProperty_TclCodeBody_Invalid;    code = cdl_tcl_code("");    CYGDBG_MEMLEAK_DESTRUCTOR();        CYG_REPORT_RETURN();}const cdl_tcl_code&CdlProperty_TclCodeBody::get_code(void) const{    CYG_REPORT_FUNCNAME("CdlProperty_TclCode::get_code");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    CYG_REPORT_RETURN();    return code;}cdl_intCdlProperty_TclCodeBody::get_number(void) const{    CYG_REPORT_FUNCNAMETYPE("CdlProperty_TclCode::get_number", "result %d");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    cdl_int result = number;    CYG_REPORT_RETVAL(result);    return result;}boolCdlProperty_TclCodeBody::check_this(cyg_assert_class_zeal zeal) const{    if (CdlProperty_TclCodeBody_Magic != cdlproperty_tclcodebody_cookie) {        return false;    }    CYGDBG_MEMLEAK_CHECKTHIS();    return inherited::check_this(zeal);}//}}}//{{{  CdlProperty_StringVector class   // ----------------------------------------------------------------------------CdlProperty_StringVectorCdlProperty_StringVectorBody::make(CdlNode node_arg, std::string name_arg, const std::vector<std::string>& data_arg,                                   int argc_arg, const char* argv_arg[],                                   std::vector<std::pair<std::string,std::string> >& options_arg){    return new CdlProperty_StringVectorBody(node_arg, name_arg, data_arg, argc_arg, argv_arg, options_arg);}CdlProperty_StringVectorBody::CdlProperty_StringVectorBody(CdlNode node_arg, std::string name_arg,                                                           const std::vector<std::string>& data_arg,                                                           int argc_arg, const char* argv_arg[],                                                           std::vector<std::pair<std::string,std::string> >& options_arg)    : inherited(node_arg, name_arg, argc_arg, argv_arg, options_arg){    CYG_REPORT_FUNCNAME("CdlProperty_StringVector:: constructor");    CYG_REPORT_FUNCARG1("this %p", this);        data = data_arg;    cdlproperty_stringvectorbody_cookie = CdlProperty_StringVectorBody_Magic;    CYGDBG_MEMLEAK_CONSTRUCTOR();        CYG_POSTCONDITION_THISC();    CYG_REPORT_RETURN();}CdlProperty_StringVectorBody::~CdlProperty_StringVectorBody(){    CYG_REPORT_FUNCNAME("CdlProperty_StringVector:: destructor");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    cdlproperty_stringvectorbody_cookie = CdlProperty_StringVectorBody_Invalid;    data.clear();    CYGDBG_MEMLEAK_DESTRUCTOR();        CYG_REPORT_RETURN();}std::stringCdlProperty_StringVectorBody::get_first_string(void) const{    CYG_REPORT_FUNCNAME("CdlProperty_StringVector::get_first_string");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    std::string result;    if (0 == data.size()) {        result = "";    } else {        result = data[0];    }    CYG_REPORT_RETURN();    return result;}unsigned intCdlProperty_StringVectorBody::get_number_of_strings() const{    CYG_REPORT_FUNCNAMETYPE("CdlProperty_StringVector::get_number_of_strings", "result %d");    CYG_REPORT_FUNCARG1XV(this);    CYG_PRECONDITION_THISC();    unsigned int result = data.size();    CYG_REPORT_RETVAL(result);    return result;}std::stringCdlProperty_StringVectorBody::get_string(unsigned int index) const{    CYG_REPORT_FUNCNAME("CdlProperty_StringVector::get_string");    CYG_REPORT_FUNCARG2XV(this, index);    CYG_PRECONDITION_THISC();    CYG_PRECONDITIONC(index < data.size());    std::string result = data[index];    CYG_REPORT_RETURN();    return result;}const std::vector<std::string>&CdlProperty_StringVectorBody::get_strings(void) const{    CYG_REPORT_FUNCNAME("CdlProperty_StringVector::get_strings");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    CYG_REPORT_RETURN();    return data;}boolCdlProperty_StringVectorBody::check_this(cyg_assert_class_zeal zeal) const{    if (CdlProperty_StringVectorBody_Magic != cdlproperty_stringvectorbody_cookie) {        return false;    }    CYGDBG_MEMLEAK_CHECKTHIS();    return inherited::check_this(zeal);}//}}}`//{{{  CdlProperty_Reference class      // ----------------------------------------------------------------------------// This is pretty simple since most of the functionality is provided by the// reference class.CdlProperty_ReferenceCdlProperty_ReferenceBody::make(CdlNode node_arg, std::string name_arg, std::string ref_arg, CdlUpdateHandler update_handler,                                int argc_arg, const char* argv_arg[],                                std::vector<std::pair<std::string,std::string> >& options_arg){    return new CdlProperty_ReferenceBody(node_arg, name_arg, ref_arg, update_handler, argc_arg, argv_arg, options_arg);}CdlProperty_ReferenceBody::CdlProperty_ReferenceBody(CdlNode node_arg, std::string name_arg, std::string ref_arg,                                                     CdlUpdateHandler update_handler_arg,                                                     int argc_arg, const char* argv_arg[],                                                     std::vector<std::pair<std::string,std::string> >& options_arg)    : CdlPropertyBody(node_arg, name_arg, argc_arg, argv_arg, options_arg),      CdlReference(ref_arg),      update_handler(update_handler_arg){    CYG_REPORT_FUNCNAME("CdlProperty_Reference:: constructor");    CYG_REPORT_FUNCARG1("this %p", this);    cdlproperty_referencebody_cookie = CdlProperty_ReferenceBody_Magic;    CYGDBG_MEMLEAK_CONSTRUCTOR();        CYG_POSTCONDITION_THISC();    CYG_REPORT_RETURN();}CdlProperty_ReferenceBody::~CdlProperty_ReferenceBody(){    CYG_REPORT_FUNCNAME("CdlProperty_Reference:: destructor");    CYG_REPORT_FUNCARG1("this %p", this);    CYG_PRECONDITION_THISC();    cdlproperty_referencebody_cookie = CdlProperty_ReferenceBody_Invalid;    CYGDBG_MEMLEAK_DESTRUCTOR();    CYG_REPORT_RETURN();}// ----------------------------------------------------------------------------// Reference handling. It is useful at this level to cope with the// four cases of Loaded, Unloaded, Created, and Destroyed. In addition// the property-specific update handler needs to be invoked.voidCdlProperty_ReferenceBody::update(CdlTransaction transact, CdlNode source, CdlNode dest, CdlUpdate change){    CYG_REPORT_FUNCNAME("CdlProperty_Reference::update");    CYG_REPORT_FUNCARG5XV(this, transact, source, dest, change);    CYG_PRECONDITION_THISC();    switch(change) {              case CdlUpdate_Loaded :      {        // The source has just been loaded, try to resolve the reference.        // Note that e.g. the parent property allow for a reference to ""        // The necessary validation will have happened during parsing.        CYG_ASSERTC(0 == dest);        CdlToplevel toplevel = source->get_toplevel();        std::string dest_name = get_destination_name();        if ("" != dest_name) {            dest = toplevel->lookup(dest_name);            if (0 == dest) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -