Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JAccessible.hh
Go to the documentation of this file.
1#ifndef __JLANG__JACCESSIBLE__
2#define __JLANG__JACCESSIBLE__
3
4#include "JLang/JThrow.hh"
5
6
7/**
8 * \author mdejong
9 */
10
11namespace JLANG {}
12namespace JPP { using namespace JLANG; }
13
14namespace JLANG {
15
16
17 /**
18 * Interface for named access of a device.
19 */
21 public JThrow<JAccessible>
22 {
23 protected:
24 /**
25 * Default constructor.
26 */
28 {}
29
30
31 public:
32 /**
33 * Virtual destructor.
34 */
35 virtual ~JAccessible()
36 {}
37
38
39 /**
40 * Check is device is open.
41 *
42 * \return true if open; else false
43 */
44 virtual bool is_open() const = 0;
45
46
47 /**
48 * Open device.
49 *
50 * \param file_name file name
51 */
52 virtual void open(const char* file_name) = 0;
53
54
55 /**
56 * Close device.
57 */
58 virtual void close() = 0;
59 };
60
61
62 /**
63 * Interface for null access.
64 */
66 public virtual JAccessible
67 {
68 public:
69 /**
70 * Check is device is open.
71 *
72 * \return true
73 */
74 virtual bool is_open() const override
75 {
76 return true;
77 }
78
79
80 /**
81 * Open device.
82 *
83 * \param file_name file name
84 */
85 virtual void open(const char* file_name) override
86 {}
87
88
89 /**
90 * Close device.
91 */
92 virtual void close() override
93 {}
94 };
95}
96
97#endif
Exception handling.
Interface for named access of a device.
JAccessible()
Default constructor.
virtual bool is_open() const =0
Check is device is open.
virtual ~JAccessible()
Virtual destructor.
virtual void close()=0
Close device.
virtual void open(const char *file_name)=0
Open device.
Interface for null access.
virtual bool is_open() const override
Check is device is open.
virtual void open(const char *file_name) override
Open device.
virtual void close() override
Close device.
Auxiliary base class for controling the throwing of exceptions.
Definition JThrow.hh:25
Auxiliary classes and methods for language specific functionality.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).