10 #ifndef LOFAR_PARMDB_SOURCEDBBLOB_H
11 #define LOFAR_PARMDB_SOURCEDBBLOB_H
37 void lock(
bool lockForWrite)
override;
61 unsigned int addPatch(
const std::string& patchName,
int catType,
62 double apparentBrightness,
double ra,
double dec,
66 void updatePatch(
unsigned int patchId,
double apparentBrightness,
double ra,
78 const ParmMap& defaultParameters,
double ra,
double dec,
86 int catType,
double apparentBrightness,
87 const ParmMap& defaultParameters,
double ra,
double dec,
93 std::vector<std::string>
getPatches(
int category,
const std::string& pattern,
95 double maxBrightness)
override;
98 std::vector<PatchInfo>
getPatchInfo(
int category,
const std::string& pattern,
100 double maxBrightness)
override;
104 const std::string& patchName)
override;
108 const std::string& patchName)
override;
114 std::vector<SourceInfo>
getSources(
const std::string& pattern)
override;
137 std::fstream itsFile;
138 std::shared_ptr<blob::BlobIBufStream> itsBufIn;
139 std::shared_ptr<blob::BlobOBufStream> itsBufOut;
140 std::shared_ptr<blob::BlobIStream> itsBlobIn;
141 std::shared_ptr<blob::BlobOStream> itsBlobOut;
144 std::map<std::string, PatchInfo> itsPatches;
145 std::map<std::string, std::vector<SourceData>>
Base class for a table holding sources and their parameters.
A map of parameter name to value set.
Definition: ParmMap.h:30
Class for a Blob file holding source parameters.
Definition: SourceDBBlob.h:28
bool sourceExists(const std::string &sourceName) override
Test if the source already exists.
void addSource(const SourceInfo &sourceInfo, const std::string &patchName, int catType, double apparentBrightness, const ParmMap &defaultParameters, double ra, double dec, bool check) override
void updatePatch(unsigned int patchId, double apparentBrightness, double ra, double dec) override
Update the ra/dec and apparent brightness of a patch.
std::vector< std::string > findDuplicatePatches() override
Find non-unique patch names.
void clearTables() override
Clear file (i.e. remove everything).
void lock(bool lockForWrite) override
std::vector< std::string > getPatches(int category, const std::string &pattern, double minBrightness, double maxBrightness) override
SourceInfo getSource(const std::string &sourceName) override
Get the source info of the given source.
std::vector< SourceInfo > getPatchSources(const std::string &patchName) override
Get the sources belonging to the given patch.
bool patchExists(const std::string &patchName) override
Test if the patch already exists.
void addSource(const SourceData &source, bool check) override
unsigned int addPatch(const std::string &patchName, int catType, double apparentBrightness, double ra, double dec, bool check) override
void checkDuplicates() override
void deleteSources(const std::string &sourceNamePattern) override
SourceDBBlob(const ParmDBMeta &pdm, bool forceNew)
void rewind() override
Reset to the beginning of the file.
std::vector< std::string > findDuplicateSources() override
Find non-unique source names.
std::vector< PatchInfo > getPatchInfo(int category, const std::string &pattern, double minBrightness, double maxBrightness) override
Get the info of all patches (name, ra, dec).
std::vector< SourceData > getPatchSourceData(const std::string &patchName) override
Get all data of the sources belonging to the given patch.
void getNextSource(SourceData &src) override
std::vector< SourceInfo > getSources(const std::string &pattern) override
Get the info of all sources matching the given (filename like) pattern.
bool atEnd() override
Tell if we are the end of the file.
void addSource(const SourceInfo &sourceInfo, const std::string &patchName, const ParmMap &defaultParameters, double ra, double dec, bool check) override
Abstract base class for a table holding source parameters.
Definition: SourceDB.h:29
Class holding a data of a source.
Definition: SourceData.h:31
Info about a source.
Definition: SourceInfo.h:29
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53