class ugcs::vsm::Subsystem

Overview

#include <subsystem.h>

class Subsystem: public std::enable_shared_from_this< Subsystem >
{
public:
    // typedefs

    typedef std::shared_ptr<Subsystem> Ptr;
    typedef std::weak_ptr<Subsystem> Weak_ptr;

    // fields

    proto::Subsystem_type type;
    std::unordered_map<std::string, Property::Ptr> properties;
    std::vector<Property::Ptr> telemetry_fields;
    std::unordered_map<int, Vsm_command::Ptr> commands;
    std::vector<Subsystem::Ptr> subsystems;

    // construction

    Subsystem(proto::Subsystem_type);
    Subsystem(const Subsystem&);

    // methods

    template <typename... Args>
    static Ptr Create(Args&&... args);

    template <typename Type>
    Property::Ptr Set_property(
        const std::string& name,
        Type value,
        proto::Field_semantic semantic = proto::FIELD_SEMANTIC_DEFAULT
        );

    Property::Ptr Add_telemetry(
        const std::string& name,
        proto::Field_semantic sem = proto::FIELD_SEMANTIC_DEFAULT,
        uint32_t timeout = 0
        );

    Property::Ptr Add_telemetry(
        const std::string& name,
        Property::Value_type type,
        uint32_t timeout = 0
        );

    void Remove_telemetry(Property::Ptr& t_field);

    Vsm_command::Ptr Add_command(
        const std::string& name,
        bool in_mission
        );

    void Register(proto::Register_subsystem* msg);
};

Detailed Documentation

Typedefs

typedef std::shared_ptr<Subsystem> Ptr

Pointer type.

typedef std::weak_ptr<Subsystem> Weak_ptr

Pointer type.

Construction

Subsystem(const Subsystem&)

Disable copying.

Methods

template <typename... Args>
static Ptr Create(Args&&... args)

Create an instance.