NEST  2.6.0,not_revisioned_source_dir@0
nest.h
Go to the documentation of this file.
1 /*
2  * nest.h
3  *
4  * This file is part of NEST.
5  *
6  * Copyright (C) 2004 The NEST Initiative
7  *
8  * NEST is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * NEST is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef NEST_H
24 #define NEST_H
25 
26 #include <cstddef>
27 #include <climits>
28 #include <cfloat>
29 #include <limits>
30 #include "config.h"
31 
65 namespace nest {
66 
81 #ifdef HAVE_LONG_LONG
82  typedef long long tic_t;
83  const tic_t tic_t_max = LONG_LONG_MAX;
84  const tic_t tic_t_min = LONG_LONG_MIN;
85 #else
86  typedef long tic_t;
87  const tic_t tic_t_max = LONG_MAX;
88  const tic_t tic_t_min = LONG_MIN;
89 #endif
90 
91  using std::size_t;
92 
93  typedef double double_t;
94  typedef float float_t;
95  typedef int int_t;
96  typedef long long_t;
97  typedef unsigned int uint_t;
98  typedef unsigned long ulong_t;
99 
100  const long_t long_t_max = LONG_MAX;
101  const long_t long_t_min = LONG_MIN;
102 
103 #define double_t_max (DBL_MAX) // because C++ language designers are apes
104 #define double_t_min (DBL_MIN) // (only integral consts are compile time)
105 
109  typedef size_t index;
111 
115  typedef unsigned char synindex;
117 
123  typedef unsigned short targetindex;
126 
133  typedef int_t thread;
134 
139 
147  typedef long_t rport;
148 
155  typedef long_t port;
156 
160  const rport invalid_port_ = -1;
161 
170  typedef double_t weight;
171 
178  typedef long_t delay;
181 
182 }
183 
184 #endif
size_t index
Unsigned long type for enumerations.
Definition: nest.h:109
double_t weight
Weight of a connection.
Definition: nest.h:170
int int_t
Integer number with at least 16 bit.
Definition: nest.h:95
const index max_targetindex
Definition: nest.h:125
const rport invalid_port_
Value for invalid connection port number.
Definition: nest.h:160
const long_t delay_max
Definition: nest.h:179
const long_t delay_min
Definition: nest.h:180
const synindex invalid_synindex
Definition: nest.h:116
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
const index invalid_index
Definition: nest.h:110
unsigned short targetindex
Unsigned short type for compact target representation.
Definition: nest.h:123
long long tic_t
Type for Time tics.
Definition: nest.h:82
const tic_t tic_t_min
Definition: nest.h:84
const long_t long_t_max
Definition: nest.h:100
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
double double_t
Double precision floating point numbers.
Definition: nest.h:93
unsigned int uint_t
Unsigned int_t.
Definition: nest.h:97
const Name max("max")
Definition: topology_names.h:75
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
long_t delay
Delay of a connection.
Definition: nest.h:178
const thread invalid_thread_
Value for invalid connection port number.
Definition: nest.h:138
const tic_t tic_t_max
Definition: nest.h:83
const long_t long_t_min
Definition: nest.h:101
int_t thread
Thread index type.
Definition: nest.h:133
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
const targetindex invalid_targetindex
Definition: nest.h:124
unsigned long ulong_t
Unsigned long_t.
Definition: nest.h:98
float float_t
Single precision floating point numbers.
Definition: nest.h:94