Fawkes API  Fawkes Development Version
message.cpp
1 
2 /***************************************************************************
3  * message.cpp - Interface generator message representation
4  *
5  * Generated: Wed Oct 11 22:24:16 2006 (Germany - Slowakia 4:1)
6  * Copyright 2006 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.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #include <interfaces/generator/message.h>
24 
25 
26 /** @class InterfaceMessage message.h <interfaces/generator/message.h>
27  * Interface generator internal representation of a message as parsed from
28  * the XML template file.
29  */
30 
31 /** Constructor
32  * @param name name of message
33  * @param comment comment of message
34  */
35 InterfaceMessage::InterfaceMessage(const std::string &name, const std::string &comment)
36 {
37  if ( name.find("Message") != std::string::npos ) {
38  this->name = name;
39  } else {
40  this->name = name + "Message";
41  }
42  this->comment = comment;
43  fields.clear();
44 }
45 
46 
47 /** Get name of message.
48  * @return name of message.
49  */
50 std::string
52 {
53  return name;
54 }
55 
56 
57 /** Get comment of message.
58  * @return comment of message.
59  */
60 std::string
62 {
63  return comment;
64 }
65 
66 
67 /** Set fields of message.
68  * @param fields fields of message.
69  */
70 void
71 InterfaceMessage::setFields(const std::vector<InterfaceField> &fields)
72 {
73  this->fields = fields;
74 }
75 
76 
77 /** Get fields of message.
78  * @return fields of message.
79  */
80 std::vector<InterfaceField>
82 {
83  return fields;
84 }
void setFields(const std::vector< InterfaceField > &fields)
Set fields of message.
Definition: message.cpp:71
InterfaceMessage(const std::string &name, const std::string &comment)
Constructor.
Definition: message.cpp:35
std::string getName()
Get name of message.
Definition: message.cpp:51
std::vector< InterfaceField > getFields()
Get fields of message.
Definition: message.cpp:81
std::string getComment()
Get comment of message.
Definition: message.cpp:61