1 #ifndef INCLUDED_ObjexxFCL_Dimension_hh
2 #define INCLUDED_ObjexxFCL_Dimension_hh
29 #include <type_traits>
153 return static_cast< double >(
value_ );
274 if (
this != &dim ) {
287 assign_if(
int const i,
double const m = 1.0 );
292 assign_if(
double const d,
double const m = 1.0 );
503 if (
this != &dim ) {
522 if (
this != &dim ) {
648 int const now_value = ( now_initialized ?
exp_p_->
ivalue() : 0 );
697 return !( dim1 == dim2 );
751 return !( i == dim );
805 return !( dim == i );
859 return !( d == dim );
913 return !( dim == d );
955 operator >>( std::istream & stream, Dimension & dim );
960 operator <<( std::ostream & stream, Dimension
const & dim );
966 #ifndef NO_STD_SWAP_OVERLOADS
991 #endif // NO_STD_SWAP_OVERLOADS
994 #endif // INCLUDED_ObjexxFCL_Dimension_HH
std::istream & operator>>(std::istream &stream, byte &b)
Stream Input.
bool constant() const
Constant?
bool reference() const
Reference?
virtual DimensionExpression * clone() const =0
Clone.
Dimension(Expression const &exp)
Expression Constructor.
Dimension & assign_if_bigger_nic(int const i)
int Assignment if Bigger than Value: Notify if Changed
Dimension * clone() const
Clone.
bool operator!=(byte const &i, byte const &j)
byte != byte
void destructed(Subject const &subject)
Update for Destruction of a Subject.
Dimension & swap_no_notify(Dimension &dim)
Swap Without Notification.
void reduce_expression()
Reduce Expression.
void update_notify_if_changed()
Update and Notify if External State Changed.
bool operator>=(byte const &i, byte const &j)
byte >= byte
virtual bool initialized() const =0
Initialized?
static void swap(T &x, T &y)
Dimension & operator-=(Dimension const &dim)
-= Dimension
Dimension & operator*=(Dimension const &dim)
*= Dimension
virtual int ivalue() const
Integer Value.
Dimension & assign_if_half_nic(int const i)
int Assignment if Bigger than Value or Smaller than Half Value: Notify if Changed ...
bool operator<=(byte const &i, byte const &j)
byte <= byte
void remove_as_observer()
Remove as Observer of the Expression's Referenced Dimensions.
Expression * exp_p_
Expression pointer (owned)
Dimension & operator++()
++Dimension
Dimension & assign_if(int const i, double const m=1.0)
int Assignment if Bigger than Value or Smaller than Multiplier * Value
virtual bool reference() const =0
Reference?
Dimension & clear_no_notify()
Clear the Dimension Without Notification.
Dimension & operator/=(Dimension const &dim)
/= Dimension
Dimension & assign_value_of(Dimension const &dim)
Dimension Value-Semantics Assignment.
virtual void insert_observer(Observer &) const =0
Insert an Observer.
Dimension & assign_if_bigger(int const i)
int Assignment if Bigger than Value
Dimension & operator=(Dimension const &dim)
Copy Assignment: Creates a reference to the passed Dimension.
int value_
Cached value: Kept in synch with expression value (0 if uninitialized)
void swap_no_notify(Dimension &a, Dimension &b)
Swap.
ObserverMulti: Combined Subject + Multi Observer Abstract Base Class.
virtual bool reducible() const =0
Reducible?
virtual bool constant() const =0
Constant?
virtual void destructed(Subject const &)=0
Update for Destruction of a Subject.
void insert_as_observer_of(Dimension const &dim)
Insert as Observer of an Expression's Referenced Dimensions.
Dimension & assign_if_nic(int const i, double const m=1.0)
int Assignment if Bigger than Value or Smaller than Multiplier * Value: Notify if Changed ...
Dimension * reference_copy() const
Reference Copy.
bool initialized() const
Initialized?
Dimension(Expression *exp_p_a)
Expression Pointer Constructor (Ownership Transfer)
DynamicIndexRange: Dynamic Index Range.
int operator()() const
Value.
void insert_observer(Observer &observer) const
Insert an Observer.
void notify() const
Notify Observers That This Subject Has Changed.
Observer: Combined Subject + Observer Abstract Base Class.
Dimension & operator--()
–Dimension
int zvalue() const
Value: Zero if Uninitialized.
DimensionExpression Expression
virtual ~Dimension()
Destructor.
DimensionExpression: DimensionExpression Interface Class.
Dimension & clear()
Clear the Dimension.
Dimension & operator+=(Dimension const &dim)
+= Dimension
virtual void remove_observer(Observer &) const =0
Remove an Observer.
bool operator>(byte const &i, byte const &j)
byte > byte
Expression const & exp() const
Expression.
Dimension: Dynamic Dimension.
bool operator<(byte const &i, byte const &j)
byte < byte
void swap(CArray< T > &a, CArray< T > &b)
Swap.
Expression * exp_clone() const
Expression Clone.
std::ostream & operator<<(std::ostream &stream, CArray< T > const &a)
stream << CArray
Dimension & assign_if_half(int const i)
int Assignment if Bigger than Value or Smaller than Half Value
bool operator==(byte const &i, byte const &j)
byte == byte
bool initialized_
Cached initialization state.
Dimension()
Default Constructor.
bool reducible() const
Reducible?
void update_notify()
Update and Notify.
void insert_as_observer_of(Expression const &exp)
Insert as Observer of an Expression's Referenced Dimensions.
Expression const * exp_p() const
Expression Pointer.
Dimension & swap(Dimension &dim)
Swap.
void insert_as_observer()
Insert as Observer of the Expression's Referenced Dimensions.