B2BITS FIX Antenna C++  2.31.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
FixDictionary2::Protocol Class Reference

Represents Protocol interface. More...

#include <B2BITS_Protocol.h>

+ Inheritance diagram for FixDictionary2::Protocol:
+ Collaboration diagram for FixDictionary2::Protocol:

Public Types

typedef std::map< std::string, BlockT::RefBlocksByIDMap
 
typedef std::map< std::string, MessageT::RefMessagesByTypeMap
 Messages by type map. More...
 
- Public Types inherited from FixDictionary2::Item
enum  ItemName {
  ITEM_FIELD, ITEM_FIELDTYPE, ITEM_FIELDREF, ITEM_REPEATINGGROUP,
  ITEM_BLOCK, ITEM_BLOCKREF, ITEM_VALBLOCK, ITEM_MESSAGE,
  ITEM_PROTOCOL, ITEM_DICTIONARY
}
 Dictionary Item Names. More...
 

Public Member Functions

void addBlock (BlockT::Ptr block)
 Adds block to the protocol. More...
 
void addField (FieldT::Ptr field)
 Adds field to the protocol. More...
 
void addFieldType (FieldTypeT::Ptr type)
 Adds field type to the protocol. More...
 
void addFieldTypes (std::list< FieldTypeT::Ref > *types)
 Adds field types to the protocol. More...
 
void addFieldTypes (FieldTypeT::RefArray types, std::size_t size)
 Adds field types to the protocol. More...
 
void addMessage (MessageT::Ptr msg)
 Adds message to the protocol. More...
 
void addValBlock (ValBlockT::Ptr valBlock)
 Adds value block to the protocol. More...
 
ProtocolT::Ptr clone () const
 Make copy of object. More...
 
std::string const & description () const throw ()
 Returns description of the protocol. More...
 
BlockT::CPtr getBlock (std::string const &id) const throw ()
 Find block in protocol by id. More...
 
BlocksByIDMap const * getBlocks () const throw ()
 Returns block's set used in protocol. More...
 
std::string const & getDescription () const throw ()
 Returns description of the protocol. More...
 
FieldT::CPtr getField (int tag) const throw ()
 Find field in protocol by tag. More...
 
FieldT::CPtr getField (std::string const &name) const throw ()
 Find field in protocol by name. More...
 
Utils::Emptily< Engine::AsciiStringgetFieldNameByTag (const System::u32 tag) const
 Returns tag name according to tag number. More...
 
std::size_t getFields (FieldT::CRefArray *fields) const throw ()
 Returns fields registered in protocol. More...
 
Utils::Emptily< System::u32 > getFieldTagByName (std::string const &name) const
 Returns tag number according to tag's name. More...
 
FieldTypeT::CPtr getFieldType (std::string const &name) const throw ()
 Finds FieldType in protocol by name. More...
 
FieldTypeT::Ptr getFieldType (std::string const &name) throw ()
 Returns field type by its name. More...
 
std::map< std::string, FieldTypeT::Ref > const * getFieldTypes () const throw ()
 Returns field's types registered in protocol. More...
 
std::string const & getId () const throw ()
 Returns name of the Protocol, unique identifier. More...
 
MessageT::CPtr getMessage (std::string const &msgType) const throw ()
 Find message in protocol by message type. More...
 
MessagesByTypeMap const * getMessages () const throw ()
 Returns messages registered in protocol. More...
 
std::string const & getName () const throw ()
 Returns name of the Protocol, unique identifier. More...
 
std::string const & getTitle () const throw ()
 Returns name of Protocol. More...
 
ValBlockT::CPtr getValBlock (std::string const &id) const throw ()
 Finds ValBlock in protocol by id. More...
 
std::map< std::string, ValBlockT::Ref > const * getValBocks () const throw ()
 Returns messages registered in protocol. More...
 
std::string const & getVersion () const throw ()
 Returns base type of Protocol. More...
 
std::string const & id () const throw ()
 Returns name of the Protocol, unique identifier. More...
 
virtual ItemName itemName () const throw ()
 Returns the ItemName of object. More...
 
std::string const & name () const throw ()
 Returns name of the Protocol, unique identifier. More...
 
 Protocol (std::string const &name, std::string const &version, std::string const &title)
 Constructor. More...
 
