Open Lighting Architecture: include/ola/acn/CID.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
CID.h
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15 *
16 * CID.h
17 * The CID class, this just wraps a CIDImpl so we don't need to include all the
18 * UUID headers.
19 * Copyright (C) 2007 Simon Newton
20 */
21
22#ifndef INCLUDE_OLA_ACN_CID_H_
23#define INCLUDE_OLA_ACN_CID_H_
24
32
33#include <stdint.h>
34#include <ola/io/OutputBuffer.h>
35#include <string>
36
37namespace ola {
38namespace acn {
39
47 class CID {
48 public :
52 enum {
53 CID_LENGTH = 16
54 };
55
59 CID();
60
64 CID(const CID& other);
65
69 ~CID();
70
74 bool IsNil() const;
75
81 void Pack(uint8_t *output) const;
82
90 std::string ToString() const;
91
95 void Write(ola::io::OutputBufferInterface *output) const;
96
100 CID& operator=(const CID& c1);
101
105 bool operator==(const CID& c1) const;
106
110 bool operator!=(const CID& c1) const;
111
115 bool operator<(const CID& c1) const;
116
120 static CID Generate();
121
127 static CID FromData(const uint8_t *data);
128
133 static CID FromString(const std::string &cid);
134
135 private:
136 class CIDImpl *m_impl;
137
138 // Takes ownership;
139 explicit CID(class CIDImpl *impl);
140};
141} // namespace acn
142} // namespace ola
143
147#endif // INCLUDE_OLA_ACN_CID_H_
ola::acn::CID
The ACN component identifier.
Definition CID.h:47
ola::acn::CID::IsNil
bool IsNil() const
Returns true if the CID is uninitialized.
Definition CID.cpp:40
ola::acn::CID::CID
CID()
Create a new uninitialized CID.
Definition CID.cpp:30
ola::acn::CID::FromString
static CID FromString(const std::string &cid)
Create a new CID from a human readable string.
Definition CID.cpp:84
ola::acn::CID::ToString
std::string ToString() const
Return the CID as a human readable string.
Definition CID.cpp:65
ola::acn::CID::Generate
static CID Generate()
Generate a new CID.
Definition CID.cpp:74
ola::acn::CID::Pack
void Pack(uint8_t *output) const
Pack a CID into the binary representation.
Definition CID.cpp:44
ola::acn::CID::operator<
bool operator<(const CID &c1) const
Less than operator.
Definition CID.cpp:61
ola::acn::CID::operator!=
bool operator!=(const CID &c1) const
Inequality operator.
Definition CID.cpp:57
ola::acn::CID::Write
void Write(ola::io::OutputBufferInterface *output) const
Write the CID to an OutputBufferInterface.
Definition CID.cpp:69
ola::acn::CID::~CID
~CID()
CID destructor.
Definition CID.cpp:36
ola::acn::CID::operator==
bool operator==(const CID &c1) const
Equality operator.
Definition CID.cpp:53
ola::acn::CID::CID_LENGTH
@ CID_LENGTH
Definition CID.h:53
ola::acn::CID::operator=
CID & operator=(const CID &c1)
Assignment operator.
Definition CID.cpp:48
ola::acn::CID::FromData
static CID FromData(const uint8_t *data)
Create a new CID from a binary representation.
Definition CID.cpp:79
ola::acn::CIDImpl
Definition CIDImpl.h:49
ola::io::OutputBufferInterface
Definition OutputBuffer.h:36
ola::acn
ACN related code.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44