-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_interface.h
More file actions
34 lines (28 loc) · 1.25 KB
/
command_interface.h
File metadata and controls
34 lines (28 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// (C) Copyright 2009-2011 Vit Kasal
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include "si_constants.h"
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
#include <boost/shared_array.hpp>
#include <cstddef>
namespace si
{
struct command_interface
{
typedef boost::shared_ptr<command_interface> pointer;
typedef boost::function<void(const boost::uint8_t*,const std::size_t)> writer_type;
typedef boost::uint8_t id_type;
typedef boost::shared_array<boost::uint8_t> data_type;
virtual id_type get_id(protocols::id<>::value_type protocol = protocols::id<>::value) = 0;
virtual void get_data(std::size_t &size, data_type& data, protocols::id<>::value_type protocol = protocols::id<>::value) = 0;
// virtual void write(writer_type writer, protocols::id<>::value_type protocol) = 0;
virtual std::size_t get_size(protocols::id<>::value_type protocol = protocols::id<>::value) = 0;
virtual bool is_control_sequence() = 0;
// virtual bool can_accept_data(std::size_t size, data_type data) = 0;
virtual bool accept_data(std::size_t size, data_type data) = 0;
virtual ~command_interface(){}
};
}//namespace si