void removeField (int tag)
 Removes field from the protocol. More...
 
void removeMessage (std::string const &msgType)
 Removes given message. More...
 
void save (std::string const &filePath) const
 Stores given protocol into XML file. More...
 
void setDescription (std::string const &value)
 Assigns description of the protocol. More...
 
ProtocolT::Ptr shallowClone (std::string const &name, std::string const &title) const
 Makes shallow copy of object. More...
 
std::string const & title () const throw ()
 Returns name of Protocol. More...
 
virtual ProtocolT::Ptr toProtocol ()
 Try downcast to Protocol class. More...
 
virtual ProtocolT::CPtr toProtocol () const
 Try downcast to Protocol class. More...
 
void updateBlock (BlockT::Ptr block)
 Replaces block with given. More...
 
void updateField (FieldT::Ptr field)
 Replaces field with given. More...
 
void updateFieldType (FieldTypeT::Ptr type)
 Replaces field type with given. More...
 
void updateMessage (MessageT::Ptr msg)
 Updates given message. More...
 
void updateValBlock (ValBlockT::Ptr valBlock)
 Replaces value block with given. More...
 
std::string const & version () const throw ()
 Returns base type of Protocol. More...
 
- Public Member Functions inherited from FixDictionary2::Item
ItemName getItemName () const throw ()
 Returns the ItemName of object. More...
 
 Item ()
 Default constructor. More...
 
 Item (Item const &obj)
 Copy constructor. More...
 
Itemoperator= (Item const &obj)
 Assign operator. More...
 
virtual BlockT::Ptr toBlock ()
 Try downcast to Block class. More...
 
virtual BlockT::CPtr toBlock () const
 Try downcast to Block class. More...
 
virtual BlockRefT::Ptr toBlockRef ()
 Try downcast to BlockRef class. More...
 
virtual BlockRefT::CPtr toBlockRef () const
 Try downcast to BlockRef class. More...
 
virtual FieldT::Ptr toField ()
 Try downcast to Field class. More...
 
virtual FieldT::CPtr toField () const
 Try downcast to Field class. More...
 
virtual FieldRefT::Ptr toFieldRef ()
 Try downcast to FieldRef class. More...
 
virtual FieldRefT::CPtr toFieldRef () const
 Try downcast to FieldRef class. More...
 
virtual FieldTypeT::Ptr toFieldType ()
 Try downcast to FieldType class. More...
 
virtual FieldTypeT::CPtr toFieldType () const
 Try downcast to FieldType class. More...
 
virtual MessageT::Ptr toMessage ()
 Try downcast to Message class. More...
 
virtual MessageT::CPtr toMessage () const
 Try downcast to Message class. More...
 
virtual MessageItemT::Ptr toMessageItem ()
 Try downcast to MessageItem class. More...
 
virtual MessageItemT::CPtr toMessageItem () const
 Try downcast to MessageItem class. More...
 
virtual RepeatingGroupT::Ptr toRepeatingGroup ()
 Try downcast to RepeatingGroup class. More...
 
virtual RepeatingGroupT::CPtr toRepeatingGroup () const
 Try downcast to RepeatingGroup class. More...
 
- Public Member Functions inherited from Utils::ReferenceCounter
virtual bool addRef () const throw ()
 Increments reference counter. More...
 
virtual long getNRef () const throw ()
 Returns the current value of the reference counter. More...
 
 ReferenceCounter () throw ()
 Constructor. More...
 
virtual long release () const throw ()
 Decrements reference counter. More...
 

Protected Member Functions

virtual ~Protocol () throw ()
 Destructor. More...
 
- Protected Member Functions inherited from Utils::ReferenceCounter
long decrement () const throw ()
 Decrements counter and returns new counter value. More...
 
long increment () const throw ()
 Increments counter and returns new counter value. More...
 
virtual ~ReferenceCounter ()
 Destructor. More...
 

Detailed Description

Represents Protocol interface.

Member Typedef Documentation

◆ BlocksByIDMap

typedef std::map<std::string, BlockT::Ref> FixDictionary2::Protocol::BlocksByIDMap

◆ MessagesByTypeMap

Messages by type map.

Constructor & Destructor Documentation

◆ Protocol()

FixDictionary2::Protocol::Protocol ( std::string const &  name,
std::string const &  version,
std::string const &  title 
)

