This commit is contained in:
2015-05-24 01:08:07 +02:00
parent 3626b45dfc
commit 13c182c82b
49 changed files with 2675 additions and 1546 deletions
@@ -9,4 +9,9 @@
extern "C" {
#include "celix/framework.h"
#include "celix/linked_list_iterator.h"
#include "celix/bundle_activator.h"
#include "celix/bundle_context.h"
#include "celix/service_listener.h"
#include "celix/service_reference.h"
#include "celix/constants.h"
}
@@ -22,6 +22,11 @@ namespace core {
enum class CoreServiceEventType : int {
STARTUP_FINISHED = 1,
SHUTDOWN = 2
};
/**
* Base class for events emitted by the CoreService.
*/
@@ -29,12 +34,10 @@ class CoreServiceEvent {
public:
typedef std::chrono::system_clock::time_point timestamp_t;
enum class EventType : int { STARTUP_FINISHED = 1, SHUTDOWN = 2 };
const EventType eventType;
CoreServiceEventType eventType;
const timestamp_t timestamp;
CoreServiceEvent(EventType type, const timestamp_t timestamp = std::chrono::system_clock::now())
CoreServiceEvent(CoreServiceEventType type, const timestamp_t timestamp = std::chrono::system_clock::now())
: eventType(type), timestamp(timestamp) {}
};
@@ -48,7 +51,7 @@ public:
class StartupFinishedEvent
: public CoreServiceEvent {
public:
StartupFinishedEvent() : CoreServiceEvent(EventType::STARTUP_FINISHED) {}
StartupFinishedEvent() : CoreServiceEvent(CoreServiceEventType::STARTUP_FINISHED) {}
};
@@ -61,7 +64,7 @@ public:
class ShutdownEvent
: public CoreServiceEvent {
public:
ShutdownEvent() : CoreServiceEvent(EventType::SHUTDOWN) {}
ShutdownEvent() : CoreServiceEvent(CoreServiceEventType::SHUTDOWN) {}
};
@@ -22,7 +22,9 @@ template<> const int implementation::ServiceInfo<CoreServiceImpl>::minor = 0;
CoreServiceImpl::CoreServiceImpl(ros::NodeHandle& publicNodeHandle, ros::NodeHandle& privateNodeHandle)
: publicNodeHandle(publicNodeHandle), privateNodeHandle(privateNodeHandle) {}
: publicNodeHandle(publicNodeHandle), privateNodeHandle(privateNodeHandle) {
schemaLoader.reset(new utils::SchemaLoader());
}
@@ -33,43 +33,20 @@ private:
public:
/**
* Constructor.
*/
CoreServiceImpl(ros::NodeHandle& publicNodeHandle, ros::NodeHandle& privateNodeHandle);
////////////////////////////////////////////////////////////
////////////// Public Service Implementations //////////////
////////////////////////////////////////////////////////////
/* Public Service Implementations */
/**
* Returns a reference to a node handle with public namespace.
*
* \return public node handle
*/
virtual ros::NodeHandle& getPublicNodeHandle() override {
return publicNodeHandle;
}
/**
* Returns a reference to a node handle with private namespace.
*
* \return private node handle
*/
virtual ros::NodeHandle& getPrivateNodeHandle() override {
return privateNodeHandle;
}
/**
* Request an application shutdown
*/
virtual void requestShutdown() override;
/**
* Returns a reference to the schema loader.
*
* \return schema loader.
*/
virtual utils::SchemaLoader& getSchemaLoader() override {
return *schemaLoader;
}
+1 -1
View File
@@ -9,7 +9,7 @@
// Boost
#include <boost/format.hpp>
// ROS
#include "ros/ros.h"
#include <ros/ros.h>
// APR
#include <apr_general.h>
#include <apr_strings.h>