Skip to content

Commit

Permalink
doc: better docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Oct 7, 2024
1 parent 6c022d9 commit fae9797
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/iguana/services/GlobalParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ namespace iguana {
/// option will be _chosen_ by `ConcurrentParamFactory::Create` instead
extern GlobalParam<std::string> GlobalConcurrencyModel;

/// @brief RCDB URL
/// @par Notes
/// The RCDB will check for a URL in the following order:
/// - This parameter, `iguana::GlobalRcdbUrl`; by default it is not set to any value
/// - The environment variable `RCDB_CONNECTION` (which is likely set if you are on `ifarm`)
/// - A default URL, which will be printed in a warning; see `iguana::RCDBReader::m_default_url`
/// @brief Path to the RCDB
/// @see `iguana::RCDBReader` for details
extern GlobalParam<std::string> GlobalRcdbUrl;

}
11 changes: 10 additions & 1 deletion src/iguana/services/RCDBReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
namespace iguana {

/// @brief RCDB reader
///
/// This class interfaces to the RCDB. The database connection path is chosen from one of the following, in order:
/// - The global variable `iguana::GlobalRcdbUrl`; by default this is not set to any value (its type is `iguana::GlobalParam`)
/// - The environment variable `RCDB_CONNECTION` (which is likely set if you are on `ifarm`)
/// - A default URL, which will be printed in a warning; see `iguana::RCDBReader::m_default_url`
///
/// RCDB will automatically use `mariadb` / `mysql` or `sqlite`, depending on the RCDB path, and whether you have satisfied the dependencies.
class RCDBReader : public Object
{

Expand All @@ -23,11 +30,13 @@ namespace iguana {
/// @returns the beam energy in GeV
double GetBeamEnergy(int const runnum);

private:
protected:

/// @brief default RCDB URL, used as a last resort
std::string const m_default_url = "mysql://[email protected]/rcdb";

private:

std::string m_url;
std::once_flag m_error_once;

Expand Down

0 comments on commit fae9797

Please sign in to comment.