Skip to content

Commit

Permalink
Additional documentation for the files: action.h, sstinfo.h, stringiz…
Browse files Browse the repository at this point in the history
…e.h, timeConverter.h, timeLord.h, unitAlgebra.h
  • Loading branch information
Neelamagam committed Feb 12, 2024
1 parent bda4ffe commit 26e1102
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 25 deletions.
3 changes: 3 additions & 0 deletions src/sst/core/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class Action : public Activity
protected:
/** Called to signal to the Simulation object to end the simulation */
void endSimulation();
/** Called to signal to the Simulation object to end the simulation
* @param end Simulation cycle when the simulation finishes
*/
void endSimulation(SimTime_t end);

NotSerializable(SST::Action)
Expand Down
27 changes: 22 additions & 5 deletions src/sst/core/sstinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,22 @@ class SSTInfoConfig : public ConfigShared
/** Clears the current filter map */
void clearFilterMap() { m_filters.clear(); }

/** Return the filter map */
/** @return Filter map */
FilterMap_t& getFilterMap() { return m_filters; }

/** Return the bit field of various command line options enabled. */
/** @return Bit field of various command line options enabled. */
unsigned int getOptionBits() { return m_optionBits; }

/** Return the user defined path the XML File. */
/** @return User defined path the XML File. */
std::string& getXMLFilePath() { return m_XMLFilePath; }

/** Is debugging output enabled? */
/** @return True if the debugging output is enabled, otherwise False */
bool debugEnabled() const { return m_debugEnabled; }
/** @return True if the m_filter multimap is emtpy, otherwise False */
bool processAllElements() const { return m_filters.empty(); }
/** @return True if command line options are enabled and verbose configuration is valid, otherwise False */
bool doVerbose() const { return m_optionBits & CFG_VERBOSE; }
/** @return True if interactive is enabled, otherwise False */
bool interactiveEnabled() const { return m_interactive; }
void addFilter(const std::string& name);

Expand Down Expand Up @@ -191,10 +194,24 @@ class SSTLibraryInfo
/** Set filters based on search term */
void filterSearch(std::stringstream& outputStream, std::string tag, std::string searchTerm);

/** Filter output from info map*/
/** Filter output from info map
* @return True if the library filter is defined, otherwise False
*/
bool getFilter() { return m_libraryFilter; }
/**
* Clears the component filter and sets the internal library filter status
* @param libFilter
*/
void resetFilters(bool libFilter) { m_libraryFilter = libFilter, m_componentFilters.clear(); }
/**
* Sets the internal library filter status
* @param libFilter
*/
void setLibraryFilter(bool filter) { m_libraryFilter = filter; }
/**
* Adds the component filter string to the end of the internal vector of components
* @param component
*/
void setComponentFilter(std::string component) { m_componentFilters.push_back(component); }

template <class BaseType>
Expand Down
2 changes: 1 addition & 1 deletion src/sst/core/stringize.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct escaped_list_separator
{}

