Abstract stream class used in IPC. More...
#include <CeylanStream.h>
Classes | |
class | CloseException |
Exception thrown when a stream operation failed. More... | |
class | NonBlockingNotSupportedException |
Exception thrown when a stream is set to non-blocking whereas it failed or is not supported at all. More... | |
class | StreamException |
Exception thrown when a stream operation failed. More... | |
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
Stream (bool blocking=true) | |
Basic constructor for stream instances. | |
virtual | ~Stream () throw () |
Basic virtual destructor. | |
bool | isBlocking () const |
Tells whether this stream is in blocking mode (if true), or in non-blocking mode (if false). | |
virtual bool | close ()=0 |
Closes the stream. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const =0 |
Returns an user-friendly description of the state of this object. | |
Static Public Member Functions | |
static bool | Close (FileDescriptor &fd) |
Closes and zeroes the specified file descriptor. | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Protected Member Functions | |
virtual void | setBlocking (bool newStatus) |
Sets the blocking mode of this stream. | |
Protected Attributes | |
bool | _isBlocking |
Stores whether the stream is in blocking mode. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
Stream (const Stream &source) | |
Copy constructor made private to ensure that it will be never called. | |
Stream & | operator= (const Stream &source) |
Assignment operator made private to ensure that it will be never called. |
Abstract stream class used in IPC.
Definition at line 65 of file CeylanStream.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Stream::Stream | ( | bool | blocking = true |
) | [explicit] |
Basic constructor for stream instances.
blocking | tells whether this stream should be created in blocking mode (the default) or in non-blocking mode (if supported). |
Definition at line 79 of file CeylanStream.cc.
Stream::~Stream | ( | ) | throw () [virtual] |
Basic virtual destructor.
Definition at line 86 of file CeylanStream.cc.
Ceylan::System::Stream::Stream | ( | const Stream & | source | ) | [private] |
Copy constructor made private to ensure that it will be never called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
bool Stream::Close | ( | FileDescriptor & | fd | ) | [static] |
Closes and zeroes the specified file descriptor.
It is passed by address so that this function can set it to zero on successful close.
CloseException | if the close operation failed. |
Definition at line 114 of file CeylanStream.cc.
References close(), generalUtils::false, Ceylan::toString(), and generalUtils::true.
Referenced by Ceylan::System::StandardFile::close(), Ceylan::Network::Socket::close(), Ceylan::System::Pipe::close(), and Ceylan::System::LibfatFile::close().
virtual bool Ceylan::System::Stream::close | ( | ) | [pure virtual] |
Closes the stream.
CloseException | if the close operation failed. |
Implemented in Ceylan::Network::Socket, Ceylan::System::File, Ceylan::System::LibfatFile, Ceylan::System::MemoryStream, Ceylan::System::Pipe, and Ceylan::System::StandardFile.
Referenced by Close().
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
bool Stream::isBlocking | ( | ) | const |
Tells whether this stream is in blocking mode (if true), or in non-blocking mode (if false).
Definition at line 93 of file CeylanStream.cc.
References _isBlocking.
Referenced by Ceylan::Network::StreamSocket::createSocket(), and Ceylan::Network::Socket::toString().
Assignment operator made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void Stream::setBlocking | ( | bool | newStatus | ) | [protected, virtual] |
Sets the blocking mode of this stream.
newStatus | if true, sets the stream in blocking mode, if false set to non-blocking mode. If the stream is already in the target state, nothing is done. |
NonBlockingNotSupportedException | if the operation failed or is not supported. |
Reimplemented in Ceylan::Network::Socket, and Ceylan::Network::StreamSocket.
Definition at line 175 of file CeylanStream.cc.
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const std::string Stream::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [pure virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Implements Ceylan::TextDisplayable.
Implemented in Ceylan::Network::AnonymousProtocolAwareStreamSocket, Ceylan::Network::AnonymousStreamSocket, Ceylan::Network::ClientStreamSocket, Ceylan::Network::MultiplexedProtocolBasedStreamServer, Ceylan::Network::MultiplexedServerStreamSocket, Ceylan::Network::SequentialServerStreamSocket, Ceylan::Network::ServerStreamSocket, Ceylan::Network::Socket, Ceylan::Network::StreamSocket, Ceylan::System::AnonymousInputOutputStream, Ceylan::System::AnonymousInputStream, Ceylan::System::File, Ceylan::System::InputOutputStream, Ceylan::System::InputStream, Ceylan::System::LibfatFile, Ceylan::System::MemoryStream, Ceylan::System::OutputStream, and Ceylan::System::StandardFile.
Definition at line 102 of file CeylanStream.cc.
References _isBlocking.
bool Ceylan::System::Stream::_isBlocking [protected] |
Stores whether the stream is in blocking mode.
Definition at line 221 of file CeylanStream.h.
Referenced by isBlocking(), Ceylan::Network::StreamSocket::setBlocking(), Ceylan::Network::Socket::setBlocking(), and toString().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().