class ugcs::vsm::Android_serial_processor::Write_request

Overview

class Write_request: public ugcs::vsm::Request_container::Request
{
public:
    // typedefs

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

    // fields

    Stream::Ref stream;
    Io_buffer::Ptr buf;
    Io_result& result_ref;

    // construction

    Write_request(
        Stream::Ref stream,
        Io_buffer::Ptr buf,
        Io_result& result_ref
        );

    // methods

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

    void Complete(Io_result result);
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<Request> Ptr;
    typedef std::weak_ptr<Request> Weak_ptr;
    typedef Callback_base<void>::Ptr<> Handler;
    typedef std::unique_lock<std::mutex> Locker;

    // enums

    enum Status;

    // methods

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

    void Set_processing_handler(const Handler& handler);
    void Set_processing_handler(Handler&& handler);
    void Set_completion_handler(const Request_container::Ptr& context, const Handler& handler);
    void Set_completion_handler(const Request_container::Ptr& context, Handler&& handler);
    void Set_cancellation_handler(const Handler& handler);
    void Set_cancellation_handler(Handler&& handler);
    void Set_done_handler(Handler& handler);
    void Set_done_handler(Handler&& handler);
    Request_container::Ptr Get_completion_context(Locker locker = Locker()) const;
    void Process(bool process_request);
    void Complete(Status status = Status::OK, Locker locker = Locker());
    void Cancel(Locker locker = Locker());
    void Abort(Locker locker = Locker());
    Locker Lock(bool acquire = true) const;
    Status Get_status() const;
    bool Is_completed() const;
    bool Is_request_processing_needed() const;
    bool Is_aborted() const;
    bool Is_processing() const;
    bool Is_completion_delivered() const;
    bool Is_completion_delivering_started() const;
    bool Is_done() const;

    bool Wait_done(
        bool process_ctx = true,
        std::chrono::milliseconds timeout = std::chrono::milliseconds::zero()
        );

    bool& Timed_out();

Detailed Documentation

Typedefs

typedef std::shared_ptr<Write_request> Ptr

Pointer type.

typedef std::weak_ptr<Write_request> Weak_ptr

Pointer type.

Methods

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

Create an instance.