Namespaces | Macros | Variables
istd.h File Reference
#include <limits>
#include <QtCore/QtGlobal>
#include <QtCore/QByteArray>
#include <QtCore/QString>
#include <QtCore/QStringList>

Go to the source code of this file.

Namespaces

 istd
 Standard library.
 

Macros

#define I_EPSILON   std::numeric_limits<double>::epsilon()
 Some very small number. More...
 
#define I_HUGE_NUMBER   10e20
 Some very big number. More...
 
#define I_INFINITY   std::numeric_limits<double>::infinity()
 Infinite value. More...
 
#define I_IF_DEBUG(instructions)   instructions
 
#define I_CRITICAL()   Q_ASSERT(false)
 
#define NULL   0
 
#define I_ENUM_GET_VALUES(Enum,...)
 Get all values of an enumeration as a list of intergers. More...
 
#define I_ENUM_GET_STRINGS(Enum,...)
 Get all values of an enumeration as strings. More...
 
#define I_DECLARE_ENUM(Enum,...)
 Create meta information for an existing enumeration. More...
 
#define I_DECLARE_FLAGS(Enum,...)
 

Variables

static const double I_BIG_EPSILON = 1.0e-8
 

Macro Definition Documentation

#define I_CRITICAL ( )    Q_ASSERT(false)

Definition at line 50 of file istd.h.

#define I_DECLARE_ENUM (   Enum,
  ... 
)
Value:
I_ENUM_GET_VALUES(Enum, __VA_ARGS__)\
I_ENUM_GET_STRINGS(Enum, __VA_ARGS__)\
static QByteArray ToString(Enum enumValue){\
static QByteArray emptyString;\
QStringList values = Enum##GetStrings();\
QList<int> enumValues = Enum##GetValues();\
Q_ASSERT(enumValues.count() == values.count());\
for (int i = 0; i < enumValues.count(); ++i){\
if (enumValues[i] == enumValue){\
return values[i].toUtf8();\
}\
}\
return emptyString;\
}\
static bool FromString(const QByteArray& enumString, Enum& enumValue){\
QStringList values = Enum##GetStrings();\
QList<int> enumValues = Enum##GetValues();\
Q_ASSERT(enumValues.count() == values.count());\
for (int i = 0; i < enumValues.count(); ++i){\
if (values[i].toUtf8() == enumString){\
enumValue = Enum(enumValues[i]);\
return true;\
}\
}\
return false;\
}
#define I_ENUM_GET_STRINGS(Enum,...)
Get all values of an enumeration as strings.
Definition: istd.h:87
#define I_ENUM_GET_VALUES(Enum,...)
Get all values of an enumeration as a list of intergers.
Definition: istd.h:71

Create meta information for an existing enumeration.

Definition at line 117 of file istd.h.

#define I_DECLARE_FLAGS (   Enum,
  ... 
)

Definition at line 145 of file istd.h.

#define I_ENUM_GET_STRINGS (   Enum,
  ... 
)
Value:
static QStringList Enum##GetStrings(){\
QString enumValuesString = #__VA_ARGS__;\
QStringList values = enumValuesString.split(",");\
for (int i = 0; i < values.count(); ++i){\
QString rawValue = values[i].simplified();\
QStringList splitNames = rawValue.split("_");\
if (splitNames.isEmpty()){\
values[i] = rawValue;\
}\
else{\
QString formattedValue = rawValue;\
for (int partIndex = 1; partIndex < splitNames.count(); ++partIndex){\
QString partValue = splitNames[partIndex].toLower();\
if (partIndex == 1){\
formattedValue = partValue;\
}\
else{\
formattedValue += partValue.at(0).toUpper() + partValue.mid(1);\
}\
}\
values[i] = formattedValue;\
}\
}\
return values;\
}

Get all values of an enumeration as strings.

Definition at line 87 of file istd.h.

#define I_ENUM_GET_VALUES (   Enum,
  ... 
)
Value:
static QList<int> Enum##GetValues(){\
QList<int> values;\
int vars[] = {0, __VA_ARGS__};\
int count = (sizeof(vars) / sizeof(int));\
for(int i = 0; i < count; ++i){\
if (i > 0){\
values << vars[i];\
}\
}\
return values;\
}

Get all values of an enumeration as a list of intergers.

Definition at line 71 of file istd.h.

#define I_EPSILON   std::numeric_limits<double>::epsilon()

Some very small number.

Definition at line 31 of file istd.h.

Referenced by imath::TFulcrumGrid< Position, Fulcrums >::InsertLayer().

#define I_HUGE_NUMBER   10e20

Some very big number.

Definition at line 37 of file istd.h.