Constructor.

◆ ~Protocol()

virtual FixDictionary2::Protocol::~Protocol ( )
throw (
)
protectedvirtual

Destructor.

Member Function Documentation

◆ addBlock()

void FixDictionary2::Protocol::addBlock ( BlockT::Ptr  block)

Adds block to the protocol.

◆ addField()

void FixDictionary2::Protocol::addField ( FieldT::Ptr  field)

Adds field to the protocol.

◆ addFieldType()

void FixDictionary2::Protocol::addFieldType ( FieldTypeT::Ptr  type)

Adds field type to the protocol.

◆ addFieldTypes() [1/2]

void FixDictionary2::Protocol::addFieldTypes ( std::list< FieldTypeT::Ref > *  types)

Adds field types to the protocol.

◆ addFieldTypes() [2/2]

void FixDictionary2::Protocol::addFieldTypes ( FieldTypeT::RefArray  types,
std::size_t  size 
)

Adds field types to the protocol.

◆ addMessage()

void FixDictionary2::Protocol::addMessage ( MessageT::Ptr  msg)

Adds message to the protocol.

◆ addValBlock()

void FixDictionary2::Protocol::addValBlock ( ValBlockT::Ptr  valBlock)

Adds value block to the protocol.

◆ clone()

ProtocolT::Ptr FixDictionary2::Protocol::clone ( ) const
virtual

Make copy of object.

Implements FixDictionary2::Item.

◆ description()

std::string const& FixDictionary2::Protocol::description ( ) const
throw (
)
inline

Returns description of the protocol.

◆ getBlock()

BlockT::CPtr FixDictionary2::Protocol::getBlock ( std::string const &  id) const
throw (
)

Find block in protocol by id.

Parameters
idof block to find
Returns
found block; null otherwise.

◆ getBlocks()

BlocksByIDMap const* FixDictionary2::Protocol::getBlocks ( ) const
throw (
)

Returns block's set used in protocol.

Returns
block's set used in protocol

◆ getDescription()

std::string const& FixDictionary2::Protocol::getDescription ( ) const
throw (
)

Returns description of the protocol.

◆ getField() [1/2]

FieldT::CPtr FixDictionary2::Protocol::getField ( int  tag) const
throw (
)

Find field in protocol by tag.

Parameters
tagof field to find
Returns
found tag; null otherwise

◆ getField() [2/2]

FieldT::CPtr FixDictionary2::Protocol::getField ( std::string const &  name) const
throw (
)

Find field in protocol by name.

Parameters
nameName of the field
Returns
found tag; null otherwise

◆ getFieldNameByTag()

Utils::Emptily<Engine::AsciiString> FixDictionary2::Protocol::getFieldNameByTag ( const System::u32  tag) const

Returns tag name according to tag number.

Parameters
tagTag number of FIX field

◆ getFields()

std::size_t FixDictionary2::Protocol::getFields ( FieldT::CRefArray fields) const
throw (
)

Returns fields registered in protocol.

Returns
fields registered in protocol

◆ getFieldTagByName()

Utils::Emptily<System::u32> FixDictionary2::Protocol::getFieldTagByName ( std::string const &  name) const

Returns tag number according to tag's name.

Parameters
nameName of FIX field

◆ getFieldType() [1/2]

FieldTypeT::CPtr FixDictionary2::Protocol::getFieldType ( std::string const &  name) const
throw (
)

Finds FieldType in protocol by name.

Parameters
nameof FieldType to find
Returns
found FieldType; NULL if field type is not found.

◆ getFieldType() [2/2]

FieldTypeT::Ptr FixDictionary2::Protocol::getFieldType ( std::string const &  name)
throw (
)

Returns field type by its name.

If field is not found, method returns null.

◆ getFieldTypes()

std::map<std::string, FieldTypeT::Ref> const* FixDictionary2::Protocol::getFieldTypes ( ) const
throw (
)

Returns field's types registered in protocol.

Returns
field's types registered in protocol

◆ getId()

std::string const& FixDictionary2::Protocol::getId ( ) const
throw (
)
inline

Returns name of the Protocol, unique identifier.

Note
"name" is "id" in the FIX XML
Returns
name of the Protocol

◆ getMessage()

