ostinato/common/protocolmanager.h
Srivats P. c7d90ff1ab - All tabs converted to spaces in all files
- .vimrc added to reflect settings used in the project
2009-12-28 08:31:28 +00:00

36 lines
857 B
C++

#ifndef _PROTOCOL_MANAGER_H
#define _PROTOCOL_MANAGER_H
#include <QMap>
#include <QStringList>
class AbstractProtocol;
class StreamBase;
class ProtocolManager
{
QMap<int, QString> numberToNameMap;
QMap<QString, int> nameToNumberMap;
QMultiMap<int, int> neighbourProtocols;
QMap<int, void*> factory;
QList<AbstractProtocol*> protocolList;
void populateNeighbourProtocols();
public:
ProtocolManager();
void registerProtocol(int protoNumber, void *protoInstanceCreator);
AbstractProtocol* createProtocol(int protoNumber, StreamBase *stream,
AbstractProtocol *parent = 0);
AbstractProtocol* createProtocol(QString protoName, StreamBase *stream,
AbstractProtocol *parent = 0);
bool isValidNeighbour(int protoPrefix, int protoSuffix);
QStringList protocolDatabase();
};
#endif