| Config::Model::Instance - Instance of configuration tree |
name()config_root()config_model()pop_no_value_check()
Config::Model::Instance - Instance of configuration tree
my $model = Config::Model->new() ; $model ->create_config_class ( ... ) ;
my $inst = $model->instance (root_class_name => 'SomeRootClass', instance_name => 'some_name');
This module provides an object that holds a configuration tree.
Usually, an instance object is created by calling instance method on an existing model:
my $inst = $model->instance (root_class_name => 'SomeRootClass', instance_name => 'test1');
Usually, directory (or directories) holding configuration files is specified within the configuration model. For test purpose you can specify this directory with any of these parameters :
Where to read the configuration files
Where to write back the configuration files
Where to read and write configuration files
Note that all directory specified within the configuration model
will be overridden.
If you need to load configuration data that are not correct, you can
use force_load => 1. Then, wrong data will be discarded.
name()Returns the instance name.
config_root()Returns the root object of the configuration tree.
Destroy current configuration tree (with data) and returns a new tree with data loaded from disk.
config_model()Returns the model of the configuration tree.
All values stored in preset mode are shown to the user as default values. This feature is usefull to enter configuration data entered by an automatic process (like hardware scan)
Stop preset mode
Get preset mode
Tune Config::Model::Value to perform check on read (fetch) or write
(store) or verify the value according to its value_type. The
passed parameters are stacked. Parameters are :
Skip write check.
Skip read check.
Skip value_type check (See the Config::Model::Value manpage for details). I.e the Config::Model::Value manpage will not enforce type checking.
Note that these values are stacked. They can be read by get_value_check until the next push_no_value_check or pop_no_value_check call.
Example:
$i->push_no_value_check('fetch') ; $i->push_no_value_check('fetch','type') ;
pop_no_value_check()Pop off the check stack the last check set entered with
push_no_value_check.
Read the check status. Returns 1 if a check is to be done. O if not.
When used with the fetch_or_store parameter, returns a logical or
or the check values, i.e. read_check || write_check
The data method provide a way to store some arbitrary data in the instance object.
Load configuration tree with configuration data. See the Config::Model::Loader manpage for more details
Returns an object dedicated to search an element in the configuration model (respecting privilege level).
This method returns a the Config::Model::Searcher manpage object. See the Config::Model::Searcher manpage for details on how to handle a search.
This method returns a the Config::Model::WizardHelper manpage object. See the Config::Model::WizardHelper manpage for details on how to create a wizard widget with this object.
wizard_helper arguments are explained in the Config::Model::WizardHelper manpage constructor arguments.
Usually, a program based on config model must first create the configuration model, then load all configuration data.
This feature enables you to declare with the model a way to load configuration data (and to write it back). See the Config::Model::AutoRead manpage for details.
read_directory()Returns directory where configuration data is read from.
write_directory()Returns directory where configuration data is written to.
Register a sub ref that will be called with write_back method.
Run all subroutines registered with register_write_back to write
the configuration informations. (See the Config::Model::AutoRead manpage for
details).
You can specify a directory to override the default directory provided by the configuration model.
Dominique Dumont, (ddumont at cpan dot org)
the Config::Model manpage, the Config::Model::Node manpage, the Config::Model::Loader manpage, the Config::Model::Searcher manpage, the Config::Model::Value manpage,
| Config::Model::Instance - Instance of configuration tree |