Instrument Neutral Distributed Interface INDI 2.2.5
InMemoryDatabase.h
Go to the documentation of this file.
1
9#pragma once
10
11#include "Common.h"
12
13#include "libastro.h"
14
15#include <vector>
16
17namespace INDI
18{
19namespace AlignmentSubsystem
20{
24{
25 public:
28
30 virtual ~InMemoryDatabase() {}
31
32 typedef std::vector<AlignmentDatabaseEntry> AlignmentDatabaseType;
33
34 // Public methods
35
40 bool CheckForDuplicateSyncPoint(const AlignmentDatabaseEntry &CandidateEntry, double Tolerance = 0.1) const;
41
45 void RemoveSyncPoint(const AlignmentDatabaseEntry &CandidateEntry, double Tolerance = 0.1);
46
50 {
51 return MySyncPoints;
52 }
53
58
62 bool LoadDatabase(const char *DeviceName);
63
67 bool SaveDatabase(const char *DeviceName);
68
72 void SetDatabaseReferencePosition(double Latitude, double Longitude);
76
77 typedef void (*LoadDatabaseCallbackPointer_t)(void *);
78
82 void SetLoadDatabaseCallback(LoadDatabaseCallbackPointer_t CallbackPointer, void *ThisPointer);
83
84 private:
85 AlignmentDatabaseType MySyncPoints;
86 IGeographicCoordinates DatabaseReferencePosition;
87 bool DatabaseReferencePositionIsValid;
88 LoadDatabaseCallbackPointer_t LoadDatabaseCallback;
89 void *LoadDatabaseCallbackThisPointer;
90};
91
92} // namespace AlignmentSubsystem
93} // namespace INDI
This class provides the driver side API to the in memory alignment database.
bool SaveDatabase(const char *DeviceName)
Save the database to persistent storage.
void SetDatabaseReferencePosition(double Latitude, double Longitude)
Set the database reference position.
void SetLoadDatabaseCallback(LoadDatabaseCallbackPointer_t CallbackPointer, void *ThisPointer)
Set the function to be called when the database is loaded or reloaded.
std::vector< AlignmentDatabaseEntry > AlignmentDatabaseType
bool CheckForDuplicateSyncPoint(const AlignmentDatabaseEntry &CandidateEntry, double Tolerance=0.1) const
Check if a entry already exists in the database.
void RemoveSyncPoint(const AlignmentDatabaseEntry &CandidateEntry, double Tolerance=0.1)
Remove a sync point that falls within the tolerance of a candidate point.
AlignmentDatabaseType & GetAlignmentDatabase()
Get a reference to the in memory database.
bool GetDatabaseReferencePosition(IGeographicCoordinates &Position)
Get the database reference position.
bool LoadDatabase(const char *DeviceName)
Load the database from persistent storage.
virtual ~InMemoryDatabase()
Virtual destructor.
Namespace to encapsulate INDI client, drivers, and mediator classes.
Entry in the in memory alignment database.
Definition Common.h:152