Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

ScriptingAgent Class Reference

#include <ScriptingAgent.h>

Inheritance diagram for ScriptingAgent:

SCRAgent List of all members.

Public Member Functions

 ScriptingAgent ()
 ScriptingAgent (const string &file)
 ~ScriptingAgent ()
virtual YCPValue Read (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull())
virtual YCPBoolean Write (const YCPPath &path, const YCPValue &value, const YCPValue &arg=YCPNull())
virtual YCPList Dir (const YCPPath &path)
virtual YCPValue Execute (const YCPPath &path, const YCPValue &value=YCPNull(), const YCPValue &arg=YCPNull())
virtual YCPMap Error (const YCPPath &path)
YCPValue otherCommand (const YCPTerm &term)
virtual YCPBoolean RegisterAgent (const YCPPath &path, const YCPValue &value)
virtual YCPBoolean UnregisterAgent (const YCPPath &path)
virtual YCPBoolean UnregisterAllAgents ()
virtual YCPBoolean UnmountAgent (const YCPPath &path)

Private Types

typedef vector< SCRSubAgent * > SubAgents

Private Member Functions

YCPValue MountAgent (const YCPPath &path)
YCPValue MountAllAgents ()
YCPValue UnmountAllAgents ()
YCPValue executeSubagentCommand (const char *command, const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &optpar=YCPNull())
SubAgents::iterator findByPath (const YCPPath &path)
void parseConfigFiles (const string &directory)
void parseSingleConfigFile (const string &file)

Private Attributes

SubAgents agents

Member Typedef Documentation

typedef vector<SCRSubAgent*> ScriptingAgent::SubAgents [private]
 

Type and list of subagents


Constructor & Destructor Documentation

ScriptingAgent::ScriptingAgent  ) 
 

Constructor. Also scans for scr-files.

ScriptingAgent::ScriptingAgent const string &  file  ) 
 

Constructor. Load only a single SCR.

Parameters:
file SCR configuration file to be registered.

ScriptingAgent::~ScriptingAgent  ) 
 

Destructor. Also deletes subagents.


Member Function Documentation

YCPList ScriptingAgent::Dir const YCPPath path  )  [virtual]
 

Get a list of all subtrees.

Implements SCRAgent.

YCPMap ScriptingAgent::Error const YCPPath path  )  [virtual]
 

Get a detailed error description if a previous command failed

Reimplemented from SCRAgent.

YCPValue ScriptingAgent::Execute const YCPPath path,
const YCPValue value = YCPNull(),
const YCPValue arg = YCPNull()
[virtual]
 

Executes a command.

Reimplemented from SCRAgent.

YCPValue ScriptingAgent::executeSubagentCommand const char *  command,
const YCPPath path,
const YCPValue arg = YCPNull(),
const YCPValue optpar = YCPNull()
[private]
 

Calls a subagent to execute a Read, Write, Dir or other command

Parameters:
command the command like "Read", "Dir", ..
path All commands take a path as first parameter. Here you give an absolute path, for example .etc.liloconf.global. When calling the agent, this path will be made relative to the agents root. E.g. If the agent's root path would be .etc.liloconf and the command "Read", the resulting command would be Read (.global).
optional value to be given as second parameter to the call

Find the agent where the agent's path and the given path have the longest match. Example:

agent net at .etc.network agent isdn at .etc.network.isdn

The command Read (.etc.network.isdn.line0) will call agent isdn with Read (.line0). The command Read (.etc.network) will call agent net with Read (.).

ScriptingAgent::SubAgents::iterator ScriptingAgent::findByPath const YCPPath path  )  [private]
 

Find agent exactly matching path. Returns agents.end () if the path isn't covered by any agent.

YCPValue ScriptingAgent::MountAgent const YCPPath path  )  [private]
 

Mount the agent handling path. This function is called automatically when the agent is used.

YCPValue ScriptingAgent::MountAllAgents  )  [private]
 

Mount all agents.

YCPValue ScriptingAgent::otherCommand const YCPTerm term  )  [virtual]
 

Handle the commands 'UnregisterAgent', 'UnregisterAllAgents', 'MountAgent', 'MountAllAgents', 'UnmountAgent' and 'UnmountAllAgents'.

Reimplemented from SCRAgent.

void ScriptingAgent::parseConfigFiles const string &  directory  )  [private]
 

Parses the given directory and all its subdirectories for SCR configuration files and evaluates them with the SCR interpreter.

void ScriptingAgent::parseSingleConfigFile const string &  file  )  [private]
 

Parses a single SCR configuration file and evaluates them with the SCR interpreter.

YCPValue ScriptingAgent::Read const YCPPath path,
const YCPValue arg = YCPNull(),
const YCPValue opt = YCPNull()
[virtual]
 

Reads data. Destroy the result after use.

Parameters:
path Specifies what part of the subtree should be read. The path is specified _relatively_ to Root()!

Implements SCRAgent.

YCPBoolean ScriptingAgent::RegisterAgent const YCPPath path,
const YCPValue value
[virtual]
 

Register a agent, that is specify the scr path and the filename for it's definition or the term with the definition. The preferred way is to specify the filename.

Reimplemented from SCRAgent.

YCPBoolean ScriptingAgent::UnmountAgent const YCPPath path  )  [virtual]
 

Unmount the agent handling path.

Reimplemented from SCRAgent.

YCPValue ScriptingAgent::UnmountAllAgents  )  [private]
 

Unmount all agents.

YCPBoolean ScriptingAgent::UnregisterAgent const YCPPath path  )  [virtual]
 

Unregister a agent.

Reimplemented from SCRAgent.

YCPBoolean ScriptingAgent::UnregisterAllAgents  )  [virtual]
 

Unregister all agents.

Reimplemented from SCRAgent.

YCPBoolean ScriptingAgent::Write const YCPPath path,
const YCPValue value,
const YCPValue arg = YCPNull()
[virtual]
 

Writes data. Destroy the result after use.

Implements SCRAgent.


Member Data Documentation

SubAgents ScriptingAgent::agents [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:24 2007 for yast2-core by doxygen 1.3.6