yast2-core
ProcessAgent.h
Go to the documentation of this file.
1 /* ProcessAgent.h
2  *
3  * ------------------------------------------------------------------------------
4  * Copyright (c) 2008 Novell, Inc. All Rights Reserved.
5  *
6  *
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the
9  * Free Software Foundation; either version 2 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, contact Novell, Inc.
18  *
19  * To contact Novell about this file by physical or electronic mail, you may find
20  * current contact information at www.novell.com.
21  * ------------------------------------------------------------------------------
22  *
23  * An agent for managing multiple processes.
24  *
25  * Authors: Ladislav Slezák <lslezak@novell.com>
26  *
27  * $Id: ProcessAgent.h 27914 2006-02-13 14:32:08Z locilka $
28  */
29 
30 #ifndef _ProcessAgent_h
31 #define _ProcessAgent_h
32 
33 #include <Y2.h>
34 #include <scr/SCRAgent.h>
35 
36 #include <map>
37 
38 class Process;
39 
43 class ProcessAgent : public SCRAgent
44 {
45 private:
50  // typedef of internal data representation
51  typedef map<pid_t, Process*> ProcessContainer;
52 
53  ProcessContainer _processes;
54 
55 private:
56 
57  YCPValue ProcessOutput(std::string &output);
58 
59 public:
63  ProcessAgent();
64 
68  virtual ~ProcessAgent();
69 
75  virtual YCPValue Read(const YCPPath &path,
76  const YCPValue& arg = YCPNull(),
77  const YCPValue& opt = YCPNull());
78 
82  virtual YCPBoolean Write(const YCPPath &path,
83  const YCPValue& value,
84  const YCPValue& arg = YCPNull());
85 
89  virtual YCPValue Execute(const YCPPath &path,
90  const YCPValue& value = YCPNull(),
91  const YCPValue& arg = YCPNull());
92 
96  virtual YCPList Dir(const YCPPath& path);
97 
101  virtual YCPValue otherCommand(const YCPTerm& term);
102 };
103 
104 #endif /* _ProcessAgent_h */
virtual YCPBoolean Write(const YCPPath &path, const YCPValue &value, const YCPValue &arg=YCPNull())
virtual YCPValue Read(const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull())
void output(const std::string &s, int fd)
Definition: tty_wrapper.cc:78
An interface class between YaST2 and Process Agent.
Definition: ProcessAgent.h:43
YCPValue ProcessOutput(std::string &output)
Definition: ProcessAgent.cc:85
virtual YCPValue otherCommand(const YCPTerm &term)
Definition: ProcessAgent.cc:551
virtual ~ProcessAgent()
Definition: ProcessAgent.cc:45
SuSE Configuration Repository Agent.
Definition: SCRAgent.h:37
map< pid_t, Process * > ProcessContainer
Definition: ProcessAgent.h:51
Wrapper for YCPListRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPListRep with the arrow operator. See YCPListRep.
Definition: YCPList.h:236
virtual YCPValue Execute(const YCPPath &path, const YCPValue &value=YCPNull(), const YCPValue &arg=YCPNull())
Wrapper for YCPTermRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPTermRep with the arrow operator. See YCPTermRep.
Definition: YCPTerm.h:177
Wrapper for YCPValueRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPValueRep with the arrow operator. See YCPValueRep.
Definition: YCPValue.h:275
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
Definition: Process.h:42
Wrapper for YCPPathRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPPathRep with the arrow operator. See YCPPathRep.
Definition: YCPPath.h:175
virtual YCPList Dir(const YCPPath &path)
ProcessContainer _processes
Definition: ProcessAgent.h:53
ProcessAgent()
Definition: ProcessAgent.cc:38
Wrapper for YCPBooleanRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPBooleanRep with the arrow operator. See YCPBooleanRep.
Definition: YCPBoolean.h:93
Definition: YCPElement.h:125

Generated on a sunny day for yast2-core by doxygen 1.8.8