SuSE Configuration Repository Agent. More...
#include <SCRAgent.h>
Public Member Functions | |
SCRAgent () | |
virtual | ~SCRAgent () |
virtual YCPValue | Read (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull())=0 |
virtual YCPBoolean | Write (const YCPPath &path, const YCPValue &value, const YCPValue &arg=YCPNull())=0 |
virtual YCPList | Dir (const YCPPath &path)=0 |
virtual YCPValue | Execute (const YCPPath &path, const YCPValue &=YCPNull(), const YCPValue &=YCPNull()) |
virtual YCPMap | Error (const YCPPath &) |
virtual YCPBoolean | RegisterAgent (const YCPPath &path, const YCPValue &) |
virtual YCPBoolean | UnregisterAgent (const YCPPath &path) |
virtual YCPBoolean | UnregisterAllAgents () |
virtual YCPBoolean | UnmountAgent (const YCPPath &) |
virtual YCPBoolean | RegisterNewAgents () |
virtual YCPValue | otherCommand (const YCPTerm &term) |
void | setAsCurrentSCR () |
Static Public Member Functions | |
static YCPValue | readconf (const char *filename) |
static SCRAgent * | instance () |
Public Attributes | |
SCRAgent * | mainscragent |
Static Private Attributes | |
static SCRAgent * | current_scr = 0 |
static YCPMap | unspecified_error |
returned by Error |
SuSE Configuration Repository Agent.
An SCRAgent is an information agent. It handles a subtree of the whole SRC data tree of the system. You can look upon it as a database that is similar to a filesystem. Data is grouped in a tree. But type of the data being stored are not files but YCP values.
SCRAgent::SCRAgent | ( | ) |
Initializes the base class.
References YCPMap::add(), current_scr, YCPMap::size(), and unspecified_error.
SCRAgent::~SCRAgent | ( | ) | [virtual] |
Cleans up. Furthermore baseclass must have a virtual destructor.
References current_scr.
Get a list of all subtrees.
Implemented in AnyAgent, DummyAgent, IniAgent, ModulesAgent, ProcessAgent, ResolverAgent, SystemAgent, ScriptingAgent, and StdioSCRAgent.
Referenced by SCRDir().
Get a detailed error description if a previous command failed
Reimplemented in ScriptingAgent, and StdioSCRAgent.
References unspecified_error.
Referenced by SCRError().
virtual YCPValue SCRAgent::Execute | ( | const YCPPath & | path, | |
const YCPValue & | = YCPNull() , |
|||
const YCPValue & | = YCPNull() | |||
) | [inline, virtual] |
Execute a command
Reimplemented in DummyAgent, ProcessAgent, SystemAgent, ScriptingAgent, and StdioSCRAgent.
References toString(), and ycp2error.
Referenced by Y2WFMComponent::Execute(), SCRExecute(), SCRExecute2(), and SCRExecute3().
SCRAgent * SCRAgent::instance | ( | ) | [static] |
References current_scr.
Referenced by SCRDir(), SCRError(), SCRExecute(), SCRExecute2(), SCRExecute3(), SCRRead3(), SCRRegisterAgentS(), SCRRegisterAgentT(), SCRRegisterNewAgents(), SCRUnmountAgent(), SCRUnregisterAgent(), SCRUnregisterAllAgents(), SCRWrite2(), and SCRWrite3().
Execute other commands. Return 0 if the command is not defined in your Agent.
Reimplemented in AnyAgent, DummyAgent, IniAgent, ModulesAgent, ProcessAgent, ResolverAgent, ScriptingAgent, and StdioSCRAgent.
Referenced by run_agent_instance().
virtual YCPValue SCRAgent::Read | ( | const YCPPath & | path, | |
const YCPValue & | arg = YCPNull() , |
|||
const YCPValue & | opt = YCPNull() | |||
) | [pure virtual] |
Reads data. Destroy the result after use.
path | Specifies what part of the subtree should be read. The path is specified _relatively_ to Root()! |
Implemented in AnyAgent, DummyAgent, IniAgent, ModulesAgent, ProcessAgent, ResolverAgent, SystemAgent, ScriptingAgent, and StdioSCRAgent.
Referenced by Y2WFMComponent::Read(), Y2AgentComp< Agent >::Read(), and SCRRead3().
YCPValue SCRAgent::readconf | ( | const char * | filename | ) | [static] |
Reads the scr config file and returns the term. It skips all lines upto (including) the first starting with a ".", which is the path where the agant gets mounted (by the ScriptingAgent).
References Parser::parse(), parser, y2debug, ycp2error, and YCode::yeTerm.
Referenced by SCRSubAgent::mount(), and run_agent_instance().
virtual YCPBoolean SCRAgent::RegisterAgent | ( | const YCPPath & | path, | |
const YCPValue & | ||||
) | [inline, virtual] |
Register an agent
Reimplemented in ScriptingAgent, and StdioSCRAgent.
References toString(), and ycp2error.
Referenced by SCRRegisterAgentS(), and SCRRegisterAgentT().
virtual YCPBoolean SCRAgent::RegisterNewAgents | ( | ) | [inline, virtual] |
Register new agents
Reimplemented in ScriptingAgent.
References ycp2error.
Referenced by SCRRegisterNewAgents().
void SCRAgent::setAsCurrentSCR | ( | ) | [inline] |
References current_scr.
Referenced by Y2WFMComponent::createDefaultSCR().
virtual YCPBoolean SCRAgent::UnmountAgent | ( | const YCPPath & | ) | [inline, virtual] |
virtual YCPBoolean SCRAgent::UnregisterAgent | ( | const YCPPath & | path | ) | [inline, virtual] |
Unregister an agent
Reimplemented in ScriptingAgent, and StdioSCRAgent.
References toString(), and ycp2error.
Referenced by SCRUnregisterAgent().
virtual YCPBoolean SCRAgent::UnregisterAllAgents | ( | ) | [inline, virtual] |
Unregister all agents
Reimplemented in ScriptingAgent.
References ycp2error.
Referenced by SCRUnregisterAllAgents().
virtual YCPBoolean SCRAgent::Write | ( | const YCPPath & | path, | |
const YCPValue & | value, | |||
const YCPValue & | arg = YCPNull() | |||
) | [pure virtual] |
Writes data. Destroy the result after use.
Implemented in AnyAgent, DummyAgent, IniAgent, ModulesAgent, ProcessAgent, ResolverAgent, SystemAgent, ScriptingAgent, and StdioSCRAgent.
Referenced by SCRWrite2(), SCRWrite3(), and Y2WFMComponent::Write().
SCRAgent * SCRAgent::current_scr = 0 [static, private] |
Referenced by instance(), SCRAgent(), setAsCurrentSCR(), and ~SCRAgent().
A pointer to the SCRAgent (which normally is the ScriptingAgent) that created this SCRAgent. It can be used to call other SCRAgents directly from C++. You must check if it is not 0.
Referenced by SCRSubAgent::mount().
YCPMap SCRAgent::unspecified_error [static, private] |
returned by Error
Referenced by Error(), and SCRAgent().