00001 00002 /*************************************************************************** 00003 * message.cpp - Interface generator message representation 00004 * 00005 * Generated: Wed Oct 11 22:24:16 2006 (Germany - Slowakia 4:1) 00006 * Copyright 2006 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #include <interfaces/generator/message.h> 00024 00025 00026 /** @class InterfaceMessage message.h <interfaces/generator/message.h> 00027 * Interface generator internal representation of a message as parsed from 00028 * the XML template file. 00029 */ 00030 00031 /** Constructor 00032 * @param name name of message 00033 * @param comment comment of message 00034 */ 00035 InterfaceMessage::InterfaceMessage(const std::string &name, const std::string &comment) 00036 { 00037 if ( name.find("Message") != std::string::npos ) { 00038 this->name = name; 00039 } else { 00040 this->name = name + "Message"; 00041 } 00042 this->comment = comment; 00043 fields.clear(); 00044 } 00045 00046 00047 /** Get name of message. 00048 * @return name of message. 00049 */ 00050 std::string 00051 InterfaceMessage::getName() 00052 { 00053 return name; 00054 } 00055 00056 00057 /** Get comment of message. 00058 * @return comment of message. 00059 */ 00060 std::string 00061 InterfaceMessage::getComment() 00062 { 00063 return comment; 00064 } 00065 00066 00067 /** Set fields of message. 00068 * @param fields fields of message. 00069 */ 00070 void 00071 InterfaceMessage::setFields(const std::vector<InterfaceField> &fields) 00072 { 00073 this->fields = fields; 00074 } 00075 00076 00077 /** Get fields of message. 00078 * @return fields of message. 00079 */ 00080 std::vector<InterfaceField> 00081 InterfaceMessage::getFields() 00082 { 00083 return fields; 00084 }