VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfSqliteDatabaseConnection.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 #include <vlutil/vlFilename.h>
10 #include <atomic>
11 
12 struct sqlite3;
13 
17 {
18 public:
19 
22 
26  {
27  return new DtVrfSqliteDatabaseConnection();
28  };
29 
31  static DtString type()
32  {
33  return "sqlite-database-connection";
34  };
35 
36 protected:
37 
40 
42  virtual bool processConfiguration(const DtRwDatabaseLoggerConfig& config);
43 
45  virtual bool connect() { return true; }
46 
48  virtual bool createDatabase();
49 
51  virtual bool createTableForEvent(const DtVrfDatabaseEvent& event);
52 
55  virtual bool insertOrIgnoreEntriesForEvents(const DtVrfDatabaseEventVector& events);
56 
59  virtual bool insertOrUpdateEntriesForEvents(const DtVrfDatabaseEventVector& events);
60 
62  virtual bool updateEntryForEvent(const DtVrfDatabaseEvent& event);
63 
64 private:
65 
68 
71 
72 protected:
73 
74  DtFilename myFilename;
75 
76  sqlite3* myDb;
77 };
78 
79 
virtual bool updateEntryForEvent(const DtVrfDatabaseEvent &event)=0
Updates the given event in the database.
std::vector< DtVrfDatabaseEventUniquePtr > DtVrfDatabaseEventVector
Definition: vrfDatabaseEvent.h:183
Contains the configuration options for the database logger.
Definition: rwDatabaseLoggerConfig.h:21
virtual bool insertOrIgnoreEntriesForEvents(const DtVrfDatabaseEventVector &events)=0
Logs the given events to the database, ignoring duplicates. NOTE: All events in the list must be of t...
sqlite3 * myDb
Definition: vrfSqliteDatabaseConnection.h:76
virtual bool connect()
There is no server connection for SQLite.
Definition: vrfSqliteDatabaseConnection.h:45
static DtVrfDatabaseConnection * create()
Creator function for this class. Should not generally be called directly. Database Connection should ...
Definition: vrfSqliteDatabaseConnection.h:25
virtual bool createDatabase()=0
Creates the database.
virtual bool processConfiguration(const DtRwDatabaseLoggerConfig &config)
Processes the configuration for this connection.
DtVrfDatabaseConnection & operator=(const DtVrfDatabaseConnection &other)
Assignment Operator not implemented – Do Not copy.
static DtString type()
Type of this connection.
Definition: vrfSqliteDatabaseConnection.h:31
DtFilename myFilename
Definition: vrfSqliteDatabaseConnection.h:74
virtual bool insertOrUpdateEntriesForEvents(const DtVrfDatabaseEventVector &events)=0
Logs the given events to the database, updating duplicates. NOTE: All events in the list must be of t...
virtual bool createTableForEvent(const DtVrfDatabaseEvent &event)=0
Creates a table a database table, if necessary.
The base class for all database connections. The database connection is responsible for reading queue...
Definition: vrfDatabaseConnection.h:24
Represents a single event to be recorded in the database. Anytime something occurs that requires data...
Definition: vrfDatabaseEvent.h:22
#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
Implements a database connection which will open a SQLite database to record any database events logg...
Definition: vrfSqliteDatabaseConnection.h:16

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)