Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
No files matched your search
Executable
+69
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* {{ namespace_abbr_upper }} Data Topic Server Interface
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hanna E. Rathje, SLSE, 2016-01-05
|
||||
*/
|
||||
|
||||
{% autoescape off %}
|
||||
// filename: {{ namespace_abbr }}_dts.h
|
||||
#pragma once
|
||||
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_export.h>
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}.hpp>
|
||||
|
||||
|
||||
namespace DDSConnector
|
||||
{
|
||||
class DdsConnector;
|
||||
}
|
||||
|
||||
namespace {{ namespace }}
|
||||
{
|
||||
namespace Interface
|
||||
{
|
||||
class Dts
|
||||
{
|
||||
protected:
|
||||
Dts() = default;
|
||||
public:
|
||||
virtual ~Dts() = default;
|
||||
|
||||
/**
|
||||
* Create a new instance for {{ namespace }}::Interface::Dts.
|
||||
* The caller takes ownership of the returned instance
|
||||
*/
|
||||
{{ namespace_abbr_upper }}_SERVER_EXPORT static std::shared_ptr<Dts> create(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector);
|
||||
|
||||
/**
|
||||
* A unique identifier for this DTS
|
||||
*/
|
||||
{{ namespace_abbr_upper }}_SERVER_EXPORT static inline const char *identifier() { return "{{ namespace }}.Interface.Dts"; }
|
||||
|
||||
/**
|
||||
* initialize this Dts instance with all data topic writers
|
||||
*/
|
||||
virtual bool enableAll(bool enable = true) = 0;
|
||||
/**
|
||||
* only initialize the specific writer (can be called instead enableAll())
|
||||
*/
|
||||
{% for dt in dataTopics.member %} {% if dt.dtsImpl %}
|
||||
virtual bool enable{{ dt.name }}(bool enable = true) = 0;
|
||||
virtual bool is{{ dt.name }}Enabled() const = 0;
|
||||
{% endif %} {% endfor %}
|
||||
|
||||
{% for dt in dataTopics.member %}
|
||||
//
|
||||
// Data Topic '{{ dt.name }}'
|
||||
//
|
||||
virtual bool publish(const {{ namespace }}::{{ dt.type }} &data) = 0;
|
||||
{% if dt.key.name %}
|
||||
virtual bool remove{{ dt.name }}ByKey({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc }}, bool errorMsgIfSampleDoesNotExists = true) = 0;
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
} // namespace {{ namespace }}
|
||||
{% endautoescape %}
|
||||
Reference in new issue
Block a user