forked from pz4kybsvg/Conception
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1010 B
54 lines
1010 B
2 years ago
|
/**
|
||
|
* feature.h
|
||
|
* Feature means a set of functions of robot
|
||
|
*
|
||
|
* Created By Tony Huang @ 2014-5-22
|
||
|
* Copyright (c) 2014 Shanghai SlamTec Co., Ltd.
|
||
|
*/
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <rpos/rpos_config.h>
|
||
|
#include <rpos/system/object_handle.h>
|
||
|
#include <string>
|
||
|
#include <vector>
|
||
|
|
||
|
namespace rpos {
|
||
|
namespace core {
|
||
|
|
||
|
class Feature;
|
||
|
|
||
|
namespace detail {
|
||
|
class FeatureImpl;
|
||
|
|
||
|
template<class FeatureT>
|
||
|
struct feature_caster {
|
||
|
static FeatureT cast(Feature&);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
class RPOS_CORE_API Feature : public rpos::system::ObjectHandle<Feature, detail::FeatureImpl>{
|
||
|
public:
|
||
|
RPOS_OBJECT_CTORS(Feature);
|
||
|
~Feature();
|
||
|
|
||
|
public:
|
||
|
std::string featureId();
|
||
|
std::string description();
|
||
|
std::vector<std::string> dependencies();
|
||
|
|
||
|
bool initialize();
|
||
|
bool finalize();
|
||
|
|
||
|
template<class FeatureT>
|
||
|
FeatureT cast() {
|
||
|
return detail::feature_caster<FeatureT>::cast(*this);
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
template<class FeatureT>
|
||
|
friend struct detail::feature_caster;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|