lcCommand.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1998 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00008 
00009 #pragma once
00010 
00011 #include "lcPdu.h"
00012 
00013 typedef struct DtLgrCommandData
00014 {
00015    DtNetInt16 domain;
00016    DtNetInt16 protocol;
00017    DtNetInt16 command;
00018    DtNetU16   pad1;
00019    DtNetU16 parametersBuffLength;
00020    DtNetU16 parametersBuffOffset;
00021 } DtLgrCommandData;
00022 
00023 const int theCommandPduSize = theLgrControlPduSizeSansParams
00024    + sizeof(DtLgrCommandData);
00025 
00026 typedef const char* (*DtDomainToStringFunc)(int domain);
00027 typedef const char* (*DtProtocolToStringFunc)(int protocol);
00028 typedef const char* (*DtCommandToStringFunc)(int domain, int command);
00029 
00033 class DT_DLL_LOGGERCONTROL DtLgrCommandPdu : public DtLgrControlPdu
00034 {
00035 public:
00036 
00038    DtLgrCommandPdu( DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER );
00039 
00041    DtLgrCommandPdu( const DtNetLgrControlPdu* initial,
00042       DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER );
00043 
00045    DtLgrCommandPdu( const DtEntityIdentifier& sender,
00046       const DtEntityIdentifier& receiver, int domain, int protocol,
00047       int commandId, const DtString& parametersBuffer, int pduSize=theCommandPduSize,
00048       DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER );
00049 
00051    virtual ~DtLgrCommandPdu();
00052 
00054    DtLgrCommandPdu( const DtLgrCommandPdu& src );
00055 
00057    DtLgrCommandPdu& operator=( const DtLgrCommandPdu& src );
00058 
00059    //@(
00061    virtual int commandDomain() const;
00062    virtual void setCommandDomain( int domain);
00064 
00065    //@(
00067    virtual int commandProtocol() const;
00068    virtual void setCommandProtocol( int protocol);
00070 
00071    //@(
00073    virtual int command() const;
00074    virtual void setCommand( int commandId);
00076 
00077    //@(
00079    virtual const char* parametersBuffer() const;
00080    virtual void setParametersBuffer(const DtString& paramsBuffer);
00082 
00084    virtual void printDataToStream(std::ostream& stream) const;
00085 
00087    virtual const char* commandString() const;
00088 
00090    virtual const char* domainString() const;
00091 
00093    virtual const char* protocolString() const;
00094 
00095 public:
00096 
00097    static void setDomainToString(DtDomainToStringFunc func);
00098    static void setProtocolToString(DtProtocolToStringFunc func);
00099    static void setCommandToString(DtCommandToStringFunc func);
00100 
00101 protected:
00102 
00104    virtual DtLgrCommandData* params() const;
00105 
00107    void initData();
00108 
00109 protected:
00110 
00111    static DtDomainToStringFunc theDomainToStringFunc;
00112    static DtProtocolToStringFunc theProtocolToStringFunc;
00113    static DtCommandToStringFunc theCommandToStringFunc;
00114 };

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)