/**
* @return pair<iter, iter> = <tok_end, next_tok>
* Sets pair<iter, iter> = <tok_end, next_tok>
*/
void operator()(iter& first, iter last, std::string& token)
{
Expand Down
9 changes: 4 additions & 5 deletions src/sst/core/timeConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,24 @@ class TimeConverter
public:
/**
Converts from the component's view to the core's view of time.
\param time time to convert to core time
@param time time to convert to core time
*/
SimTime_t convertToCoreTime(SimTime_t time) const { return time * factor; }

/**
Converts from the core's view to the components's view of time.
The result is truncated, not rounded.
\param time time to convert from core time
@param time time to convert from core time
*/
SimTime_t convertFromCoreTime(SimTime_t time) const { return time / factor; }

/**
* Return the factor used for conversions with Core Time
* @return The factor used for conversions with Core Time
*/
SimTime_t getFactor() const { return factor; }

/**
Return the period represented by this TimeConverter as a
UnitAlgebra
@return The period represented by this TimeConverter as a UnitAlgebra
*/
UnitAlgebra getPeriod() const; // Implemented in timeLord.cc

Expand Down
8 changes: 4 additions & 4 deletions src/sst/core/timeLord.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ class TimeLord
TimeConverter* getTimeConverter(const UnitAlgebra& ts);

/**
* Return the Time Base of the TimeLord
* @return Time Base of the TimeLord
*/
UnitAlgebra getTimeBase() const { return timeBase; }

/** Return a TimeConverter which represents Nanoseconds */
/** @return TimeConverter which represents Nanoseconds */
TimeConverter* getNano() { return nano; }
/** Return a TimeConverter which represents Microseconds */
/** @return TimeConverter which represents Microseconds */
TimeConverter* getMicro() { return micro; }
/** Return a TimeConverter which represents Milliseconds */
/** @return TimeConverter which represents Milliseconds */
TimeConverter* getMilli() { return milli; }

/** Not a Public API.
Expand Down
22 changes: 12 additions & 10 deletions src/sst/core/unitAlgebra.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class Units

// Non-static data members and functions
/** Create a new instantiation of a Units with a base unit string, and multiplier
* \param units String representing the new unit
* \param multiplier Value by which to multiply to get to this unit
* @param units String representing the new unit
* @param multiplier Value by which to multiply to get to this unit
*/
Units(const std::string& units, sst_big_num& multiplier);
Units() {}
Expand Down Expand Up @@ -120,8 +120,8 @@ class UnitAlgebra :
/**
Create a new UnitAlgebra instance, and pre-populate with a parsed value.
\param val Value to parse. It is of the following format:
\code
@param val Value to parse. It is of the following format:
@code
val := NUMBER( )?UNITS
NUMBER := (-)?[0-9]+(.[0-9]+)?
UNITS := UNITGROUP(/UNITGROUP)
Expand All @@ -130,7 +130,7 @@ class UnitAlgebra :
SIPREFIX := {a,f,p,n,u,m,[kKMGTPE]i?}
BASEUNIT := {s,B,b,events}
COMPUNIT := {Hz,hz,Bps,bps,event}
\endcode
@endcode
*/
UnitAlgebra(const std::string& val);
virtual ~UnitAlgebra();
Expand All @@ -139,21 +139,23 @@ class UnitAlgebra :
UnitAlgebra(const UnitAlgebra&) = default;

/** Print to an ostream the value
* \param precision Number of digits to print. Default is 6. <= 0 is full precision.
* @param stream Output stream
* @param precision Number of digits to print. Default is 6. <= 0 is full precision.
*/
void print(std::ostream& stream, int32_t precision = 6);
/** Print to an ostream the value
* Formats the number using SI-prefixes
* \param precision Number of digits to print. Default is 6. <= 0 is full precision.
* @param stream Output stream
* @param precision Number of digits to print. Default is 6. <= 0 is full precision.
*/
void printWithBestSI(std::ostream& stream, int32_t precision = 6);
/** Return a string representation of this value
* \param precision Number of digits to print. Default is 6. <= 0 is full precision.
* @param precision Number of digits to print. Default is 6. <= 0 is full precision.
*/
std::string toString(int32_t precision = 6) const;
/** Return a string representation of this value
* Formats the number using SI-prefixes
* \param precision Number of digits to print. Default is 6. <= 0 is full precision.
* @param precision Number of digits to print. Default is 6. <= 0 is full precision.
*/
std::string toStringBestSI(int32_t precision = 6) const;

Expand Down Expand Up @@ -220,7 +222,7 @@ class UnitAlgebra :
bool hasUnits(const std::string& u) const;
/** Return the raw value */
sst_big_num getValue() const { return value; }
/** Return the rounded value as a 64bit integer */
/** @return Rounded value as a 64bit integer */
int64_t getRoundedValue() const;
double getDoubleValue() const;
bool isValueZero() const;
Expand Down

0 comments on commit 26e1102

Please sign in to comment.