#define I_IF_DEBUG (   instructions)    instructions
#define I_INFINITY   std::numeric_limits<double>::infinity()

Infinite value.

Definition at line 43 of file istd.h.

#define NULL   0

Definition at line 64 of file istd.h.

Referenced by iqt2d::TMultiViewExtenderDelegatorCompWrap< Base >::AddItemsToScene(), iqt2d::TViewExtenderCompBase< Base >::AddItemsToScene(), iqtgui::TGuiObserverWrap< Gui, Observer >::AfterUpdate(), imod::TSingleModelObserverBase< ModelInterface >::AttachOrSetObject(), iimg::CScanlineMask::CalculateMaskFromBitmap(), istd::CChangeGroup::CChangeGroup(), istd::CChangeNotifier::CChangeNotifier(), icomp::TComponentCloneWrap< BaseClass >::CloneMe(), iimg::TMultiPageBitmap< BitmapImpl >::CloneMe(), imod::TModelWrap< Base >::CloneMe(), ilog::TExtMessage< Element >::CloneMe(), istd::IChangeable::CloneMe(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::TableModel::columnCount(), CompCastPtr(), i2d::TDataNodePolyline< NodeData >::CopyFrom(), ibase::TContainer< ItemClass, ContainerType >::CopyFrom(), idoc::TMultiPageDocumentWrap< Base >::CopyFrom(), icomp::TMultiFactoryMember< Interface >::CreateComponent(), icomp::TFactoryMember< Interface >::CreateComponent(), ibase::TFactorisableContainer< InterfaceClass >::CreateElement(), iqtdoc::TQtDocumentManagerWrap< Base, Gui >::CreateFileDialogFilters(), istd::TSingleFactory< Interface, Implementation >::CreateInstance(), icomp::TSimComponentsFactory< Base >::CreateInstance(), istd::TComposedFactory< InterfaceType >::CreateInstance(), icomp::TMultiFactoryMember< Interface >::CreateInstance(), icomp::TFactoryMember< Interface >::CreateInstance(), iqtgui::CCommandTools::CreateMenu(), iqtgui::TDesignerGuiCompBase< UI, WidgetType >::CreateQtWidget(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::CreateShape(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::CreateShapes(), icomp::TSimComponentsFactory< Base >::CreateSubcomponent(), icomp::TSimComponentWrap< Base >::CreateSubcomponent(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::CreateToolsMenu(), iwidgets::CWidgetUpdateBlocker::CWidgetUpdateBlocker(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::TableModel::data(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::data(), ilog::TLoggerCompWrap< Base >::DecorateMessage(), istd::DefaultAccessor< Type >::Delete(), istd::ArrayAccessor< Type >::Delete(), istd::TTransPtr< Type >::Detach(), istd::TDelPtr< Type, Accessor >::Detach(), istd::TOptDelPtr< Type, DelArray >::Detach(), ibase::TLocalizableWrap< Base >::EnableLocalization(), icomp::TMultiReferenceMember< Interface >::EnsureInitialized(), icomp::TReferenceMember< Interface >::EnsureInitialized(), iview::CLineShape::EnsurePointsAreValid(), icomp::CInterfaceManipBase::ExtractInterface(), icomp::TFactoryMember< Interface >::ExtractInterface(), istd::TCascadedMap< Key, Value >::FindElement(), istd::TCascadedMap< Key, Value >::FindIndex(), istd::TCascadedMap< Key, Value >::FindLocalElement(), icomp::TMultiAttributeMember< Attribute >::FindValue(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::TableModel::flags(), istd::THierarchicalBase< Base, Interface >::GetChild(), ibase::ICommandsProvider::GetCommands(), icomp::TSubelementStaticInfo< ComponentType >::GetComponentInterface(), icomp::TMultiAttributeMember< Attribute >::GetCount(), iview::CInteractiveViewLayer::GetEditMode(), iview::CInteractiveShapeBase::GetEditMode(), ibase::TFactorisableContainer< InterfaceClass >::GetElement(), istd::TCascadedMap< Key, Value >::GetElementsCount(), istd::TRanges< ValueType >::GetInverted(), istd::TCascadedMap< Key, Value >::GetKeyAt(), istd::TCascadedMap< Key, Value >::GetKeys(), iview::CInteractiveViewLayer::GetKeysState(), iview::CInteractiveShapeBase::GetKeysState(), iview::CViewBase::GetLayer(), imod::CMultiModelDispatcherBase::GetObjectAt(), iqtdoc::TQtDocumentManagerWrap< Base, Gui >::GetOpenFilePathesFromDialog(), icomp::TAttributeMember< Attribute >::GetOriginalValue(), icomp::TSimComponentWrap< Base >::GetParentComponent(), iview::CViewBase::GetParentDisplayPtr(), istd::TTransPtr< Type >::GetPtr(), icomp::TSimComponentWrap< Base >::GetSubcomponent(), icomp::TSimComponentWrap< Base >::GetSubcomponentContext(), icomp::TSubelementStaticInfo< ComponentType >::GetSubelementInfo(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::GetToolBar(), imath::TMatrix< Width, Height, Element >::GetTriangleDecomposed(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::GetUnitName(), istd::TCascadedMap< Key, Value >::GetValueAt(), iview::CConsoleGui::GetView(), iview::CConsoleGui::GetViewRef(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::TableModel::headerData(), icomp::TReferenceMember< Interface >::Init(), icomp::TMultiAttributeMember< Attribute >::Init(), icomp::TAttributeMember< Attribute >::Init(), iprm::TParamsPtr< ParameterInterace >::Init(), icomp::TSimComponentWrap< Base >::InitComponent(), icomp::TMultiAttributeMember< Attribute >::InitInternal(), icomp::TAttributeMember< Attribute >::InitInternal(), icomp::CSimComponentContextBase::InsertMultiAttr(), icomp::TInterfaceRegistrator< Interface >::InterfaceExtractor(), istd::TRanges< ValueType >::Invert(), icomp::CSimComponentContextBase::IsAttributeTypeCorrect(), icomp::CComponentBase::IsComponentActive(), ifile::TXmlFileSerializerComp< ReadArchive, WriteArchive >::ReadArchiveEx::IsLogConsumed(), ifile::TFileSerializerComp< ReadArchive, WriteArchive >::ReadArchiveEx::IsLogConsumed(), ifile::TXmlFileSerializerComp< ReadArchive, WriteArchive >::WriteArchiveEx::IsLogConsumed(), ifile::TFileSerializerComp< ReadArchive, WriteArchive >::WriteArchiveEx::IsLogConsumed(), imod::CSingleModelObserverBase::IsModelAttached(), iview::ISelectableLayer::IsTouched(), icomp::TMultiFactoryMember< Interface >::IsValid(), istd::TTransPtr< Type >::IsValid(), icomp::TMultiAttributeMember< Attribute >::IsValid(), icomp::TFactoryMember< Interface >::IsValid(), icomp::TAttributeMember< Attribute >::IsValid(), istd::TPointerBase< Type >::IsValid(), ifile::TFileSerializerComp< ReadArchive, WriteArchive >::LoadFromFile(), ifile::TXmlFileSerializerComp< ReadArchive, WriteArchive >::LoadFromFile(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::OnActionTriggered(), ibase::TModelObserverCompBaseWrap< ObserverComponent >::OnComponentCreated(), ilog::TLoggerCompWrap< Base >::OnComponentDestroyed(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::OnCopyData(), iqtgui::TItemModelEditorCompBase< ItemWidgetClass >::OnGuiCreated(), iqtgui::TGuiObserverWrap< Gui, Observer >::OnGuiCreated(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnGuiDestroyed(), iqtgui::TGuiObserverWrap< Gui, Observer >::OnGuiDestroyed(), iqtgui::TGuiObserverWrap< Gui, Observer >::OnGuiHidden(), iqtgui::TItemModelEditorCompBase< ItemWidgetClass >::OnGuiModelAttached(), iqtgui::TGuiObserverWrap< Gui, Observer >::OnGuiModelAttached(), iqtgui::TGuiObserverWrap< Gui, Observer >::OnGuiModelDetached(), iqtgui::TDesignerGuiCompBase< UI, WidgetType >::OnGuiRetranslate(), iqtgui::TGuiObserverWrap< Gui, Observer >::OnGuiShown(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::OnInsertNode(), iqtgui::TGuiObserverWrap< Gui, Observer >::OnModelAttached(), imod::TMultiModelObserverBase< ModelInterface >::OnModelAttached(), imod::TSingleModelObserverBase< ModelInterface >::OnModelAttached(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnModelAttached(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnModelAttachedAndGuiShown(), imod::TSingleModelObserverBase< ModelInterface >::OnModelDetached(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnModelDetached(), iqt2d::TShapeParamsGuiCompBase< Ui, Shape, ShapeModel >::OnModelDetachedOrGuiHidden(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::OnPasteData(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::OnRemoveNode(), istd::CFastBinaryIndex::Iterator::operator*(), istd::TVarArray< Element >::Iterator::operator*(), istd::TArray< Element, Dimensions >::Iterator::operator*(), icomp::TAttributeMember< Attribute >::operator*(), istd::TTransPtr< Type >::operator*(), istd::TPointerBase< Type >::operator*(), istd::TVarArray< Element >::Iterator::operator++(), istd::TArray< Element, Dimensions >::Iterator::operator++(), istd::TVarArray< Element >::Iterator::operator--(), istd::TArray< Element, Dimensions >::Iterator::operator--(), istd::TVarArray< Element >::Iterator::operator->(), istd::TArray< Element, Dimensions >::Iterator::operator->(), icomp::TReferenceMember< Interface >::operator->(), istd::TTransPtr< Type >::operator->(), istd::TSmartPtr< Type, Accessor >::operator=(), istd::TTransPtr< Type >::operator=(), istd::TVarArray< Element >::Iterator::operator==(), istd::TArray< Element, Dimensions >::Iterator::operator==(), icomp::TMultiReferenceMember< Interface >::operator[](), icomp::TMultiAttributeMember< Attribute >::operator[](), istd::TDelPtr< Type, Accessor >::PopPtr(), istd::TOptDelPtr< Type, DelArray >::PopPtr(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::PopulateActions(), istd::TTransPtr< Type >::RefCountBase::RefCountBase(), istd::TComposedFactory< InterfaceType >::RegisterFactory(), iqt2d::TMultiViewExtenderDelegatorCompWrap< Base >::RemoveItemsFromScene(), iqt2d::TViewExtenderCompBase< Base >::RemoveItemsFromScene(), istd::TDelPtr< Type, Accessor >::Reset(), istd::TTransPtr< Type >::Reset(), istd::TOptDelPtr< Type, DelArray >::Reset(), istd::TPointerBase< Type >::Reset(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::TableModel::rowCount(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::rowCount(), ifile::TFileSerializerComp< ReadArchive, WriteArchive >::SaveToFile(), ifile::TXmlFileSerializerComp< ReadArchive, WriteArchive >::SaveToFile(), ifile::TFileSerializerComp< ReadArchive, WriteArchive >::ReadArchiveEx::SendLogMessage(), ifile::TXmlFileSerializerComp< ReadArchive, WriteArchive >::ReadArchiveEx::SendLogMessage(), ifile::TFileSerializerComp< ReadArchive, WriteArchive >::WriteArchiveEx::SendLogMessage(), ifile::TXmlFileSerializerComp< ReadArchive, WriteArchive >::WriteArchiveEx::SendLogMessage(), ibase::TSerializableContainer< ItemClass, ContainerType >::Serialize(), iattr::TAttribute< Value >::Serialize(), idoc::TMultiPageDocumentWrap< Base >::Serialize(), iattr::TMultiAttribute< Value >::Serialize(), ibase::TFactorisableContainer< InterfaceClass >::Serialize(), icmm::TComposedColor< Size >::Serialize(), imath::TFulcrumGrid< Position, Fulcrums >::Serialize(), iser::CPrimitiveTypesSerializer::SerializeEnum(), ibase::TFactorisableContainer< InterfaceClass >::SerializeItem(), idoc::TMultiPageDocumentWrap< Base >::SerializePage(), istd::TSmartPtr< QTranslator >::SetCastedOrRemove(), istd::TDelPtr< istd::IChangeable >::SetCastedOrRemove(), istd::TOptDelPtr< const i2d::ICalibration2d >::SetCastedOrRemove(), icomp::TComponentWrap< Component >::SetComponentContext(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::TableModel::setData(), iqt2d::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::setData(), istd::TSmartPtr< Type, Accessor >::SetPtr(), iqtgui::TGuiObserverWrap< Gui, Observer >::SetReadOnly(), iview::TBitmapVisualObject< Object, BitmapShape >::TBitmapVisualObject(), ibase::TFactorisableContainer< InterfaceClass >::TFactorisableContainer(), istd::THierarchicalBase< Base, Interface >::THierarchicalBase(), istd::TOptDelPtr< Type, DelArray >::TOptDelPtr(), imod::TSingleModelObserverBase< ModelInterface >::TSingleModelObserverBase(), istd::TSmartPtr< Type, Accessor >::TSmartPtr(), istd::TTransPtr< Type >::TTransPtr(), iqt2d::TViewExtenderCompBase< Base >::UpdateAllViews(), iqt2d::TCircleBasedParamsGuiComp< CircleBasedShape, CircleBasedModel >::UpdateGui(), iqt2d::TCircleBasedParamsGuiComp< CircleBasedShape, CircleBasedModel >::UpdateModel(), istd::CChangeGroup::~CChangeGroup(), istd::CChangeNotifier::~CChangeNotifier(), and icomp::TComponentWrap< Component >::~TComponentWrap().

Variable Documentation

const double I_BIG_EPSILON = 1.0e-8
static

© 2007-2017 Witold Gantzke and Kirill Lepskiy