Files
qt6-migration-pipeline/Lts/Common/CodeGen/svc_dts.h.grantlee
T

70 lines
1.8 KiB
Plaintext
Executable File

/**
* {{ 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 %}