BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Attributes Class Reference
Collaboration diagram for Attributes:

Public Member Functions

 Attributes ()
 
void setFixed (bool is_fixed)
 
bool isFixed () const
 
bool isFree () const
 
bool operator== (const Attributes &other) const
 
bool operator!= (const Attributes &other) const
 

Static Public Member Functions

static Attributes fixed ()
 
static Attributes free ()
 

Protected Member Functions

 Attributes (bool is_fixed)
 
void print (std::ostream &ostr) const
 

Protected Attributes

bool m_is_fixed
 

Friends

std::ostream & operator<< (std::ostream &ostr, const Attributes &m)
 

Detailed Description

Attributes for a fit parameter.

Currently, the only attribute is fixed/free.

Definition at line 23 of file Attributes.h.

Constructor & Destructor Documentation

◆ Attributes() [1/2]

Attributes::Attributes ( )
inline

Definition at line 26 of file Attributes.h.

26 : m_is_fixed(false) {}
bool m_is_fixed
Definition: Attributes.h:47

Referenced by fixed(), and free().

◆ Attributes() [2/2]

Attributes::Attributes ( bool  is_fixed)
inlineprotected

Definition at line 45 of file Attributes.h.

45 : m_is_fixed(is_fixed) {}

Member Function Documentation

◆ fixed()

static Attributes Attributes::fixed ( )
inlinestatic

Creates a fixed value object.

Definition at line 28 of file Attributes.h.

28 { return Attributes(true); }

References Attributes().

Referenced by AttLimits::fixed().

Here is the call graph for this function:

◆ free()

static Attributes Attributes::free ( )
inlinestatic

Definition at line 29 of file Attributes.h.

29 { return Attributes(false); }

References Attributes().

Referenced by AttLimits::limited(), AttLimits::lowerLimited(), AttLimits::nonnegative(), AttLimits::positive(), and AttLimits::upperLimited().

Here is the call graph for this function:

◆ setFixed()

void Attributes::setFixed ( bool  is_fixed)
inline

Definition at line 31 of file Attributes.h.

31 { m_is_fixed = is_fixed; }

References m_is_fixed.

Referenced by AttLimits::setFixed().

◆ isFixed()

bool Attributes::isFixed ( ) const
inline

Definition at line 32 of file Attributes.h.

32 { return m_is_fixed; }

References m_is_fixed.

Referenced by AttLimits::isFixed(), isFree(), operator==(), print(), and RealParameter::setValue().

◆ isFree()

bool Attributes::isFree ( ) const
inline

Definition at line 33 of file Attributes.h.

33 { return !isFixed(); }
bool isFixed() const
Definition: Attributes.h:32

References isFixed().

Referenced by AttLimits::isLimited(), AttLimits::isLimitless(), AttLimits::isLowerLimited(), and AttLimits::isUpperLimited().

Here is the call graph for this function:

◆ operator==()

bool Attributes::operator== ( const Attributes other) const
inline

Definition at line 41 of file Attributes.h.

41 { return isFixed() == other.isFixed(); }

References isFixed().

Here is the call graph for this function:

◆ operator!=()

bool Attributes::operator!= ( const Attributes other) const
inline

Definition at line 42 of file Attributes.h.

42 { return !(*this == other); }

◆ print()

void Attributes::print ( std::ostream &  ostr) const
inlineprotected

parameter is fixed

Prints class.

Definition at line 53 of file Attributes.h.

54 {
55  if (isFixed())
56  ostr << "fixed";
57  else
58  ostr << "free";
59 }

References isFixed().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ostr,
const Attributes m 
)
friend

Definition at line 35 of file Attributes.h.

36  {
37  m.print(ostr);
38  return ostr;
39  }
void print(std::ostream &ostr) const
parameter is fixed
Definition: Attributes.h:53

Member Data Documentation

◆ m_is_fixed

bool Attributes::m_is_fixed
protected

Definition at line 47 of file Attributes.h.

Referenced by isFixed(), and setFixed().


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