TwiceAsNice  2019-02-18
Public Types | Public Member Functions | Private Attributes | 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:
Inheritance graph
Collaboration diagram for INDI::AlignmentSubsystem::InMemoryDatabase:
Collaboration graph

Public Types

typedef std::vector< AlignmentDatabaseEntryAlignmentDatabaseType
 
typedef void(* LoadDatabaseCallbackPointer_t) (void *)
 

Public Member Functions

 InMemoryDatabase ()
 Default constructor. More...
 
virtual ~InMemoryDatabase ()
 Virtual destructor. More...
 
bool CheckForDuplicateSyncPoint (const AlignmentDatabaseEntry &CandidateEntry, double Tolerance=0.1) const
 Check if a entry already exists in the database. More...
 
AlignmentDatabaseTypeGetAlignmentDatabase ()
 Get a reference to the in memory database. More...
 
bool GetDatabaseReferencePosition (ln_lnlat_posn &Position)
 Get the database reference position. More...
 
bool LoadDatabase (const char *DeviceName)
 Load the database from persistent storage. More...
 
bool SaveDatabase (const char *DeviceName)
 Save the database to persistent storage. More...
 
void SetDatabaseReferencePosition (double Latitude, double Longitude)
 Set the database reference position. More...
 
void SetLoadDatabaseCallback (LoadDatabaseCallbackPointer_t CallbackPointer, void *ThisPointer)
 Set the function to be called when the database is loaded or reloaded. More...
 

Private Attributes

AlignmentDatabaseType MySyncPoints
 
ln_lnlat_posn DatabaseReferencePosition
 
bool DatabaseReferencePositionIsValid
 
LoadDatabaseCallbackPointer_t LoadDatabaseCallback
 
void * LoadDatabaseCallbackThisPointer
 

Detailed Description

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

Member Typedef Documentation

◆ AlignmentDatabaseType

◆ LoadDatabaseCallbackPointer_t

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

Constructor & Destructor Documentation

◆ InMemoryDatabase()

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

Default constructor.

◆ ~InMemoryDatabase()

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

Virtual destructor.

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

◆ GetAlignmentDatabase()

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

Get a reference to the in memory database.

Returns
A reference to the in memory database.

◆ GetDatabaseReferencePosition()

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

Get the database reference position.

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

◆ 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

◆ 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

◆ SetDatabaseReferencePosition()

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

Set the database reference position.

Parameters
[in]Latitude
[in]Longitude

◆ 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

Member Data Documentation

◆ DatabaseReferencePosition

ln_lnlat_posn INDI::AlignmentSubsystem::InMemoryDatabase::DatabaseReferencePosition
private

◆ DatabaseReferencePositionIsValid

bool INDI::AlignmentSubsystem::InMemoryDatabase::DatabaseReferencePositionIsValid
private

◆ LoadDatabaseCallback

LoadDatabaseCallbackPointer_t INDI::AlignmentSubsystem::InMemoryDatabase::LoadDatabaseCallback
private

◆ LoadDatabaseCallbackThisPointer

void* INDI::AlignmentSubsystem::InMemoryDatabase::LoadDatabaseCallbackThisPointer
private

◆ MySyncPoints

AlignmentDatabaseType INDI::AlignmentSubsystem::InMemoryDatabase::MySyncPoints
private

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