00001 /* ProcessAgent.h 00002 * 00003 * ------------------------------------------------------------------------------ 00004 * Copyright (c) 2008 Novell, Inc. All Rights Reserved. 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or modify it under 00008 * the terms of the GNU General Public License as published by the 00009 * Free Software Foundation; either version 2 of the License, or (at your 00010 * option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, but WITHOUT 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00014 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along with 00017 * this program; if not, contact Novell, Inc. 00018 * 00019 * To contact Novell about this file by physical or electronic mail, you may find 00020 * current contact information at www.novell.com. 00021 * ------------------------------------------------------------------------------ 00022 * 00023 * An agent for managing multiple processes. 00024 * 00025 * Authors: Ladislav Slezák <lslezak@novell.com> 00026 * 00027 * $Id: ProcessAgent.h 27914 2006-02-13 14:32:08Z locilka $ 00028 */ 00029 00030 #ifndef _ProcessAgent_h 00031 #define _ProcessAgent_h 00032 00033 #include <Y2.h> 00034 #include <scr/SCRAgent.h> 00035 00036 #include <map> 00037 00038 class Process; 00039 00043 class ProcessAgent : public SCRAgent 00044 { 00045 private: 00050 // typedef of internal data representation 00051 typedef map<pid_t, Process*> ProcessContainer; 00052 00053 ProcessContainer _processes; 00054 00055 private: 00056 00057 YCPValue ProcessOutput(std::string &output); 00058 00059 public: 00063 ProcessAgent(); 00064 00068 virtual ~ProcessAgent(); 00069 00075 virtual YCPValue Read(const YCPPath &path, 00076 const YCPValue& arg = YCPNull(), 00077 const YCPValue& opt = YCPNull()); 00078 00082 virtual YCPBoolean Write(const YCPPath &path, 00083 const YCPValue& value, 00084 const YCPValue& arg = YCPNull()); 00085 00089 virtual YCPValue Execute(const YCPPath &path, 00090 const YCPValue& value = YCPNull(), 00091 const YCPValue& arg = YCPNull()); 00092 00096 virtual YCPList Dir(const YCPPath& path); 00097 00101 virtual YCPValue otherCommand(const YCPTerm& term); 00102 }; 00103 00104 #endif /* _ProcessAgent_h */
1.5.6