Nebula
Loading...
Searching...
No Matches
debugmessage.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
15#include "core/types.h"
16#include "io/stream.h"
17
18//------------------------------------------------------------------------------
19namespace Net
20{
22{
23public:
27 DebugMessage(ushort port, const Ptr<IO::Stream>& data);
29 ushort GetPort() const;
31 const Ptr<IO::Stream>& GetStream() const;
33 bool IsValid() const;
34
35private:
38};
39
40//------------------------------------------------------------------------------
43inline
45 portNum(0)
46{
47 // empty
48}
49
50//------------------------------------------------------------------------------
53inline
55 portNum(p),
56 dataStream(s)
57{
58 // empty
59}
60
61//------------------------------------------------------------------------------
64inline ushort
66{
67 return this->portNum;
68}
69
70//------------------------------------------------------------------------------
73inline const Ptr<IO::Stream>&
75{
76 return this->dataStream;
77}
78
79//------------------------------------------------------------------------------
82inline bool
84{
85 return this->dataStream.isvalid();
86}
87
88} // namespace Net
89//------------------------------------------------------------------------------
90
Encapsulates a stream and a port number for debug communication.
Definition debugmessage.h:22
DebugMessage()
default constructor
Definition debugmessage.h:44
Ptr< IO::Stream > dataStream
Definition debugmessage.h:37
const Ptr< IO::Stream > & GetStream() const
get the data stream
Definition debugmessage.h:74
ushort portNum
Definition debugmessage.h:36
ushort GetPort() const
get the port number
Definition debugmessage.h:65
bool IsValid() const
return true if the message is valid
Definition debugmessage.h:83
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
bool isvalid() const
check if pointer is valid
Definition ptr.h:435
Definition debugmessage.h:20
unsigned short ushort
Definition types.h:32