IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.Counter Struct Reference

Represents a real number. More...

+ Inheritance diagram for IG.Num.Counter:
+ Collaboration diagram for IG.Num.Counter:

Public Member Functions

 Counter (Counter v)
 
void Copy (Counter s)
 Copies a counter to the current counter. More...
 
void Copy (long l)
 Copies double to the current counter. More...
 
int Compare (Counter a, Counter b)
 
override bool Equals (object obj)
 Indicates whether obj is equal to this instance. More...
 
bool Equals (Counter a)
 Indicates whether a is equal to this instance. More...
 
override int GetHashCode ()
 Gets the hashcode of this Counter. More...
 
int CompareTo (Counter other)
 Compare this Counter with another Counter. More...
 
override string ToString ()
 Returns standard string representation of a counter, with decimal point and e for exponent, no 1000 separators, number of digits according to type accuracy. More...
 
string ToString (string format, IFormatProvider formatProvider)
 Returns a string representation of a counter in the specified way. More...
 
int read (string str)
 Reads in the value from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. More...
 
int Read (string str, int startpos)
 Reads in the value from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. More...
 
int Read (string str, int startpos, bool skipspaces)
 Reads in the value from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. More...
 
void Copy (string str)
 Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter. More...
 
bool TryCopy (string str)
 Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case. More...
 

Static Public Member Functions

static void Copy (Counter a, ref Counter res)
 Copies a counter to another (existing) counter in place. More...
 
static void Copy (long a, ref Counter res)
 Copies a number to an (existing) counter in place. More...
 
static Counter MinValue ()
 Creates a counter that contains minimal representable value. More...
 
static Counter MaxValue ()
 Creates a counter that contains maximal representable value. More...
 
static Counter operator+ (Counter s)
 
static Counter operator- (Counter s)
 
static Counter operator+ (Counter a, Counter b)
 
static Counter operator- (Counter a, Counter b)
 
static Counter operator* (Counter a, Counter b)
 
static Counter operator/ (Counter a, Counter b)
 
static bool operator== (Counter a, Counter b)
 
static bool operator!= (Counter a, Counter b)
 
static bool operator< (Counter a, Counter b)
 
static bool operator> (Counter a, Counter b)
 
static bool operator<= (Counter a, Counter b)
 
static bool operator>= (Counter a, Counter b)
 
static implicit operator long (Counter a)
 Explicit conversion from Counter to long. More...
 
static implicit operator Counter (long a)
 Implicit conversion from long to Counter. More...
 
static int Read (ref Counter result, string str)
 Reads a counter from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. More...
 
static int Read (ref Counter result, string str, int startpos)
 Reads a counter from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. More...
 
static int Read (ref Counter result, string str, int startpos, bool skipspaces)
 Reads a counter from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. More...
 
static Counter Parse (string str)
 Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter. More...
 
static bool TryParse (string str, ref Counter result)
 Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case. More...
 
static void Examples ()
 Examples of using the Counter class More...
 

Public Attributes

long Value
 Value of the counter. More...
 

Properties

static Counter One [get]
 Returns a counter with value 1. More...
 
static Counter Zero [get]
 Returns a counter with value 0. More...
 
bool IsNaN [get]
 Indicates whether the current Counter is not a number. More...
 
bool IsPositiveInfinity [get]
 Indicates whether the current Counter represents positive infinity. More...
 
bool IsNegativeInfinity [get]
 Indicates whether the current Counter represents negative infinity. More...
 
bool IsInfinity [get]
 Indicates whether the current Counter represents infinity. More...
 

Detailed Description

Represents a real number.

Constructor & Destructor Documentation

IG.Num.Counter.Counter ( Counter  v)
inline

References IG.Num.Counter.Value.

Member Function Documentation

void IG.Num.Counter.Copy ( Counter  s)
inline

Copies a counter to the current counter.

References IG.Num.Counter.Value.

void IG.Num.Counter.Copy ( long  l)
inline

Copies double to the current counter.

static void IG.Num.Counter.Copy ( Counter  a,
ref Counter  res 
)
inlinestatic

Copies a counter to another (existing) counter in place.

Parameters
aCounter that is copied.
resCounter where result is stored.

References IG.Num.Counter.Value.

static void IG.Num.Counter.Copy ( long  a,
ref Counter  res 
)
inlinestatic

Copies a number to an (existing) counter in place.

Parameters
aNumber that is copied.
resCounter where result is stored.
static Counter IG.Num.Counter.MinValue ( )
inlinestatic

Creates a counter that contains minimal representable value.

static Counter IG.Num.Counter.MaxValue ( )
inlinestatic

Creates a counter that contains maximal representable value.

int IG.Num.Counter.Compare ( Counter  a,
Counter  b 
)
inline

References IG.Num.Counter.Value.

override bool IG.Num.Counter.Equals ( object  obj)
inline

Indicates whether obj is equal to this instance.

bool IG.Num.Counter.Equals ( Counter  a)
inline

Indicates whether a is equal to this instance.

