EMANE  1.2.1
types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 - Adjacent Link LLC, Bridgewater, New Jersey
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * * Neither the name of Adjacent Link LLC nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef EMANETYPES_HEADER_
34 #define EMANETYPES_HEADER_
35 
36 #include <cstdint>
37 #include <chrono>
38 #include <string>
39 #include <list>
40 
41 namespace EMANE
42 {
43  using Seconds = std::chrono::seconds;
44  using Milliseconds = std::chrono::milliseconds;
45  using Microseconds = std::chrono::microseconds;
46  using Nanoseconds = std::chrono::nanoseconds;
47  using DoubleSeconds = std::chrono::duration<double>;
48  using Clock = std::chrono::system_clock;
49  using Duration = Clock::duration;
50  using TimePoint = Clock::time_point;
51 
52  using NEMId = std::uint16_t;
53  using EventId = std::uint16_t;
54  using TimerEventId = std::size_t;
55 
56  using PlatformId = std::uint16_t;
57  using AntennaProfileId = std::uint16_t;
58  using ControlMessageId = std::uint16_t;
59  using RegistrationId = std::uint16_t;
60  using BuildId = std::uint32_t;
61 
62  using LengthPrefix = std::uint16_t;
63 
64  using Priority = std::uint8_t;
65 
66  using Strings = std::list<std::string>;
67 
68  // All 1's NEMId represents a broad cast packet
69  constexpr NEMId NEM_BROADCAST_MAC_ADDRESS{std::numeric_limits<NEMId>::max()};
70 }
71 
72 
73 #endif // EMANETYPES_HEADER_
std::chrono::milliseconds Milliseconds
Definition: types.h:44
constexpr NEMId NEM_BROADCAST_MAC_ADDRESS
Definition: types.h:69
std::uint16_t PlatformId
Definition: types.h:56
std::uint8_t Priority
Definition: types.h:64
std::chrono::seconds Seconds
Definition: types.h:43
std::uint16_t EventId
Definition: types.h:53
std::uint16_t ControlMessageId
Definition: types.h:58
std::uint16_t AntennaProfileId
Definition: types.h:57
std::chrono::system_clock Clock
Definition: types.h:48
std::uint16_t RegistrationId
Definition: types.h:59
std::chrono::microseconds Microseconds
Definition: types.h:45
std::chrono::duration< double > DoubleSeconds
Definition: types.h:47
std::uint16_t NEMId
Definition: types.h:52
std::list< std::string > Strings
Definition: types.h:66
Clock::duration Duration
Definition: types.h:49
std::chrono::nanoseconds Nanoseconds
Definition: types.h:46
std::size_t TimerEventId
Definition: types.h:54
Clock::time_point TimePoint
Definition: types.h:50
std::uint16_t LengthPrefix
Definition: types.h:62
std::uint32_t BuildId
Definition: types.h:60
Definition: agent.h:43