Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::lcore::Protocol Class Reference

A base class for my own type identification system. More...

#include <LCore/Protocol.h>

Inheritance diagram for strmod::lcore::Protocol:

Inheritance graph
[legend]
List of all members.

Public Methods

const ClassIdent & GetIdent () const
 Gets the identifier for the class the object actually is.

virtual int AreYouA (const lcore::ClassIdent &cid) const
 Asks if a class is of a particular type, or publicly derived from that type.

 Protocol ()
 Do nothing constructor for interface class with no member variables.

virtual ~Protocol ()
 Do nothing (virtual) destructor for interface class with no member variables.


Static Public Attributes

const LCore_ClassIdent identifier
 Globally unique identifier for this class.


Protected Methods

virtual const ClassIdent * i_GetIdent () const
 Returns the class identifier for the class the object actually is.


Detailed Description

A base class for my own type identification system.

This type identification system uses IDs that are assigned to a class by a programmer so they remain constant. This means you can use the IDs for type identification of data in persistent storage.

Definition at line 60 of file Protocol.h.


Member Function Documentation

virtual int strmod::lcore::Protocol::AreYouA const lcore::ClassIdent &    cid const [inline, virtual]
 

Asks if a class is of a particular type, or publicly derived from that type.

Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.

Parameters:
cid Usually <class>::identifier for the class you want to ask if the object is an instance of.

Reimplemented in strmod::lcore::Debugable, strmod::lcore::RefCountPtr, strmod::unievent::Dispatcher, strmod::unievent::Event, strmod::unievent::SimpleDispatcher, strmod::unievent::Timer, strmod::unievent::TimerEventTracker, strmod::unievent::UNEVT_ClassIdent, strmod::unievent::UnixEventPoll, strmod::ehnet::SocketAddress, strmod::strmod::ApplyVisitor_Base, strmod::strmod::BufferChunk, strmod::strmod::CharChopper, strmod::strmod::ChunkVisitor, strmod::strmod::DynamicBuffer, strmod::strmod::EchoModule, strmod::strmod::EOFStrChunk, strmod::strmod::GraphVizVisitor, strmod::strmod::GroupChunk, strmod::strmod::InfiniteModule, strmod::strmod::NewlineChopper, strmod::strmod::PassThrough, strmod::strmod::PreAllocBufferBase, strmod::strmod::ProcessorModule, strmod::strmod::RouterModule, strmod::strmod::SimpleMultiplexer, strmod::strmod::SimpleTelnetClient, strmod::strmod::SocketModuleChunk, strmod::strmod::SockListenModule, strmod::strmod::StaticBuffer, strmod::strmod::StrChunk, strmod::strmod::StrChunkPtr, strmod::strmod::StreamFDModule, strmod::strmod::StreamModule, strmod::strmod::StreamProcessor, strmod::strmod::StrSubChunk, strmod::strmod::TelnetChunkBuilder, strmod::strmod::TelnetChunker, strmod::strmod::TelnetChunker::TelnetData, strmod::strmod::TelnetChunker::SingleChar, strmod::strmod::TelnetChunker::Suboption, strmod::strmod::TelnetChunker::OptionNegotiation, strmod::strmod::TelnetParser, and strmod::strmod::UseTrackingVisitor.

Definition at line 93 of file Protocol.h.

const ClassIdent& strmod::lcore::Protocol::GetIdent   const [inline]
 

Gets the identifier for the class the object actually is.

This is an interface mistake I'll have to live with until I get the gumption to make the pervasive changes to correct it.

Originally the plan was to have this return different types (derived from ClassIdent) in different classes. After I tried it a couple of times, I realized what a bad idea that was, and am now left with this interface.

In order to achieve the original goal, a function that was virtual was needed to return that actual identifier, and a non-virtual function was needed to do the possible cast. I decided to have just one interface for getting the ClassIdent, so I made the virtual function protected. That's why this looks like it does.

Definition at line 81 of file Protocol.h.

const ClassIdent * strmod::lcore::Protocol::i_GetIdent   const [inline, protected, virtual]
 

Returns the class identifier for the class the object actually is.

Should always be overridden in any class that has a static identifier member.

