class ugcs::vsm::Cucs_processor

Overview

Handles interactions with CUCS. More…

#include <cucs_processor.h>

class Cucs_processor: public ugcs::vsm::Request_context
{
public:
    // typedefs

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

    // structs

    struct Server_context;
    struct Vehicle_context;

    // fields

    static constexpr static uint32_t SUPPORTED_UCS_VERSION_MAJOR = 2;
    static constexpr static uint32_t SUPPORTED_UCS_VERSION_MINOR = 14;

    // methods

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

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

    void Register_device(Device::Ptr);
    void Unregister_device(uint32_t handle);

    void Send_ucs_message(
        uint32_t handle,
        Proto_msg_ptr message,
        uint32_t stream_id = 0
        );
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<Request_container> Ptr;
    typedef std::weak_ptr<Request_container> Weak_ptr;
    typedef std::shared_ptr<Request_context> Ptr;
    typedef std::weak_ptr<Request_context> Weak_ptr;

    // enums

    enum Type;

    // classes

    class Request;
    class Request_waiter;

    // methods

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

    virtual Type Get_type() const;
    bool Check_type(Type mask);
    void Submit_request(Request::Ptr request);
    void Submit_request_locked(Request::Ptr request, Request_waiter::Locker locker);
    int Process_requests(int requests_limit = 0);
    int Process_requests(std::unique_lock<std::mutex>& lock, int requests_limit = 0);
    void Set_waiter(Request_waiter::Ptr waiter);
    Request_waiter::Ptr Get_waiter() const;
    const std::string& Get_name();
    void Enable();
    void Disable();
    bool Is_enabled() const;

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

    virtual Type Get_type() const;
    Request_container(const std::string& name, Request_waiter::Ptr waiter = Request_waiter::Create());

Detailed Documentation

Handles interactions with CUCS.

Intermediate version.

Typedefs

typedef std::shared_ptr<Cucs_processor> Ptr

Pointer type.

typedef std::weak_ptr<Cucs_processor> Weak_ptr

Pointer type.

Methods

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

Create an instance.

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

Get global or create new processor instance.

void Register_device(Device::Ptr)

Registration of a vehicle instance in the processor.

Returns only when device registration has completed.

void Unregister_device(uint32_t handle)

Unregistration of a vehicle instance in the processor.