-
Notifications
You must be signed in to change notification settings - Fork 0
/
vxValidatable.h
36 lines (28 loc) · 971 Bytes
/
vxValidatable.h
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
35
36
/**
*
* @file vxValidatable.h
\brief Interface to provide information about validity of a structure.
Poor-man exceptions of-sort. Derive your class from Validatable and it will be able to tell others its health.
*
* This header file is a part of VoxelBrain software.
*
* (c) Nanyang Technological University
*
* Author: Konstantin Levinski
*
*/
#ifndef __vxValidatable_h__
#define __vxValidatable_h__
/*! \brief Base for validatable classes.
Use it to provide consistency information about the object. For example, Io uses it to signal unexpected conditions. */
class Validatable {
public:
Validatable(); //!< \brief By default is valid.
virtual bool valid(); //!< \brief Returns true if valid, false otherwise.
virtual bool valid(bool is_valid); //!< \brief Sets the validity and returns it.
virtual operator bool(); //!< \brief Conversion operation.
private:
bool valid_;
};
#endif // __vxValidatable_h__
//End of vxValidatable.h