I like puzzles on C++ and hope it is the
best solution in this time.
All headers is completed and can be used in non-commercial
projects free.
For last update information, code samples or job proposition e-mail me
FAssert.h - FASSERT, FTRACE, ANONIMOUS variable name
FASSERT
- fast: In normal condition just compare checked value on zero
- allow prevent checking in each! certain source line from prompt.
- VC++ debug output compatible: navigate in source from debug output window
- MFC ASSERT compatible, just #define ASSERT FASSERT
- Only in header
- inline assembly: breakpoint shown on source code line
- Allow printf format string for view output(message+debug output)
if(pVar)
FASSERT( pVar->Valid() )("Something wrong: pVar->member=%p",pVar->member);
else ...- simple expression, can be used with if/else, for, while
- In release mode does nothing
FTList.h - FTList<T,K>, FTElement<T,K> : 2-linked list. Each element derived from FTElement<T,K>
FWorkThread.h - FSyncThread<T>, FBeginWorkThread(T*
pThis, void (T::*PtrFun)(void) )
FCriticalSection.h
template < class T > DWORD FBeginWorkThread(DWORD (*fun)(T), T param)
- run function fun in own thread
- parameter casted to pointer automatically
template < class T >DWORD FBeginWorkThread(T* pThis, void (T::*PtrFun)(void) )
- Run object method in own thread
template < class T , void (T::*PtrFun)(void) >DWORD FBeginWorkThread1(T* pThis )
- Does a same. But method is template parameter.
template < class T >class FSyncThread
- DWORD BeginThread( T* pObj, void (T::*pFun)(void) ) - Run object method in own thread
- object destructor will wait for thread ending
- Some useful methods for: Stop,Terminate, Priority
FPtr.H - FTmpVal<T>, FPtr<T> FPtrRef<T>
FTmpVal<T> - temporary change variable value. Destructor will restore original one.
FPtr<T> - destoy owned object in destructor. Analog stl::auto_ptr.
FPtrRef<T> - safe pointer to object, derived from FPtrRefObj<T>. Object destructor will clear all references to self.
Compound project support:
Used for independent modules references. In such way You need just include/remove a CPP module in project for add/remove new features in program. Useful alternative of COM for inproc servers.
SIdAssoc.h - ID-tag to function map. Allow call function with mapped ID. Type of function is templated.
IDConstr.h - ID-tag to constructor map. Allow call constructor with mapped ID. Type of base class and constructor arguments is templated. Allow automatic creation of class object with non-empty constructor.
Document/view compound(not OLE) support:
FDocument<TDocument,TDocParent>
FView<TView,TViewParent>
Copyright Oleksandr Firsov (C) 2000