yast2-core
Y2SystemNamespace.h
Go to the documentation of this file.
1 /*------------------------------------------------------------*- c++ -*-\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \-----------------------------------------------------------------------/
12 
13  File: Y2SystemNamespace.h
14  System namespace provide any module if it is prefixed by System like
15  System::Bootloader_API. System namespace allows to call module remotes.
16  It is useful when module do not use SCR for system access and touch it
17  directly like LiMal library. Remote or local usage is based on SCR
18  builtin calls.
19  See: Y2StdioFunction to see how remote call is done.
20 
21  Author: Stanislav Visnovsky <visnov@suse.cz>
22  Maintainer: Stanislav Visnovsky <visnov@suse.cz>
23 
24 /-*/
25 
26 #ifndef Y2SystemNamespace_h
27 #define Y2SystemNamespace_h
28 
29 #include <y2/Y2Namespace.h>
30 #include <y2/Y2Function.h>
31 
32 class Y2ProgramComponent;
33 class Y2SystemFunction;
34 
36 
40 
41  vector<Y2SystemFunction*> m_functions;
42 
43  string m_name;
44 
46 
47  friend class Y2SystemFunction;
48 
49 public:
50  Y2SystemNamespace (Y2Namespace* local_ns);
51 
52  virtual ~Y2SystemNamespace();
53 
55  virtual const string name () const;
56 
57  virtual const string filename () const;
58 
59  virtual YCPValue evaluate(bool);
60 
70  virtual Y2Function* createFunctionCall (const string name, constFunctionTypePtr type);
71 
72  void useRemote (Y2ProgramComponent* sender);
73 
74  void useLocal ();
75 };
76 
77 
78 #endif // Y2SystemNamespace_h
void unregisterFunction(Y2SystemFunction *f)
Definition: Y2SystemNamespace.cc:153
virtual Y2Function * createFunctionCall(const string name, constFunctionTypePtr type)
Definition: Y2SystemNamespace.cc:84
void useRemote(Y2ProgramComponent *sender)
Definition: Y2SystemNamespace.cc:118
virtual ~Y2SystemNamespace()
Definition: Y2SystemNamespace.cc:54
constFunctionTypePtr type() const
Definition: Y2SystemFunction.cc:158
void useLocal()
Definition: Y2SystemNamespace.cc:139
Definition: Y2ProgramComponent.h:31
Y2ProgramComponent * m_remote_sender
Definition: Y2SystemNamespace.h:38
Y2Namespace * m_local_ns
Definition: Y2SystemNamespace.h:37
string m_name
Definition: Y2SystemNamespace.h:43
bool m_use_remote
Definition: Y2SystemNamespace.h:39
Y2SystemNamespace(Y2Namespace *local_ns)
Definition: Y2SystemNamespace.cc:41
virtual const string filename() const
used for error reporting
Definition: Y2SystemNamespace.cc:68
virtual YCPValue evaluate(bool)
called when evaluating the import statement
Definition: Y2SystemNamespace.cc:74
Definition: Y2SystemNamespace.h:35
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
Definition: Y2Namespace.h:43
virtual const string name() const
what namespace do we implement
Definition: Y2SystemNamespace.cc:62
Definition: Y2SystemFunction.h:30
Definition: Y2Function.h:71
vector< Y2SystemFunction * > m_functions
Definition: Y2SystemNamespace.h:41

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