itom  4.1.0
sharedStructures.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef SHAREDSTRUCTURES_H
29 #define SHAREDSTRUCTURES_H
30 
31 /* includes */
32 #include "typeDefs.h"
33 #include "retVal.h"
34 #include "param.h"
35 
36 /* definition and macros */
37 /* global variables (avoid) */
38 /* content */
39 
40 namespace ito
41 {
42  #define CREATEVERSION(major,minor,patch) (major << 16) + ((minor & 0xff) << 8) + (patch & 0xff)
43  #define MAJORVERSION(version) (version >> 16)
44  #define MINORVERSION(version) ((version & 0x00ff00) >> 8)
45  #define PATCHVERSION(version) (version & 0x0000ff)
46  #define MAXVERSION CREATEVERSION(255,0,0) //maximum possible version (that means no maximum version is indicated); ck 17.01.2017 changed maxversion major to 255, avoiding warning about too many bits in bitshift CREATEVERSION macro / Linux
47  #define MINVERSION CREATEVERSION(0,0,0) //minimum possible version
48 
49  #define DELETE_AND_SET_NULL(pointer) if(pointer != nullptr) { delete pointer; pointer = nullptr;};
50  #define DELETE_AND_SET_NULL_ARRAY(pointer) if(pointer != nullptr) { delete[] pointer; pointer = nullptr;};
51 
52  #define ItomDoc_VAR(name) static char name[]
53  #define ItomDoc_STRVAR(name,str) ItomDoc_VAR(name) = str
54 
55 } //end namespace ito
56 
57 #endif
Definition: apiFunctionsGraph.cpp:39