References IG.Num.Counter.IsNaN, and IG.Num.Counter.Value.

override int IG.Num.Counter.GetHashCode ( )
inline

Gets the hashcode of this Counter.

int IG.Num.Counter.CompareTo ( Counter  other)
inline

Compare this Counter with another Counter.

Parameters
otherThe counter to compare with.
static Counter IG.Num.Counter.operator+ ( Counter  s)
inlinestatic

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator- ( Counter  s)
inlinestatic

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator+ ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator- ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator* ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator/ ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator== ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator!= ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator< ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator> ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator<= ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator>= ( Counter  a,
Counter  b 
)
inlinestatic

References IG.Num.Counter.Value.

static implicit IG.Num.Counter.operator long ( Counter  a)
inlinestatic

Explicit conversion from Counter to long.

References IG.Num.Counter.Value.

static implicit IG.Num.Counter.operator Counter ( long  a)
inlinestatic

Implicit conversion from long to Counter.

override string IG.Num.Counter.ToString ( )
inline

Returns standard string representation of a counter, with decimal point and e for exponent, no 1000 separators, number of digits according to type accuracy.

Returns
String representing te counter.

Referenced by IG.Num.Counter.Examples().

string IG.Num.Counter.ToString ( string  format,
IFormatProvider  formatProvider 
)
inline

Returns a string representation of a counter in the specified way.

Parameters
formatthe format string.
formatProviderThe bormat provider used.
Returns
String representation of the counter.
static int IG.Num.Counter.Read ( ref Counter  result,
string  str 
)
inlinestatic

Reads a counter from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.

Parameters
resultOutput parameter returning the counter that was read.
strString from which the counter is read.
Returns
Position right after the read counter, or -1 if reading was not successful.
static int IG.Num.Counter.Read ( ref Counter  result,
string  str,
int  startpos 
)
inlinestatic

Reads a counter from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.

Parameters
resultOutput parameter returning the counter that was read.
strString from which the counter is read.
startposStarting position from which counter is searched for.
Returns
Position right after the read counter, or -1 if reading was not successful.
static int IG.Num.Counter.Read ( ref Counter  result,
string  str,
int  startpos,
bool  skipspaces 
)
inlinestatic

Reads a counter from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.

Parameters
resultOutput parameter returning the counter that was read.
strString from which the counter is read.
startposStarting position from which counter is searched for.
skipspacesIf true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position.
Returns
Position right after the read counter, or -1 if reading was not successful.

References IG.Lib.Parser.ReadInteger().

static Counter IG.Num.Counter.Parse ( string  str)
inlinestatic

Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter.

Parameters
strString that is parsed.
Returns
The counter represented by the parsed string.

References IG.Num.s, and IG.Lib.Parser.SkipSpaces().

static bool IG.Num.Counter.TryParse ( string  str,
ref Counter  result 
)
inlinestatic

Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.

Parameters
strString that is parsed.
resultVariable where result is stored.
Returns
True if parsing was successful (and the counter was actually read), false otherwise.

References IG.Num.s, and IG.Lib.Parser.SkipSpaces().

int IG.Num.Counter.read ( string  str)
inline

Reads in the value from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.

Parameters
strString from which the counter is read.
Returns
Position right after the read counter, or -1 if reading was not successful.
int IG.Num.Counter.Read ( string  str,
int  startpos 
)
inline

Reads in the value from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.

Parameters
strString from which the counter is read.
startposStarting position from which counter is searched for.
Returns
Position right after the read counter, or -1 if reading was not successful.
int IG.Num.Counter.Read ( string  str,
int  startpos,
bool  skipspaces 
)
inline

Reads in the value from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.

Parameters
strString from which the counter is read.
startposStarting position from which counter is searched for.
skipspacesIf true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position.
Returns
Position right after the read counter, or -1 if reading was not successful.
void IG.Num.Counter.Copy ( string  str)
inline

Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter.

Parameters
strString that is parsed.

References IG.Num.s.

bool IG.Num.Counter.TryCopy ( string  str)
inline

Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.

Parameters
strString that is parsed.
Returns
True if parsing was successful (and the counter was actually read), false otherwise.
static void IG.Num.Counter.Examples ( )
inlinestatic

Examples of using the Counter class

References IG.Num.Counter.ToString().

Member Data Documentation

Property Documentation

Counter IG.Num.Counter.One
staticget

Returns a counter with value 1.

Counter IG.Num.Counter.Zero
staticget

Returns a counter with value 0.

bool IG.Num.Counter.IsNaN
get

Indicates whether the current Counter is not a number.

Referenced by IG.Num.Counter.Equals().

bool IG.Num.Counter.IsPositiveInfinity
get

Indicates whether the current Counter represents positive infinity.

bool IG.Num.Counter.IsNegativeInfinity
get

Indicates whether the current Counter represents negative infinity.

bool IG.Num.Counter.IsInfinity
get

Indicates whether the current Counter represents infinity.


The documentation for this struct was generated from the following file: