VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfDatabaseEventParam.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
9 
12 {
13 public:
14 
20 
22  virtual ~DtVrfDatabaseEventParam();
23 
26 
32  virtual std::string paramName(unsigned subParamIndex = 0) const = 0;
33 
39  virtual std::string paramType(unsigned subParamIndex = 0) const = 0;
40 
46  virtual std::string paramValueString(unsigned subParamIndex = 0) const = 0;
47 
52  virtual unsigned numberOfSubParams() const { return 1; };
53 
55  virtual bool isPrimaryKey() const = 0;
56 
58  virtual DtVrfDatabaseEventParam* clone() = 0;
59 
62  static void setSqlEscapeStringFcn(std::function<std::string(std::string)> fcn);
63 
64 protected:
65 
69  static inline std::string escapeString(std::string str);
70 
71  static std::function<std::string(std::string)> theEscapeStrFcn;
72 };
73 
75 template <typename T>
77 {
78 public:
79 
81  DtTemplatedDatabaseEventParam<T>(const DtString& name, T val, bool isPrimarykey = false);
82 
85 
88 
90  virtual ~DtTemplatedDatabaseEventParam<T>() override;
91 
94 
96  inline virtual DtVrfDatabaseEventParam* clone() override;
97 
98  //\copydoc DtVrfDatabaseEventParam::paramName()
99  inline virtual std::string paramName(unsigned subParamIndex = 0) const override;
100 
101  //\copydoc DtVrfDatabaseEventParam::paramType()
102  inline virtual std::string paramType(unsigned subParamIndex = 0) const override;
103 
104  //\copydoc DtVrfDatabaseEventParam::paramValueString()
105  inline virtual std::string paramValueString(unsigned subParamIndex = 0) const override;
106 
108  inline virtual T paramValue() const;
109 
110  //\copydoc DtVrfDatabaseEventParam::numberOfSubParams()
111  inline virtual unsigned numberOfSubParams() const override;
112 
113  //\copydoc DtVrfDatabaseEventParam::isPrimaryKey()
114  inline virtual bool isPrimaryKey() const override;
115 
116 protected:
118  T myVal;
120 };
121 
122 
123 #include <vrfMsgTransport/vrfDatabaseEventParam.inl>
DtString myName
Definition: vrfDatabaseEventParam.h:117
static std::function< std::string(std::string)> theEscapeStrFcn
Definition: vrfDatabaseEventParam.h:71
virtual unsigned numberOfSubParams() const override
For most parameters, this is just one, as there is one DtVrfDatabaseEventParam per database parameter...
Stores the parameter for a DtVrfDatabaseEvent.
Definition: vrfDatabaseEventParam.h:76
virtual T paramValue() const
The stored value for this parameter.
virtual std::string paramName(unsigned subParamIndex=0) const override
Returns the name of the parameter. The subParamIndex is not necessary for most parameters, but some params end up translating into multiple parameters in the database. If numberOfSubParams() returns a value greater than 0, then specifying this will return the name of that specific sub-parameter.
virtual bool isPrimaryKey() const override
Returns true if this parameter is the primary key of the table.
Abstract base class to store the parameter for a DtVrfDatabaseEvent.
Definition: vrfDatabaseEventParam.h:11
T myVal
Definition: vrfDatabaseEventParam.h:118
virtual unsigned numberOfSubParams() const
For most parameters, this is just one, as there is one DtVrfDatabaseEventParam per database parameter...
Definition: vrfDatabaseEventParam.h:52
DtTemplatedDatabaseEventParam< T > & operator=(const DtTemplatedDatabaseEventParam< T > &)
Assignment operator.
virtual std::string paramValueString(unsigned subParamIndex=0) const override
Returns a stringified version of the value of this parameter. The subParamIndex is not necessary for ...
#define DT_DLL_vrfMsgTransport
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfCommunicationManagerDefines.h:26
virtual std::string paramType(unsigned subParamIndex=0) const override
Returns the string of the type of this parameter. The subParamIndex is not necessary for most paramet...
bool myIsPrimaryKey
Definition: vrfDatabaseEventParam.h:119
virtual DtVrfDatabaseEventParam * clone() override
Makes a new copy of this parameter.

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)