genesis-3d_engine/Engine/buildingtools/idlcompiler/idlmessage.h
zhongdaohuan 6e8fbca745 genesis-3d engine version 1.3.
match the genesis editor version 1.3.0.653.
2014-05-05 14:50:33 +08:00

119 lines
2.7 KiB
Objective-C

#pragma once
#ifndef TOOLS_IDLMESSAGE_H
#define TOOLS_IDLMESSAGE_H
//------------------------------------------------------------------------------
/**
@class Tools::IDLMessage
Wrap an IDL message definition.
(C) 2006 Radon Labs GmbH
*/
#include "core/refcounted.h"
#include "io/xmlreader.h"
#include "tools/idlcompiler/idlarg.h"
//------------------------------------------------------------------------------
namespace Tools
{
class IDLMessage : public Core::RefCounted
{
__DeclareClass(IDLMessage);
public:
/// constructor
IDLMessage();
/// parse from XmlReader
bool Parse(IO::XmlReader* reader, bool isMangaloreProtocol);
/// get error string
const Util::String& GetError() const;
/// get command name
const Util::String& GetName() const;
/// get fourcc string (optional if Mangalore message protocol)
const Util::String& GetFourCC() const;
/// get input arguments
const Util::Array<Ptr<IDLArg>>& GetInputArgs() const;
/// get output arguments
const Util::Array<Ptr<IDLArg>>& GetOutputArgs() const;
/// get parent class name
const Util::String& GetParentClass() const;
private:
/// set error string
void SetError(const Util::String& e);
Util::String error;
Util::String name;
Util::String fourcc;
Util::Array<Ptr<IDLArg>> inArgs;
Util::Array<Ptr<IDLArg>> outArgs;
Util::String parentClass;
};
//------------------------------------------------------------------------------
/**
*/
inline void
IDLMessage::SetError(const Util::String& e)
{
this->error = e;
}
//------------------------------------------------------------------------------
/**
*/
inline const Util::String&
IDLMessage::GetError() const
{
return this->error;
}
//------------------------------------------------------------------------------
/**
*/
inline const Util::String&
IDLMessage::GetName() const
{
return this->name;
}
//------------------------------------------------------------------------------
/**
*/
inline const Util::String&
IDLMessage::GetFourCC() const
{
return this->fourcc;
}
//------------------------------------------------------------------------------
/**
*/
inline const Util::Array<Ptr<IDLArg>>&
IDLMessage::GetInputArgs() const
{
return this->inArgs;
}
//------------------------------------------------------------------------------
/**
*/
inline const Util::Array<Ptr<IDLArg>>&
IDLMessage::GetOutputArgs() const
{
return this->outArgs;
}
//------------------------------------------------------------------------------
/**
*/
inline const Util::String&
IDLMessage::GetParentClass() const
{
return this->parentClass;
}
} // namespace Tools
//------------------------------------------------------------------------------
#endif