MessageT::CPtr FixDictionary2::Protocol::getMessage ( std::string const &  msgType) const
throw (
)

Find message in protocol by message type.

Parameters
typeof message to find
Returns
found message; null otherwise.

◆ getMessages()

MessagesByTypeMap const* FixDictionary2::Protocol::getMessages ( ) const
throw (
)

Returns messages registered in protocol.

Returns
messages registered in protocol

◆ getName()

std::string const& FixDictionary2::Protocol::getName ( ) const
throw (
)
inline

Returns name of the Protocol, unique identifier.

Note
"name" is "id" in the FIX XML
Returns
name of the Protocol

◆ getTitle()

std::string const& FixDictionary2::Protocol::getTitle ( ) const
throw (
)
inline

Returns name of Protocol.

Returns
name of Protocol

◆ getValBlock()

ValBlockT::CPtr FixDictionary2::Protocol::getValBlock ( std::string const &  id) const
throw (
)

Finds ValBlock in protocol by id.

Parameters
idof the ValBlock to find
Returns
found ValBlock; null otherwise

◆ getValBocks()

std::map<std::string, ValBlockT::Ref> const* FixDictionary2::Protocol::getValBocks ( ) const
throw (
)

Returns messages registered in protocol.

Returns
messages registered in protocol

◆ getVersion()

std::string const& FixDictionary2::Protocol::getVersion ( ) const
throw (
)
inline

Returns base type of Protocol.

Returns
base type of Protocol

◆ id()

std::string const& FixDictionary2::Protocol::id ( ) const
throw (
)
inline

Returns name of the Protocol, unique identifier.

Note
"name" is "id" in the FIX XML
Returns
name of the Protocol

◆ itemName()

virtual ItemName FixDictionary2::Protocol::itemName ( ) const
throw (
)
virtual

Returns the ItemName of object.

Returns
ItemName of Object

Implements FixDictionary2::Item.

◆ name()

std::string const& FixDictionary2::Protocol::name ( ) const
throw (
)

Returns name of the Protocol, unique identifier.

Note
"name" is "id" in the FIX XML
Returns
name of the Protocol

◆ removeField()

void FixDictionary2::Protocol::removeField ( int  tag)

Removes field from the protocol.

◆ removeMessage()

void FixDictionary2::Protocol::removeMessage ( std::string const &  msgType)

Removes given message.

◆ save()

void FixDictionary2::Protocol::save ( std::string const &  filePath) const

Stores given protocol into XML file.

Created file can be loaded later by Dictionary.

◆ setDescription()

void FixDictionary2::Protocol::setDescription ( std::string const &  value)

Assigns description of the protocol.

◆ shallowClone()

ProtocolT::Ptr FixDictionary2::Protocol::shallowClone ( std::string const &  name,
std::string const &  title 
) const

Makes shallow copy of object.

◆ title()

std::string const& FixDictionary2::Protocol::title ( ) const
throw (
)

Returns name of Protocol.

Returns
name of Protocol

◆ toProtocol() [1/2]

virtual ProtocolT::Ptr FixDictionary2::Protocol::toProtocol ( )
virtual

Try downcast to Protocol class.

Returns
downcast to Protocol class

Reimplemented from FixDictionary2::Item.

◆ toProtocol() [2/2]

virtual ProtocolT::CPtr FixDictionary2::Protocol::toProtocol ( ) const
virtual

Try downcast to Protocol class.

Returns
downcast to Protocol class

Reimplemented from FixDictionary2::Item.

◆ updateBlock()

void FixDictionary2::Protocol::updateBlock ( BlockT::Ptr  block)

Replaces block with given.

◆ updateField()

void FixDictionary2::Protocol::updateField ( FieldT::Ptr  field)

Replaces field with given.

◆ updateFieldType()

void FixDictionary2::Protocol::updateFieldType ( FieldTypeT::Ptr  type)

Replaces field type with given.

◆ updateMessage()

void FixDictionary2::Protocol::updateMessage ( MessageT::Ptr  msg)

Updates given message.

◆ updateValBlock()

void FixDictionary2::Protocol::updateValBlock ( ValBlockT::Ptr  valBlock)

Replaces value block with given.

◆ version()

std::string const& FixDictionary2::Protocol::version ( ) const
throw (
)

Returns base type of Protocol.

Returns
base type of Protocol