iFun Engine API  1.0.0-b2821
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
component.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2015 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_FRAMEWORK_COMPONENT_H_
10 #define INCLUDE_FUNAPI_FRAMEWORK_COMPONENT_H_
11 
12 #include <boost/noncopyable.hpp>
14 
15 
16 namespace fun {
17 
19 class Component : public boost::noncopyable {
20  public:
21  static const ArgumentMap *FindArgument(const string &component_name);
22 
23  private:
24  Component() {}
25 };
26 
27 } // namespace fun
28 
29 
31 #define REGISTER_COMPONENT(COMPONENT_NAME, INSTALLER_CLS) \
32 \
33 extern "C" bool COMPONENT_NAME ## _install( \
34  const fun::ArgumentMap &arguments) { \
35  return INSTALLER_CLS::Install(arguments); \
36 } \
37 \
38 extern "C" bool COMPONENT_NAME ## _uninstall() { \
39  return INSTALLER_CLS::Uninstall(); \
40 } \
41 
42 
44 #define REGISTER_STARTABLE_COMPONENT(COMPONENT_NAME, INSTALLER_CLS) \
45  REGISTER_COMPONENT(COMPONENT_NAME, INSTALLER_CLS) \
46  \
47  extern "C" bool COMPONENT_NAME ## _start() { \
48  return INSTALLER_CLS::Start(); \
49  } \
50 
51 
52 #define REGISTER_STARTABLE_COMPONENT2(COMPONENT_NAME, INSTALLER_CLS) \
53  REGISTER_STARTABLE_COMPONENT(COMPONENT_NAME, INSTALLER_CLS) \
54  \
55  extern "C" bool COMPONENT_NAME ## _stop() { \
56  return INSTALLER_CLS::Stop(); \
57  } \
58 
59 
60 #endif // INCLUDE_FUNAPI_FRAMEWORK_COMPONENT_H_
ArgumentMap class manages application-specific run-time arguments.
Definition: argument_map.h:23
Base class for any service in Funapi.
Definition: component.h:19