Reimplemented in strmod::lcore::Debugable, strmod::lcore::ReferenceCounting, strmod::lcore::RefCountPtr, strmod::unievent::Dispatcher, strmod::unievent::Event, strmod::unievent::EventPtr, strmod::unievent::SimpleDispatcher, strmod::unievent::Timer, strmod::unievent::TimerEventTracker, strmod::unievent::UNEVT_ClassIdent, strmod::unievent::UnixEventPoll, strmod::ehnet::InetAddress, strmod::ehnet::SocketAddress, strmod::strmod::ApplyVisitor_Base, strmod::strmod::BufferChunk, strmod::strmod::ChunkVisitor, strmod::strmod::DynamicBuffer, strmod::strmod::EchoModule, strmod::strmod::EOFStrChunk, strmod::strmod::GraphVizVisitor, strmod::strmod::GroupChunk, strmod::strmod::InfiniteModule, strmod::strmod::NewlineChopper, strmod::strmod::PassThrough, strmod::strmod::PreAllocBufferBase, strmod::strmod::ProcessorModule, strmod::strmod::RouterModule, strmod::strmod::SimpleTelnetClient, strmod::strmod::SocketModuleChunk, strmod::strmod::SockListenModule, strmod::strmod::StaticBuffer, strmod::strmod::StrChunk, strmod::strmod::StrChunkPtr, strmod::strmod::StreamFDModule, strmod::strmod::StreamModule, strmod::strmod::StreamProcessor, strmod::strmod::StreamSplitterModule, strmod::strmod::StrSubChunk, strmod::strmod::TelnetChunkBuilder, strmod::strmod::TelnetChunker, strmod::strmod::TelnetChunker::TelnetData, strmod::strmod::TelnetChunker::SingleChar, strmod::strmod::TelnetChunker::Suboption, strmod::strmod::TelnetChunker::OptionNegotiation, strmod::strmod::TelnetParser, and strmod::strmod::UseTrackingVisitor.

Definition at line 113 of file Protocol.h.


Member Data Documentation

const LCore_ClassIdent strmod::lcore::Protocol::identifier [static]
 

Globally unique identifier for this class.

Every class that might need to be identified should have a public static const identifier object in it.

Reimplemented in strmod::lcore::Debugable, strmod::lcore::ReferenceCounting, strmod::lcore::RefCountPtr, strmod::unievent::Dispatcher, strmod::unievent::Event, strmod::unievent::EventPtr, strmod::unievent::SimpleDispatcher, strmod::unievent::Timer, strmod::unievent::TimerEventTracker, strmod::unievent::UNEVT_ClassIdent, strmod::unievent::UnixEventPoll, strmod::ehnet::InetAddress, strmod::ehnet::SocketAddress, strmod::strmod::ApplyVisitor_Base, strmod::strmod::BufferChunk, strmod::strmod::CharChopper, strmod::strmod::ChunkVisitor, strmod::strmod::DynamicBuffer, strmod::strmod::EchoModule, strmod::strmod::EOFStrChunk, strmod::strmod::GraphVizVisitor, strmod::strmod::GroupChunk, strmod::strmod::InfiniteModule, strmod::strmod::NewlineChopper, strmod::strmod::PassThrough, strmod::strmod::PreAllocBufferBase, strmod::strmod::ProcessorModule, strmod::strmod::RouterModule, strmod::strmod::SimpleMultiplexer, strmod::strmod::SimpleTelnetClient, strmod::strmod::SocketModuleChunk, strmod::strmod::SockListenModule, strmod::strmod::StaticBuffer, strmod::strmod::StrChunk, strmod::strmod::StrChunkPtr, strmod::strmod::StreamFDModule, strmod::strmod::StreamModule, strmod::strmod::StreamProcessor, strmod::strmod::StreamSplitterModule, strmod::strmod::StrSubChunk, strmod::strmod::TelnetChunkBuilder, strmod::strmod::TelnetChunker, strmod::strmod::TelnetChunker::TelnetData, strmod::strmod::TelnetChunker::SingleChar, strmod::strmod::TelnetChunker::Suboption, strmod::strmod::TelnetChunker::OptionNegotiation, strmod::strmod::TelnetParser, and strmod::strmod::UseTrackingVisitor.


The documentation for this class was generated from the following files:
Generated on Wed Jan 29 00:32:48 2003 for libNet by doxygen1.3-rc1