class ugcs::vsm::Property

Overview

#include <property.h>

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

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

    // enums

    enum Value_spec;
    enum Value_type;

    // construction

    Property(
        int id,
        const std::string& name,
        proto::Field_semantic semantic
        );

    Property(
        int id,
        const std::string& name,
        Value_type type
        );

    Property(Property::Ptr);

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

    // methods

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

    void Add_enum(
        const std::string& name,
        int value
        );

    void Set_value(bool v);
    void Set_value(double v);
    void Set_value(const std::string& v);
    void Set_value(const char* v);
    void Set_value(int v);
    void Set_value(unsigned int v);
    void Set_value(const proto::List_value& v);
    void Set_value_na();
    bool Set_value(const proto::Field_value& val);
    void Register(proto::Register_field* field);
    void Write_as_property(proto::Property_field* field);
    void Write_as_parameter(proto::Parameter_field* field);
    void Write_as_telemetry(proto::Telemetry_field* field);
    void Set_timeout(int);
    Property::Ptr Min_value();
    Property::Ptr Max_value();
    Property::Ptr Default_value();
    bool Get_value(bool& v);
    bool Get_value(float& v);
    bool Get_value(double& v);
    bool Get_value(std::string& v);
    bool Get_value(int& v);
    bool Get_value(int64_t& v);
    bool Get_value(proto::List_value& v);
    bool Is_value_na();
    bool Is_changed();
    void Set_changed();
    int Get_id();
    std::string Get_name();
    proto::Field_semantic Get_semantic();
    std::chrono::time_point<std::chrono::system_clock> Get_update_time();
    std::string Dump_value();

    bool Fields_are_equal(
        const proto::Field_value& val1,
        const proto::Field_value& val2
        );

    bool Is_equal(const Property&);
};

Detailed Documentation

Typedefs

typedef std::shared_ptr<Property> Ptr

Pointer type.

typedef std::weak_ptr<Property> Weak_ptr

Pointer type.

Methods

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

Create an instance.