Changeset 176 in pacpusframework for trunk/include
- Timestamp:
- Oct 11, 2013, 2:10:06 PM (11 years ago)
- Location:
- trunk/include/Pacpus/kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentBase.h
r161 r176 31 31 #include <QMap> 32 32 33 #include <boost/program_options/options_description.hpp> 34 #include <boost/program_options/value_semantic.hpp> 35 #include <string> 36 33 37 class QWidget; 38 39 namespace boost { 40 namespace program_options { 41 class options_description_easy_init; 42 } 43 } 34 44 35 45 namespace pacpus { … … 94 104 * @return Name of the component. 95 105 */ 96 QString name() const;97 106 QString getName() const; 98 107 … … 127 136 virtual void addOutputs() {} 128 137 138 boost::program_options::options_description_easy_init addParameters(); 139 129 140 protected: 130 141 typedef QMap<QString, InputInterfaceBase *> InputsMap; … … 177 188 178 189 const XmlComponentConfig xmlParameters() const; 190 191 protected: 192 std::string mName; 193 std::string mTypeName; 194 bool mHasGui; 195 bool mVerbose; 196 int mVerbosityLevel; 179 197 180 198 private: 199 /// Called by ComponentManager to handle parameters 200 /// @throws 201 void parseParameters(const XmlComponentConfig & cfg); 202 181 203 /// called by the ComponentManager to start the component 182 204 int startComponent(); … … 186 208 187 209 private: 210 boost::program_options::options_description mOptionsDescription; 211 188 212 /// The XML node that is got in the configureComponent method 189 213 XmlComponentConfig param; -
trunk/include/Pacpus/kernel/Log.h
r143 r176 35 35 36 36 #if defined(PACPUS_USE_LOG) 37 # include <boost/log/attributes/named_scope.hpp> 38 # include <boost/log/trivial.hpp> 39 # include <iosfwd> 37 40 38 #include <boost/log/trivial.hpp>39 #include <iosfwd>40 41 class QString; 41 42 42 template< typename CharT, typename TraitsT > 43 43 PACPUSLIB_API std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< CharT, TraitsT >& strm, QString const& s); 44 44 45 #define DECLARE_STATIC_LOGGER(name) 46 47 #define LOG(level, message) BOOST_LOG_TRIVIAL(level) << message 48 #define LOG_TRACE(message) LOG(trace, message) 49 #define LOG_DEBUG(message) LOG(debug, message) 50 #define LOG_INFO(message) LOG(info, message) 51 #define LOG_WARN(message) LOG(warning, message) 52 #define LOG_ERROR(message) LOG(error, message) 53 #define LOG_FATAL(message) LOG(fatal, message) 54 45 # define DECLARE_STATIC_LOGGER(name) //BOOST_LOG_NAMED_SCOPE(name) 46 # define PACPUS_LOG_FUNCTION() BOOST_LOG_FUNCTION() 47 # define PACPUS_LOG_NAMED_SCOPE(name) BOOST_LOG_NAMED_SCOPE(name) 48 # define PACPUS_LOG(level, message) BOOST_LOG_TRIVIAL(level) << message 55 49 #else 56 57 50 /// @param name Name of the logger, displayed when logging a message. 58 #define DECLARE_STATIC_LOGGER(name) 59 /// Logs a message at TRACE level using default logger 60 #define LOG_TRACE(message) 61 /// Logs a message at DEBUG level using default logger 62 #define LOG_DEBUG(message) 63 /// Logs a message at INFO level using default logger 64 #define LOG_INFO(message) 65 /// Logs a message at WARN level using default logger 66 #define LOG_WARN(message) 67 /// Logs a message at ERROR level using default logger 68 #define LOG_ERROR(message) 69 /// Logs a message at FATAL level using default logger 70 #define LOG_FATAL(message) 71 51 # define DECLARE_STATIC_LOGGER(name) 52 # define PACPUS_LOG_FUNCTION() ((void) 0) 53 # define PACPUS_LOG_NAMED_SCOPE(name) ((void) 0) 54 # define PACPUS_LOG(level, message) ((void) 0) 72 55 #endif // PACPUS_USE_LOG 73 56 57 /// Logs a message at TRACE level using default logger 58 #define LOG_TRACE(message) PACPUS_LOG(trace, message) 59 /// Logs a message at DEBUG level using default logger 60 #define LOG_DEBUG(message) PACPUS_LOG(debug, message) 61 /// Logs a message at INFO level using default logger 62 #define LOG_INFO(message) PACPUS_LOG(info, message) 63 /// Logs a message at WARN level using default logger 64 #define LOG_WARN(message) PACPUS_LOG(warning, message) 65 /// Logs a message at ERROR level using default logger 66 #define LOG_ERROR(message) PACPUS_LOG(error, message) 67 /// Logs a message at FATAL level using default logger 68 #define LOG_FATAL(message) PACPUS_LOG(fatal, message) 69 74 70 #endif // DEF_PACPUS_LOG_H -
trunk/include/Pacpus/kernel/XmlComponentConfig.h
r89 r176 22 22 namespace pacpus { 23 23 24 //class QDomNamedNodeMap; 24 25 class XmlConfigFile; 25 26 … … 38 39 /** Dtor of XmlComponentConfig. */ 39 40 ~XmlComponentConfig(); 41 42 QDomNamedNodeMap getProperties() const; 40 43 41 44 /** Add the property @em name to the XML and set its value to @em 0 if it does not exist. … … 94 97 95 98 // Copy internally the node in the internal QDomElement. 96 void localCopy(const QDomElement & elementToCopy);99 void localCopy(const QDomElement & elementToCopy); 97 100 98 101 QString const getComponentName() const; 99 102 QString const getComponentType() const; 100 101 103 102 104 QString const getConnectionType() const;
Note:
See TracChangeset
for help on using the changeset viewer.