API
ioDevice.hpp
Go to the documentation of this file.
1 /** \file ioDevice.hpp
2  * \author Jared R. Males
3  * \brief Configuration and control of an input and output device
4  *
5  * \ingroup app_files
6  *
7  */
8 
9 #ifndef app_tty_ioDevice_hpp
10 #define app_tty_ioDevice_hpp
11 
12 #include <mx/app/appConfigurator.hpp>
13 
14 namespace MagAOX
15 {
16 namespace app
17 {
18 namespace dev
19 {
20 
21 /// An input/output capable device.
22 /** Standardizes read and write timeout configuration.
23  *
24  * \ingroup appdev
25  */
26 struct ioDevice
27 {
28  unsigned m_readTimeout {1000}; ///< The read timeout [msec]
29  unsigned m_writeTimeout {1000}; ///< The write timeout [msec]
30 
31  ///Setup an application configurator for the device section
32  /**
33  * \returns 0 on success.
34  * \returns -1 on error (nothing implemented yet)
35  */
36  int setupConfig( mx::app::appConfigurator & config /**< [in] an application configuration to setup */);
37 
38  ///Load the device section from an application configurator
39  /**
40  *
41  * \returns 0 on success
42  * \returns -1 on error (nothing implemented yet)
43  */
44  int loadConfig( mx::app::appConfigurator & config /**< [in] an application configuration from which to load values */);
45 
46  /// Perform application startup steps specific to an ioDevice
47  /**
48  * This is currently an empty function which always returns 0. Could be ignored,
49  * but for future changes it is recommended to include a call to this in derivedT::appStartup().
50  *
51  * \returns 0 on success
52  * \returns -1 on error
53  */
54  int appStartup();
55 
56  /// Perform application logic steps specific to an ioDevice during the main event loop
57  /**
58  * This is currently an empty function which always returns 0. Could be ignored,
59  * but for future changes it is recommended to include a call to this in derivedT::appLogic().
60  *
61  * \returns 0 on success
62  * \returns -1 on error
63  */
64  int appLogic();
65 };
66 
67 
68 } //namespace dev
69 } //namespace tty
70 } //namespace MagAOX
71 
72 #endif //tty_ioDevice_hpp
Definition: dm.hpp:24
An input/output capable device.
Definition: ioDevice.hpp:27
unsigned m_writeTimeout
The write timeout [msec].
Definition: ioDevice.hpp:29
int loadConfig(mx::app::appConfigurator &config)
Load the device section from an application configurator.
Definition: ioDevice.cpp:28
int appStartup()
Perform application startup steps specific to an ioDevice.
Definition: ioDevice.cpp:36
int setupConfig(mx::app::appConfigurator &config)
Setup an application configurator for the device section.
Definition: ioDevice.cpp:20
unsigned m_readTimeout
The read timeout [msec].
Definition: ioDevice.hpp:28
int appLogic()
Perform application logic steps specific to an ioDevice during the main event loop.
Definition: ioDevice.cpp:41