41 #ifndef _networksystemaddress_cpp
42 #define _networksystemaddress_cpp
44 #include "Network/platformincludes.h.cpp"
46 #include "Network/systemaddress.h"
62 Address(TargetAddress),
71 { this->
SetPort(TargetPort,NBO); }
74 Address(TargetAddress),
77 { this->
SetPort(TargetPort,NBO); }
80 Address(Other.Address),
82 V6Scope(Other.V6Scope),
93 { this->
Address = TargetAddress; }
114 { this->
Port = ( NBO ? TargetPort : htons(TargetPort) ); }
117 {
return ( NBO ? this->
Port : ntohs(this->
Port) ); }
173 if( !CurrAttrib.
Empty() )
177 if( !CurrAttrib.
Empty() )
178 this->
V6Flow = static_cast<UInt32>( CurrAttrib.
AsUint() );
181 if( !CurrAttrib.
Empty() )
197 {
return "SystemAddress"; }
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
A light-weight handle for manipulating attributes in DOM tree.
bool Boole
Generally acts a single bit, true or false.
void SetPort(const UInt16 TargetPort, const Boole NBO=false)
Sets the Port portion of the target system address.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
const IPAddress & GetAddress() const
Gets the IP portion of the target system address.
Thrown when the requested identity could not be found.
UInt32 V6Flow
The (optional) IPv6 Flow value, used for routing IPv6 packets.
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Boole operator==(const SystemAddress &Other) const
Equality operator.
UInt32 GetV6Flow() const
Gets the flow information to be used for routing packets to the target system.
bool Empty() const
Is this storing anything at all?
This implements the exception hiearchy for Mezzanine.
The interface for serialization.
void SetV6Scope(const UInt32 Scope)
Sets the scope-id for the address.
bool SetValue(const Char8 *rhs)
Set the value of this.
uint16_t UInt16
An 16-bit unsigned integer.
static String GetSerializableName()
Get the name of the the XML tag the SystemAddress class will leave behind as its instances are serial...
SystemAddress()
Class constructor.
A light-weight handle for manipulating nodes in DOM tree.
unsigned int AsUint(unsigned int def=0) const
Attempts to convert the value of the attribute to an unsigned int and returns the results...
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
uint32_t UInt32
An 32-bit unsigned integer.
UInt32 GetV6Scope() const
Gets the scope-id for the address.
bool Empty() const
Is this storing anything at all?
This is a simple class for representing IP addresses used throughout the Network subsystem.
UInt32 V6Scope
The (optional) IPv6 Scope-ID, used to describe the reach of the address.
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
~SystemAddress()
Class destructor.
IPAddress Address
The IPAddress of the target system.
UInt16 Port
The open port of the target system.
UInt16 GetPort(const Boole NBO=false) const
Gets the Port portion of the target system address.
void operator=(const SystemAddress &Other)
Assignment operator.
Boole operator!=(const SystemAddress &Other) const
Inequality operator.
void SetV6Flow(const UInt32 Flow)
Sets the flow information to be used.
The bulk of the engine components go in this namspace.
void SetAddress(const IPAddress &TargetAddress)
Sets the IP portion of the target system address.
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
static String GetSerializableName()
Get the name of the the XML tag the IPAddress class will leave behind as its instances are serialized...
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
std::string String
A datatype used to a series of characters.
A simple class that stores a complete set of information for establishing connections.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.