Fawkes API Fawkes Development Version
interface_info.h
1
2/***************************************************************************
3 * interface_info.h - BlackBoard Interface Info
4 *
5 * Created: Mon Mar 03 15:43:45 2008 (after topic switch)
6 * Copyright 2006-2008 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _INTERFACE_INTERFACE_INFO_H_
25#define _INTERFACE_INTERFACE_INFO_H_
26
27#include <list>
28#include <string>
29
30namespace fawkes {
31
32class Time;
33
35{
36public:
37 InterfaceInfo(const char * type,
38 const char * id,
39 const unsigned char * hash,
40 unsigned int serial,
41 bool has_writer,
42 unsigned int num_readers,
43 const std::list<std::string> &readers,
44 const std::string & writer,
45 const Time * timestamp);
48
49 const char * type() const;
50 const char * id() const;
51 const unsigned char * hash() const;
52 std::string hash_printable() const;
53 bool has_writer() const;
54 unsigned int num_readers() const;
55 const std::list<std::string> &readers() const;
56 const std::string & writer() const;
57 unsigned int serial() const;
58 const Time * timestamp() const;
59
61 bool operator<(const InterfaceInfo &ii) const;
62
63private:
64 char * type_;
65 char * id_;
66 unsigned char * hash_;
67 bool has_writer_;
68 unsigned int num_readers_;
69 unsigned int serial_;
70 Time * timestamp_;
71 std::list<std::string> readers_;
72 std::string writer_;
73};
74
75class InterfaceInfoList : public std::list<InterfaceInfo>
76{
77public:
78 void append(const char * type,
79 const char * id,
80 const unsigned char * hash,
81 unsigned int serial,
82 bool has_writer,
83 unsigned int num_readers,
84 const std::list<std::string> &readers,
85 const std::string & writer,
86 const Time & timestamp);
87};
88
89} // end namespace fawkes
90
91#endif
Interface information list.
void append(const char *type, const char *id, const unsigned char *hash, unsigned int serial, bool has_writer, unsigned int num_readers, const std::list< std::string > &readers, const std::string &writer, const Time &timestamp)
Append an interface info.
Interface info.
const std::list< std::string > & readers() const
Get readers of interface.
bool has_writer() const
Check if there is a writer.
unsigned int serial() const
Get interface instance serial.
bool operator<(const InterfaceInfo &ii) const
< operator This compares two interface infos with respect to the less than (<) relation considering t...
const char * type() const
Get interface type.
InterfaceInfo & operator=(const InterfaceInfo &i)
Assignment operator.
const char * id() const
Get interface ID.
InterfaceInfo(const char *type, const char *id, const unsigned char *hash, unsigned int serial, bool has_writer, unsigned int num_readers, const std::list< std::string > &readers, const std::string &writer, const Time *timestamp)
Constructor.
~InterfaceInfo()
Destructor.
const std::string & writer() const
Get name of writer on interface.
const unsigned char * hash() const
Get interface version hash.
unsigned int num_readers() const
Get number of readers.
std::string hash_printable() const
Get interface version hash in printable format.
const Time * timestamp() const
Get interface timestamp.
A class for handling time.
Definition: time.h:93
Fawkes library namespace.