Instrument Neutral Distributed Interface INDI 2.2.5
Public Types | Public Member Functions | List of all members
INDI::AlignmentSubsystem::InMemoryDatabase Class Reference

This class provides the driver side API to the in memory alignment database. More...

#include <InMemoryDatabase.h>

Inheritance diagram for INDI::AlignmentSubsystem::InMemoryDatabase:
INDI::AlignmentSubsystem::MapPropertiesToInMemoryDatabase INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers AstroTrac DSC Scope ScopeSim ScopeSim SkywatcherAPIMount MockScopeSimDriver MockScopeSimDriver

Public Types

typedef std::vector< AlignmentDatabaseEntry > AlignmentDatabaseType
 
typedef void(* LoadDatabaseCallbackPointer_t) (void *)
 

Public Member Functions

 InMemoryDatabase ()
 Default constructor.
 
virtual ~InMemoryDatabase ()
 Virtual destructor.
 
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.
 
bool SaveDatabase (const char *DeviceName)
 Save the database to persistent storage.
 
void SetDatabaseReferencePosition (double Latitude, double Longitude)
 Set the database reference position.
 
void SetDatabaseReferencePosition (const IGeographicCoordinates &Position)
 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.
 

Detailed Description

This class provides the driver side API to the in memory alignment database.

Definition at line 23 of file InMemoryDatabase.h.

Member Typedef Documentation

◆ AlignmentDatabaseType

Definition at line 32 of file InMemoryDatabase.h.

◆ LoadDatabaseCallbackPointer_t

typedef void(* INDI::AlignmentSubsystem::InMemoryDatabase::LoadDatabaseCallbackPointer_t) (void *)

Definition at line 77 of file InMemoryDatabase.h.

Constructor & Destructor Documentation

◆ InMemoryDatabase()

INDI::AlignmentSubsystem::InMemoryDatabase::InMemoryDatabase ( )

Default constructor.

Definition at line 23 of file InMemoryDatabase.cpp.

◆ ~InMemoryDatabase()

virtual INDI::AlignmentSubsystem::InMemoryDatabase::~InMemoryDatabase ( )
inlinevirtual

Virtual destructor.

Definition at line 30 of file InMemoryDatabase.h.

Member Function Documentation

◆ CheckForDuplicateSyncPoint()

bool INDI::AlignmentSubsystem::InMemoryDatabase::CheckForDuplicateSyncPoint ( const AlignmentDatabaseEntry &  CandidateEntry,
double  Tolerance = 0.1 
) const

Check if a entry already exists in the database.

Parameters
[in]CandidateEntryThe candidate entry to check
[in]ToleranceThe % tolerance used in the checking process (default 0.1%)
Returns
True if an entry already exists within the required tolerance

Definition at line 28 of file InMemoryDatabase.cpp.

◆ GetAlignmentDatabase()

AlignmentDatabaseType & INDI::AlignmentSubsystem::InMemoryDatabase::GetAlignmentDatabase ( )
inline

Get a reference to the in memory database.

Returns
A reference to the in memory database.

Definition at line 49 of file InMemoryDatabase.h.

◆ GetDatabaseReferencePosition()

bool INDI::AlignmentSubsystem::InMemoryDatabase::GetDatabaseReferencePosition ( IGeographicCoordinates &  Position)

Get the database reference position.

Parameters
[in]PositionA pointer to a IGeographicCoordinates object to return the current position in
Returns
True if successful

Definition at line 57 of file InMemoryDatabase.cpp.

◆ LoadDatabase()

bool INDI::AlignmentSubsystem::InMemoryDatabase::LoadDatabase ( const char *  DeviceName)

Load the database from persistent storage.

Parameters
[in]DeviceNameThe name of the current device.
Returns
True if successful

Definition at line 68 of file InMemoryDatabase.cpp.

◆ RemoveSyncPoint()

void INDI::AlignmentSubsystem::InMemoryDatabase::RemoveSyncPoint ( const AlignmentDatabaseEntry &  CandidateEntry,
double  Tolerance = 0.1 
)

Remove a sync point that falls within the tolerance of a candidate point.

Parameters
[in]CandidateEntryThe candidate entry to check
[in]ToleranceThe % tolerance used in the checking process (default 0.1%)

Definition at line 41 of file InMemoryDatabase.cpp.

◆ SaveDatabase()

bool INDI::AlignmentSubsystem::InMemoryDatabase::SaveDatabase ( const char *  DeviceName)

Save the database to persistent storage.

Parameters
[in]DeviceNameThe name of the current device.
Returns
True if successful

Definition at line 177 of file InMemoryDatabase.cpp.

◆ SetDatabaseReferencePosition() [1/2]

void INDI::AlignmentSubsystem::InMemoryDatabase::SetDatabaseReferencePosition ( const IGeographicCoordinates &  Position)

Set the database reference position.

Parameters
[in]Position

Definition at line 248 of file InMemoryDatabase.cpp.

◆ SetDatabaseReferencePosition() [2/2]

void INDI::AlignmentSubsystem::InMemoryDatabase::SetDatabaseReferencePosition ( double  Latitude,
double  Longitude 
)

Set the database reference position.

Parameters
[in]Latitude
[in]Longitude

Definition at line 240 of file InMemoryDatabase.cpp.

◆ SetLoadDatabaseCallback()

void INDI::AlignmentSubsystem::InMemoryDatabase::SetLoadDatabaseCallback ( LoadDatabaseCallbackPointer_t  CallbackPointer,
void *  ThisPointer 
)

Set the function to be called when the database is loaded or reloaded.

Parameters
[in]CallbackPointerA pointer to the class function to call
[in]ThisPointerA pointer to the class object of the callback function

Definition at line 254 of file InMemoryDatabase.cpp.


The documentation for this class was generated from the following files: