Skip to content

Commit

Permalink
Merge pull request #1050 from sstsimulator/devel
Browse files Browse the repository at this point in the history
Automatically Merged using SST Master Branch Merger
  • Loading branch information
sst-autotester committed Mar 4, 2024
2 parents 3f85d16 + e023c0b commit ef659c9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/sst/core/unitAlgebra.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,27 +256,53 @@ class UnitAlgebra :
ImplementSerializable(SST::UnitAlgebra)

public:
/** Base exception for all exception classes in UnitAlgebra
*
* This exception inherits from std::logic_error, as all exceptions
* thrown in UnitAlgebra are considered configuration errors occurring
* prior to simulation start, rather than runtime errors.
*/
class UnitAlgebraException : public std::logic_error
{
public:
/**
* @param msg exception message displayed as-is without modification
*/
UnitAlgebraException(const std::string& msg);
};

/** Exception for when units are not recognized or are invalid
*/
class InvalidUnitType : public UnitAlgebraException
{
public:
/**
* @param type string containing invalid type
*/
InvalidUnitType(const std::string& type);
};

/** Exception for when number couldn't be parsed
*/
class InvalidNumberString : public UnitAlgebraException
{
public:
/**
* @param number string containing invalid number
*/
InvalidNumberString(const std::string& number);
};

/** Exception for when attempting operations between objects that do not have matching base units
*/
class NonMatchingUnits : public UnitAlgebraException
{
public:
/**
* @param lhs units for UnitAlgebra on left-hand side of operation
* @param rhs units for UnitAlgebra on right-hand side of operation
* @param operation representation of operation attempted between units
*/
NonMatchingUnits(const std::string& lhs, const std::string& rhs, const std::string& operation);
};
};
Expand Down

0 comments on commit ef659c9

Please sign in to comment.