📄 cdl.hxx
字号:
// some suitable means. The error fnptr may throw a // CdlParseException to abort the current load immediately, // otherwise the load operation will be aborted at the end // if any errors were detected. New conflicts are not // handled by these diagnostic functions, instead they // are handled by the normal transaction methods. // A version argument of "" implies the most recent version. void load_package(std::string /* name */, std::string /* version */, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void load_package(CdlTransaction, std::string /* name */, std::string /* version */, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void unload_package(std::string /* name */, bool /* limbo */ = true); void unload_package(CdlPackage, bool /* limbo */ = true); void unload_package(CdlTransaction, std::string /* name */, bool /* limbo */ = true); void unload_package(CdlTransaction, CdlPackage, bool /* limbo */ = true); void change_package_version(std::string /*name*/, std::string /*version*/, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void change_package_version(CdlPackage, std::string /*version*/, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void change_package_version(CdlTransaction, std::string /*name*/, std::string /*version*/, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void change_package_version(CdlTransaction, CdlPackage, std::string /*version*/, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); // Loading a savefile is different in that it creates a new // toplevel. Since transactions can only be created if the // toplevel already exists, it is not possible to have a // per-transaction load() operation. It is possible to have // a per-transaction add() operation. static CdlConfiguration load(std::string /* filename */, CdlPackagesDatabase, CdlInterpreter, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void add(std::string /* filename */, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void add(CdlTransaction, std::string /* filename */, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); // As with packages, a version of "" implies the most recent. void set_template(std::string, std::string /* version */, CdlDiagnosticFnPtr, CdlDiagnosticFnPtr /* warn */,bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void set_template_file(std::string, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void set_template(CdlTransaction, std::string, std::string /* version */, CdlDiagnosticFnPtr, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void set_template_file(CdlTransaction, std::string, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void unload_template(bool /* limbo */ = true); void unload_template(CdlTransaction, bool /* limbo */ = true); std::string get_template() const; void set_template_name(std::string); // Intended for library use only void set_hardware(std::string, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void set_hardware(CdlTransaction, std::string, CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true) throw(CdlInputOutputException, CdlParseException, std::bad_alloc); void unload_hardware(bool /* limbo */ = true); void unload_hardware(CdlTransaction, bool /* limbo */ = true); std::string get_hardware() const; void set_hardware_name(std::string); // Intended for library use only // ---------------------------------------------------------------------------- // Save a configuration to a file void save(std::string, bool /* minimal */ = false) throw(CdlInputOutputException,std::bad_alloc); void initialize_savefile_support(); std::string get_save_file() const; // ---------------------------------------------------------------------------- // Get rid of a configuration. ~CdlConfigurationBody(); virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; CYGDBG_DECLARE_MEMLEAK_COUNTER(); private: // The only legal constructor, invoked from make() and load() CdlConfigurationBody(std::string, CdlPackagesDatabase, CdlInterpreter); // The internal implementation of the persistence support virtual void save(CdlInterpreter, Tcl_Channel, int, bool) throw(CdlInputOutputException, std::bad_alloc); static int savefile_configuration_command(CdlInterpreter, int, char**); static int savefile_description_command(CdlInterpreter, int, char**); static int savefile_hardware_command(CdlInterpreter, int, char**); static int savefile_template_command(CdlInterpreter, int, char**); static int savefile_package_command(CdlInterpreter, int, char**); std::string current_hardware; std::string current_template; std::string description; CdlPackagesDatabase database; std::string save_file; enum { CdlConfigurationBody_Invalid = 0, CdlConfigurationBody_Magic = 0x5c409a3d } cdlconfigurationbody_cookie; // The constructor can only be invoked via the make() and load() // members. Other constructors and the assignment operator are // illegal. CdlConfigurationBody(); CdlConfigurationBody(const CdlConfigurationBody&); CdlConfigurationBody& operator=(const CdlConfigurationBody&); };//}}}//{{{ CdlPackage class // ----------------------------------------------------------------------------// Packages inherit from most of the base classes.class CdlPackageBody : public virtual CdlNodeBody, public virtual CdlContainerBody, public virtual CdlUserVisibleBody, public virtual CdlValuableBody, public virtual CdlParentableBody, public virtual CdlBuildableBody, public virtual CdlDefinableBody, public virtual CdlLoadableBody, public virtual CdlBuildLoadableBody, public virtual CdlDefineLoadableBody{ friend class CdlTest; // Packages should not be created by application code, but // the CdlConfiguration class must be able to do so inside // load_package(); friend class CdlConfigurationBody; public: ~CdlPackageBody(); static int parse_package(CdlInterpreter, int, char**); static int parse_hardware(CdlInterpreter, int, char**); static int parse_install_proc(CdlInterpreter, int, char**); static int parse_license_proc(CdlInterpreter, int, char**); // Override the CdlDefineLoadable member. Hardware packages always // send their configuration options to hardware.h virtual std::string get_config_header() const; bool is_hardware_package() const; bool has_install_proc() const; const cdl_tcl_code& get_install_proc() const; bool has_license_proc() const; const cdl_tcl_code& get_license_proc() const; // Propagation support. Because of multiple virtual inheritance // it is necessary to invoke the container and valuable // update members. virtual void update(CdlTransaction, CdlUpdate); // Persistence support. virtual void save(CdlInterpreter, Tcl_Channel, int, bool) throw(CdlInputOutputException, std::bad_alloc); static void initialize_savefile_support(CdlToplevel); static int savefile_package_command(CdlInterpreter, int, char**); // Was this package loaded because of a template or hardware setting? bool belongs_to_template() const; bool belongs_to_hardware() const; virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; CYGDBG_DECLARE_MEMLEAK_COUNTER(); private: // The only valid constructor requires a number of fields CdlPackageBody(std::string /* name */, CdlConfiguration, std::string /* directory */); // Other constructors are illegal CdlPackageBody(); CdlPackageBody(const CdlPackageBody&); CdlPackageBody& operator=(const CdlPackageBody&); bool loaded_for_template; bool loaded_for_hardware; enum { CdlPackageBody_Invalid = 0, CdlPackageBody_Magic = 0x1d7c0d43 } cdlpackagebody_cookie;};//}}}//{{{ CdlComponent class // ----------------------------------------------------------------------------// Similarly components just inherit from the appropriate base classes.class CdlComponentBody : public virtual CdlNodeBody, public virtual CdlContainerBody, public virtual CdlUserVisibleBody, public virtual CdlValuableBody, public virtual CdlParentableBody, public virtual CdlBuildableBody, public virtual CdlDefinableBody{ friend class CdlTest; public: ~CdlComponentBody(); static int parse_component(CdlInterpreter, int, char**); static int parse_script(CdlInterpreter, int, char**); // Propagation support. Because of multiple virtual inheritance // it is necessary to invoke the container and valuable // update members. virtual void update(CdlTransaction, CdlUpdate); // Persistence support. virtual void save(CdlInterpreter, Tcl_Channel, int, bool) throw(CdlInputOutputException, std::bad_alloc); static void initialize_savefile_support(CdlToplevel); static int savefile_component_command(CdlInterpreter, int, char**); virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; CYGDBG_DECLARE_MEMLEAK_COUNTER(); private: // The only valid constructor requires a name. CdlComponentBody(std::string); enum { CdlComponentBody_Invalid = 0, CdlComponentBody_Magic = 0x6359d9a7 } cdlcomponentbody_cookie; // Other constructors are illegal CdlComponentBody(); CdlComponentBody(const CdlComponentBody&); CdlComponentBody& operator=(const CdlComponentBody&);};//}}}//{{{ CdlOption class // ----------------------------------------------------------------------------// Again options just inherit their functionality from the base classes.class CdlOptionBody : public virtual CdlNodeBody, public virtual CdlUserVisibleBody, public virtual CdlValuableBody, public virtual CdlParentableBody, public virtual CdlBuildableBody, public virtual CdlDefinableBody{ friend class CdlTest; public: ~CdlOptionBody(); static int parse_option(CdlInterpreter, int, char**); // Persistence support. virtual void save(CdlInterpreter, Tcl_Channel, int, bool) throw(CdlInputOutputException, std::bad_alloc); static void initialize_savefile_support(CdlToplevel); static int savefile_option_command(CdlInterpreter, int, char**); virtual std::string get_class_name() const; bool check_this(cyg_assert_class_zeal = cyg_quick) const; CYGDBG_DECLARE_MEMLEAK_COUNTER(); private: CdlOptionBody(std::string); enum { CdlOptionBody_Invalid = 0, CdlOptionBody_Magic = 0x1c1162d1 } cdloptionbody_cookie; CdlOptionBody(); CdlOptionBody(const CdlOptionBody&); CdlOptionBody& operator=(const CdlOptionBody&);};//}}}#endif /* !__CDL_HXX */// EOF cdl.hxx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -