mn_basic_device.hpp
Go to the documentation of this file.
1 
20 #ifndef __MINILIB_DEV_BASE_DEVICE_H__
21 #define __MINILIB_DEV_BASE_DEVICE_H__
22 
23 #include "../mn_config.hpp"
24 
25 namespace mn {
26  namespace device {
27  class basic_device {
28  public:
29  basic_device(char prefix[8])
30  : m_prefix(prefix) { }
35  virtual int open() = 0;
41  virtual int stop() = 0;
42 
43  virtual bool is_enable() = 0;
44 
45  virtual bool is_stream_support() = 0;
46 
47  const char* get_prefix() { return m_prefix; }
48  protected:
49  const char* m_prefix;
50  };
51 
53  public:
54  basic_streamed_device(char prefix[8])
55  : basic_device(prefix) { }
56 
57  virtual bool is_stream_support() { return true; }
58 
59  virtual void* get_stream() = 0;
60  };
61  }
62 }
63 
64 
65 
66 #endif // __MINILIB_DEV_NETWORK_DEVICE_H__
67 
Definition: mn_basic_device.hpp:27
basic_device(char prefix[8])
Definition: mn_basic_device.hpp:29
virtual int stop()=0
Closes device.
const char * m_prefix
Definition: mn_basic_device.hpp:49
virtual int open()=0
Opens device.
const char * get_prefix()
Definition: mn_basic_device.hpp:47
virtual bool is_stream_support()=0
virtual bool is_enable()=0
Definition: mn_basic_device.hpp:52
basic_streamed_device(char prefix[8])
Definition: mn_basic_device.hpp:54
virtual bool is_stream_support()
Definition: mn_basic_device.hpp:57
Definition: mn_allocator_typetraits.hpp:25