SIMLIB/C++  3.07
Public Member Functions | Private Member Functions | Private Attributes | List of all members
simlib3::Function2 Class Reference

block parametrized by function with two arguments More...

#include <simlib.h>

Inheritance diagram for simlib3::Function2:
Inheritance graph
[legend]
Collaboration diagram for simlib3::Function2:
Collaboration graph
[legend]

Public Member Functions

 Function2 (Input i1, Input i2, double(*pf)(double, double))
 constructor — functions with two arguments More...
 
virtual double Value () override
 get block output value
this method should be defined in classes derived from aContiBlock More...
 
- Public Member Functions inherited from simlib3::aContiBlock2
 aContiBlock2 (Input i1, Input i2)
 ctr for blocks with 2 inputs More...
 
double Input1Value ()
 
double Input2Value ()
 
- Public Member Functions inherited from simlib3::aContiBlock
 aContiBlock ()
 
virtual void _Eval ()
 evaluate block (with loop detection) More...
 
- Public Member Functions inherited from simlib3::SimObject
bool TestAndSetFlag (bool new_value, unsigned n)
 internal method for flag manipulation is used for algebraic loop checking in continuous blocks More...
 
 SimObject ()
 constructor More...
 
virtual ~SimObject ()
 virtual destructor More...
 
void * operator new (size_t size)
 allocate object, set _flags More...
 
void operator delete (void *ptr)
 deallocate object More...
 
void * operator new[] (size_t size)=delete
 
void operator delete[] (void *ptr)=delete
 
bool isAllocated () const
 
virtual std::string Name () const
 get object name More...
 
bool HasName () const
 
void SetName (const std::string &name)
 assign the name More...
 
virtual void Output () const
 print object to default output More...
 

Private Member Functions

 Function2 (const Function2 &)=delete
 
Function2operator= (const Function2 &)=delete
 

Private Attributes

double(* f )(double, double)
 

Additional Inherited Members

- Public Types inherited from simlib3::SimObject
enum  _Flags { _CLEAR_ALL_FLAGS = 0, _ALLOCATED_FLAG = 1<<0, _EVAL_FLAG = 1<<1, _HAS_NAME_FLAG = 1<<2 }
 
- Protected Attributes inherited from simlib3::aContiBlock
bool isEvaluated
 
- Protected Attributes inherited from simlib3::SimObject
unsigned _flags
 bool flags for internal use (TODO bitfield?) More...
 

Detailed Description

block parametrized by function with two arguments

Definition at line 1465 of file simlib.h.

Constructor & Destructor Documentation

◆ Function2() [1/2]

simlib3::Function2::Function2 ( const Function2 )
privatedelete

◆ Function2() [2/2]

simlib3::Function2::Function2 ( Input  i1,
Input  i2,
double(*)(double, double)  pf 
)

constructor — functions with two arguments

Definition at line 55 of file fun.cc.

References Dprintf.

Member Function Documentation

◆ operator=()

Function2& simlib3::Function2::operator= ( const Function2 )
privatedelete

◆ Value()

double simlib3::Function2::Value ( )
overridevirtual

get block output value
this method should be defined in classes derived from aContiBlock

Implements simlib3::aContiBlock.

Definition at line 60 of file fun.cc.

References f, simlib3::SimObject::HasName(), simlib3::aContiBlock2::Input1Value(), simlib3::aContiBlock2::Input2Value(), simlib3::SimObject::Name(), and simlib3::SIMLIB_create_tmp_name().

Member Data Documentation

◆ f

double(* simlib3::Function2::f) (double, double)
private

Definition at line 1468 of file simlib.h.

Referenced by Value().


The documentation for this class was generated from the following files: