VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfMessageFactory.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
6 #pragma once
7 
11 
13 
14 #include <vector>
15 #include <map>
16 
17 namespace makVrf
18 {
19 
20 class DtBaseMessage;
21 
23 typedef DtBaseMessage* (*Decoder)(unsigned char* bytes, int length);
24 
27 {
28  public:
31  DtMessageFactory(bool initializeDefaults = true, bool isBigEndian = false);
32 
34  virtual ~DtMessageFactory();
35 
37  virtual DtBaseMessage* create(unsigned char* bytes, int length);
38  virtual DtBaseMessage* create(int msgType, unsigned char* bytes, int length);
39 
41  virtual void registerCreator(unsigned int type, Decoder decoder);
42 
44  virtual void initializeDefaultMessages();
45 
47  virtual void clear();
48 
49  protected:
50  typedef std::map<unsigned int, Decoder> DecoderMap;
53 };
54 
55 }
#define DT_DLL_DEBUGDRAWCONNECTOR
Definition: export.h:15
std::map< unsigned int, Decoder > DecoderMap
Definition: vrfMessageFactory.h:50
DtBaseMessage is the base class for all messages that can be sent between the server and the client...
Definition: vrfMessage.h:25
bool myIsBigEndian
Definition: vrfMessageFactory.h:52
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
DtBaseMessage *(* Decoder)(unsigned char *bytes, int length)
typedef of message decoder function
Definition: vrfMessageFactory.h:23
the DtMessageFactory class
Definition: vrfMessageFactory.h:26
DecoderMap myCreatorMap
Definition: vrfMessageFactory.h:51

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)