yast2-profile-manager
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SCPMAgent Class Reference

An interface class between YaST2 and SCPM Agent. More...

#include <SCPMAgent.h>

Inheritance diagram for SCPMAgent:
SCRAgent

Public Member Functions

 SCPMAgent ()
 
virtual ~SCPMAgent ()
 
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 YCPValue Execute (const YCPPath &path, const YCPValue &value=YCPNull(), const YCPValue &arg=YCPNull())
 
virtual YCPList Dir (const YCPPath &path)
 
virtual YCPValue otherCommand (const YCPTerm &term)
 
- Public Member Functions inherited from SCRAgent
 SCRAgent ()
 
virtual ~SCRAgent ()
 
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 ()
 
void setAsCurrentSCR ()
 

Private Member Functions

resource_group_t frommap_rg (YCPMap map)
 
YCPMap tomap_rg (resource_group_t rgroup)
 
vector< resource_entry_t > fromlist_re (YCPList list)
 
resource_entry_t frommap_re (YCPMap map)
 
YCPMap tomap_re (resource_entry_t rentry)
 

Static Private Member Functions

static void * call_enable (SCPMAgent *)
 
static void * call_recover (SCPMAgent *)
 
static void * call_rollback (SCPMAgent *)
 

Private Attributes

SCPM * scpm
 
int options
 
ofstream output
 
ofstream hash
 
string changesfile
 
string tmpfile
 
string hashfile
 
pthread_t pt
 
bool initialized
 

Additional Inherited Members

- Static Public Member Functions inherited from SCRAgent
static YCPValue readconf (const char *filename)
 
static SCRAgentinstance ()
 
- Public Attributes inherited from SCRAgent
SCRAgentmainscragent
 

Detailed Description

An interface class between YaST2 and SCPM Agent.

Constructor & Destructor Documentation

SCPMAgent::SCPMAgent ( )

Default constructor.

Constructor

References initialized, options, and scpm.

SCPMAgent::~SCPMAgent ( )
virtual

Destructor.

Destructor

Member Function Documentation

void * SCPMAgent::call_enable ( SCPMAgent ag)
staticprivate

Call SCPM->Enable in the new thread

References scpm, and y2error.

Referenced by Execute().

void * SCPMAgent::call_recover ( SCPMAgent ag)
staticprivate

Call SCPM->Recover in the new thread

References scpm, and y2error.

Referenced by Execute().

void * SCPMAgent::call_rollback ( SCPMAgent ag)
staticprivate

Call SCPM->Recover (true) in the new thread

References scpm, and y2error.

Referenced by Execute().

YCPList SCPMAgent::Dir ( const YCPPath path)
virtual

Provides SCR Dir ().

Dir

Implements SCRAgent.

References y2error.

YCPValue SCPMAgent::Execute ( const YCPPath path,
const YCPValue value = YCPNull(),
const YCPValue arg = YCPNull() 
)
virtual

Provides SCR Execute ().

Execute(.scpm) must be run first to initialize

Reimplemented from SCRAgent.

References call_enable(), call_recover(), call_rollback(), changesfile, hash, hashfile, initialized, YCPValue::isNull(), options, output, PC, pt, scpm, tmpfile, y2debug, and y2error.

vector< resource_entry_t > SCPMAgent::fromlist_re ( YCPList  list)
private

Converts YCP list of maps to c++ vector of resource_entry_t structures

converts ycp list of maps to c++ vector of resource_entry_t structures

References frommap_re(), YCPList::size(), and YCPList::value().

Referenced by Write().

resource_entry_t SCPMAgent::frommap_re ( YCPMap  map)
private

Converts YCP map to c++ structure of type resource_entry_t

converts ycp map to c++ structure of type resource_entry_t

References YCPMap::value().

Referenced by fromlist_re().

resource_group_t SCPMAgent::frommap_rg ( YCPMap  map)
private

Converts YCP map to c++ structure of type resource_group_t

converts ycp map to c++ structure of type resource_group_t

References YCPMap::value().

YCPValue SCPMAgent::otherCommand ( const YCPTerm term)
virtual

Used for mounting the agent.

otherCommand

Reimplemented from SCRAgent.

References YCPTerm::name().

YCPValue SCPMAgent::Read ( const YCPPath path,
const YCPValue arg = YCPNull(),
const YCPValue opt = YCPNull() 
)
virtual

Provides SCR Read ().

Parameters
pathPath that should be read.
argAdditional parameter.

Read

Implements SCRAgent.

References YCPMap::add(), YCPList::add(), initialized, YCPValue::isNull(), PC, pt, scpm, tomap_re(), tomap_rg(), y2debug, and y2error.

YCPMap SCPMAgent::tomap_re ( resource_entry_t  rentry)
private

Converts c++ structure of type resource_entry_t to YCP map

converts c++ structure of type resource_entry_t to ycp map

References YCPMap::add().

Referenced by Read().

YCPMap SCPMAgent::tomap_rg ( resource_group_t  rgroup)
private

Converts c++ structure of type resource_group_t to YCP map

converts c++ structure of type resource_group_t to ycp map

References YCPMap::add().

Referenced by Read().

YCPBoolean SCPMAgent::Write ( const YCPPath path,
const YCPValue value,
const YCPValue arg = YCPNull() 
)
virtual

Provides SCR Write ().

Write(.scpm, nil) mast be run finally

Implements SCRAgent.

References fromlist_re(), hash, initialized, YCPValue::isNull(), output, PC, scpm, y2debug, and y2error.

Member Data Documentation

string SCPMAgent::changesfile
private

Referenced by Execute().

ofstream SCPMAgent::hash
private

Referenced by Execute(), and Write().

string SCPMAgent::hashfile
private

Referenced by Execute().

bool SCPMAgent::initialized
private

Forbid any scpm calls, when not initialized (Execute(.scpm)).

Referenced by Execute(), Read(), SCPMAgent(), and Write().

int SCPMAgent::options
private

Referenced by Execute(), and SCPMAgent().

ofstream SCPMAgent::output
private

Referenced by Execute(), and Write().

pthread_t SCPMAgent::pt
private

Referenced by Execute(), and Read().

SCPM* SCPMAgent::scpm
private
string SCPMAgent::tmpfile
private

Referenced by Execute().


The documentation for this class was generated from the following files:

Generated on a sunny day for yast2-profile-manager by doxygen 1.8.2