Exemplo n.º 1
0
IndexMap* _IndexMap_New(
		SizeT						_sizeOfSelf, 
		Type						type,
		Stg_Class_DeleteFunction*				_delete,
		Stg_Class_PrintFunction*				_print, 
		Stg_Class_CopyFunction*				_copy, 
		unsigned					delta )
{
	IndexMap*			self;
	
	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(IndexMap) );
	self = (IndexMap*)_Stg_Class_New(
		_sizeOfSelf,
		type,
		_delete,
		_print,
		_copy );
	
	/* General info */
	
	/* Virtual info */
	
	/* IndexMap info */
	_IndexMap_Init( self, delta );
	
	return self;
}
Exemplo n.º 2
0
/*----------------------------------------------------------------------------------------------------------------------------------
** Constructors
*/
MemoryPool* _MemoryPool_New(
			SizeT							_sizeOfSelf,
			Type							type,
			Stg_Class_DeleteFunction*			_delete,
			Stg_Class_PrintFunction*			_print,
			Stg_Class_CopyFunction*				_copy,
			int									elementSize,
			int									numElements
			)
{
	MemoryPool *self = NULL;

	self = (MemoryPool*)_Stg_Class_New(
							_sizeOfSelf,
							type,
							_delete,
							_print,
							_copy);

	self->elementSize = elementSize;
	self->numElements = numElements;
	self->numElementsFree = numElements;

	return self;
}
Exemplo n.º 3
0
ISet* _ISet_New( ISET_DEFARGS ) {
    ISet* self;

    self = (ISet*)_Stg_Class_New( STG_CLASS_PASSARGS );
    _ISet_Init( self );
    return self;
}
Exemplo n.º 4
0
_Heap* _Heap_New(  HEAP_DEFARGS  )
{
	_Heap *self = NULL;

	self = (_Heap*)_Stg_Class_New(  STG_CLASS_PASSARGS  );

	assert( heapify );
	assert( extract );
	assert( insert );
	assert( compareFunction );
	assert( keySwapFunction );
	assert( keys );
	assert( extendArray );
	
	self->heapify = heapify;
	self->extract = extract;
	self->insert = insert;
	self->keySwap = keySwapFunction;
	self->compare = compareFunction;
	self->extendArray = extendArray;
	self->numArrayElements = numArrayElements;
	self->keys = keys;
	self->keyLength = keyLength;
	
	_Heap_Init( self );
	
	return self;
}
Exemplo n.º 5
0
NamedObject_Register*	_NamedObject_Register_New( 
		SizeT			_sizeOfSelf, 
		Type			type,
		Stg_Class_DeleteFunction*	_delete,
		Stg_Class_PrintFunction*	_print,
		Stg_Class_CopyFunction*	_copy ) 
{
	NamedObject_Register*	self;
	
	/* Allocate memory/General info */
	assert(_sizeOfSelf >= sizeof(NamedObject_Register));
	self = (NamedObject_Register*)_Stg_Class_New(
		_sizeOfSelf, 
		type, 
		_delete, 
		_print,
		_copy );
	
	/* Virtual info */
	
	/* Stg_Class info */
	_NamedObject_Register_Init( self );	

	return self;
}
Exemplo n.º 6
0
/* Creation implementation */
Stg_ComponentFactory* _Stg_ComponentFactory_New(  STG_COMPONENTFACTORY_DEFARGS  )
{
   Stg_ComponentFactory *self = NULL;

   assert( _sizeOfSelf >= sizeof( Stg_ComponentFactory ) );
   self = (Stg_ComponentFactory*) _Stg_Class_New(  STG_CLASS_PASSARGS  );

   self->getDouble = getDouble;
   self->getInt = getInt;
   self->getUnsignedInt = getUnsignedInt;
   self->getBool = getBool;
   self->getString = getString;

   self->getRootDictDouble = getRootDictDouble;
   self->getRootDictInt = getRootDictInt;
   self->getRootDictUnsignedInt = getRootDictUnsignedInt;
   self->getRootDictBool = getRootDictBool;
   self->getRootDictString = getRootDictString;
   
   self->constructByName = constructByName;
   self->constructByKey = constructByKey;
   self->constructByNameWithKeyFallback  = constructByNameWithKeyFallback;
   self->constructByList = constructByList;

   self->rootDict = rootDict;
   self->componentDict = componentDict;
   self->infoStream = Journal_Register( InfoStream_Type, self->type );
   Stream_SetPrintingRank( self->infoStream, 0 );
   Stream_SetAutoFlush( self->infoStream, True );
      
   _Stg_ComponentFactory_Init( self );
   
   return self;
}
/* Creation implementation */
Stg_ObjectList* _Stg_ObjectList_New( STG_OBJECTLIST_DEFARGS ) {
   Stg_ObjectList* self;
   
   /* Allocate memory */
   assert( _sizeOfSelf >= sizeof(Stg_ObjectList) );
   self = (Stg_ObjectList*)_Stg_Class_New( STG_CLASS_PASSARGS );

   /* Virtual functions */
   self->_append = _append;
   self->_prepend = _prepend;
   self->_replaceAll = _replaceAll;
   self->_replace = _replace;
   self->_insertBefore = _insertBefore;
   self->_insertAfter = _insertAfter;
   self->_remove = _remove;
   self->_getIndex = _getIndex;  
   self->_get = _get;
   self->_allocMoreMemory = _allocMoreMemory;
   self->_insertAtIndex = _insertAtIndex;
   self->_removeByIndex = _removeByIndex;
   self->_deleteAllObjects = _deleteAllObjects;
   
   /* ObjectList info */
   _Stg_ObjectList_Init( self, initialSize, delta );
   
   return self;
}
Exemplo n.º 8
0
STree* _STree_New( STREE_DEFARGS ) {
    STree* self;

    self = (STree*)_Stg_Class_New( STG_CLASS_PASSARGS );
    _STree_Init( self );
    return self;
}
Exemplo n.º 9
0
Iter* _Iter_New( ITER_DEFARGS ) {
   Iter* self;

   self = (Iter*)_Stg_Class_New( STG_CLASS_PASSARGS );
   self->nextFunc = nextFunc;
   _Iter_Init( self );
   return self;
}
LiveComponentRegister* _LiveComponentRegister_New( LIVECOMPONENTREGISTER_DEFARGS ) {
   LiveComponentRegister *self = NULL;

   assert( _sizeOfSelf >= sizeof( LiveComponentRegister ) );
   self = (LiveComponentRegister*) _Stg_Class_New( STG_CLASS_PASSARGS );
   
   return self;
}
Exemplo n.º 11
0
MPIFile* _MPIFile_New(  MPIFILE_DEFARGS  )
{
	MPIFile* self;
	
	self = (MPIFile*)_Stg_Class_New(  STG_CLASS_PASSARGS  );
	
	_MPIFile_Init( self );
	
	return self;
}
LinkedListIterator *_LinkedListIterator_New(  LINKEDLISTITERATOR_DEFARGS  )
{
	LinkedListIterator *self = NULL;

	/** LinkedListIterator using Class_New, because  Memory module has been initialized */
	
	self = (LinkedListIterator*)_Stg_Class_New(  STG_CLASS_PASSARGS  );
	
	return self;
}
Exemplo n.º 13
0
File* _File_New(  JOURNALFILE_DEFARGS  )
{
	File* self;
	
	assert( _sizeOfSelf >= sizeof(File) );
	self = (File*)_Stg_Class_New(  STG_CLASS_PASSARGS  );
	
	_File_Init( self, _read, _write, _append, _close, _flush );
	
	return self;
}
StreamFormatter* _StreamFormatter_New(  STREAMFORMATTER_DEFARGS  )
{
	StreamFormatter* self;
	
	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(StreamFormatter) );
	self = (StreamFormatter*)_Stg_Class_New(  STG_CLASS_PASSARGS  );
                                                                                
	_StreamFormatter_Init( self, _format );

	return self;
}
Exemplo n.º 15
0
LineFormatter* _LineFormatter_New(  LINEFORMATTER_DEFARGS  )
{
	LineFormatter* self;
	
	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(LineFormatter) );
	self = (LineFormatter*)_Stg_Class_New(  STG_CLASS_PASSARGS  );
                                                                                
	_LineFormatter_Init( self, _format );

	return self;
}
ConditionFunction_Register* _ConditionFunction_Register_New( CONDITIONFUNCTION_REGISTER_DEFARGS ) {
   ConditionFunction_Register* self;
   
   /* Allocate memory */
   self = (ConditionFunction_Register*)_Stg_Class_New( STG_CLASS_PASSARGS );
   
   /* Virtual info */
   
   /* ConditionFunction_Register info */
   _ConditionFunction_Register_Init( self );
   
   return self;
}
NamedObject_Register* _NamedObject_Register_New( NAMEDOBJECT_REGISTER_DEFARGS ) {
   NamedObject_Register* self;
   
   /* Allocate memory/General info */
   assert(_sizeOfSelf >= sizeof(NamedObject_Register));
   self = (NamedObject_Register*)_Stg_Class_New( STG_CLASS_PASSARGS );
   
   /* Virtual info */
   
   /* Stg_Class info */
   _NamedObject_Register_Init( self );   

   return self;
}
Exemplo n.º 18
0
UIntMap* _UIntMap_New(  UINTMAP_DEFARGS  ) {
	UIntMap* self;
	
	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(UIntMap) );
	self = (UIntMap*)_Stg_Class_New(  STG_CLASS_PASSARGS  );

	/* Virtual info */

	/* UIntMap info */
	_UIntMap_Init( self );

	return self;
}
Exemplo n.º 19
0
TestSuite* _TestSuite_New(  TESTSUITE_DEFARGS  ) {
	TestSuite* self;

	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(TestSuite) );
	self = (TestSuite*)_Stg_Class_New(  STG_CLASS_PASSARGS  );

	/* Virtual info */

	/* TestSuite info */
	_TestSuite_Init( self );

	return self;
}
Variable_Register* _Variable_Register_New(  VARIABLE_REGISTER_DEFARGS  )
{
	Variable_Register*	self;
	
	/* Allocate memory */
	self = (Variable_Register*)_Stg_Class_New(  STG_CLASS_PASSARGS  );
	
	/* Virtual info */
	
	/* Stg_Class info */
	_Variable_Register_Init(self);
	
	return self;
}
Exemplo n.º 21
0
CFile* _CFile_New(
	SizeT _sizeOfSelf,
	Type type,
	Stg_Class_DeleteFunction* _delete,
	Stg_Class_PrintFunction* _print,
	Stg_Class_CopyFunction* _copy )
{
	CFile* self;
	
	self = (CFile*)_Stg_Class_New( _sizeOfSelf, type, _delete, _print, _copy );
	
	_CFile_Init( self );
	
	return self;
}
AnalyticFunction* _AnalyticFunction_New( ANALYTICFUNCTION_DEFARGS ) {
   AnalyticFunction* self;
   
   /* Allocate memory */
   assert( _sizeOfSelf >= sizeof(AnalyticFunction) );
   self = (AnalyticFunction*)_Stg_Class_New( STG_CLASS_PASSARGS );
   
   /* General info */
   
   /* Virtual functions */
   
   /* Stg_Class info */
   _AnalyticFunction_Init(self, apply, name);
   
   return self;
}
EntryPoint_Register* _EntryPoint_Register_New(  ENTRYPOINT_REGISTER_DEFARGS  )
{
	EntryPoint_Register* self;
	
	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(EntryPoint_Register) );
	self = (EntryPoint_Register*)_Stg_Class_New(  STG_CLASS_PASSARGS  );
	
	/* General info */
	
	/* Virtual info */
	
	_EntryPoint_Register_Init( self );
	
	return self;
}
Exemplo n.º 24
0
/*----------------------------------------------------------------------------------------------------------------------------------
** Constructors
*/
MemoryPool* _MemoryPool_New(  MEMORYPOOL_DEFARGS  )
{
	MemoryPool *self = NULL;

	self = (MemoryPool*)_Stg_Class_New(  STG_CLASS_PASSARGS  );

	self->numMemChunks = 1;
	self->delta = delta;
	self->elementSize = elementSize;
	self->numElements = numElements;
	self->numInitialElements = numElements;
	self->numElementsFree = numElements;
	self->callbackFunc = NULL;
	self->callbackFuncArg = NULL;

	return self;
}
ConditionFunction* _ConditionFunction_New( CONDITIONFUNCTION_DEFARGS ) {
   ConditionFunction* self;
   
   /* Allocate memory */
   assert( _sizeOfSelf >= sizeof(ConditionFunction) );
   self = (ConditionFunction*)_Stg_Class_New( STG_CLASS_PASSARGS );

   self->data = NULL;
   
   /* General info */
   
   /* Virtual functions */
   
   /* Stg_Class info */
   _ConditionFunction_Init(self, apply, init, name, data);
   
   return self;
}
Exemplo n.º 26
0
ConditionFunction_Register* _ConditionFunction_Register_New( 
				SizeT			_sizeOfSelf,
				Type			type,
				Stg_Class_DeleteFunction*	_delete,
				Stg_Class_PrintFunction*	_print, 
				Stg_Class_CopyFunction*	_copy )
{
	ConditionFunction_Register*	self;
	
	/* Allocate memory */
	self = (ConditionFunction_Register*)_Stg_Class_New(_sizeOfSelf, type, _delete, _print, _copy);
	
	/* Virtual info */
	
	/* ConditionFunction_Register info */
	_ConditionFunction_Register_Init(self);
	
	return self;
}
Exemplo n.º 27
0
JournalFile* _JournalFile_New(
	SizeT				_sizeOfSelf,
	Type				type,
	Stg_Class_DeleteFunction*	_delete,
	Stg_Class_PrintFunction*	_print,
	Stg_Class_CopyFunction*		_copy, 
	JournalFile_OpenFunction*	_open,
	JournalFile_AppendFunction*	_append,
	JournalFile_CloseFunction*	_close,
	JournalFile_FlushFunction*	_flush )
{
	JournalFile* self;
	
	assert( _sizeOfSelf >= sizeof(JournalFile) );
	self = (JournalFile*)_Stg_Class_New( _sizeOfSelf, type, _delete, _print, _copy );
	
	_JournalFile_Init( self, _open, _append, _close, _flush );
	
	return self;
}
Exemplo n.º 28
0
LinearRegression* _LinearRegression_New(
 		SizeT                           _sizeOfSelf, 
		Type                            type,
		Stg_Class_DeleteFunction*       _delete,
		Stg_Class_PrintFunction*        _print, 
		Stg_Class_CopyFunction*         _copy,
		Variable*                       xVariable, 
		Variable*                       yVariable )		
{
	LinearRegression*		self;
	
	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(LinearRegression) );
	self = (LinearRegression*)_Stg_Class_New( _sizeOfSelf, type, _delete, _print, _copy );
	
	self->xVariable = xVariable;
	self->yVariable = yVariable;
	
	return self;
}
Exemplo n.º 29
0
ModulesManager* _ModulesManager_New( MODULESMANAGER_DEFARGS ) {
   ModulesManager* self;
   
   /* Allocate memory */
   assert( _sizeOfSelf >= sizeof(ModulesManager) );
   self = (ModulesManager*)_Stg_Class_New( STG_CLASS_PASSARGS );
   
   /* General info */
   
   /* Virtual info */
   self->_getModulesList = _getModulesList;
   self->_loadModule = _loadModule;
   self->_unloadModule = _unloadModule;
   self->_moduleFactory = _moduleFactory;
   self->_checkContext = _checkContext;
   self->_getModuleName = _getModuleName;
   
   _ModulesManager_Init( self );
   
   return self;
}
Exemplo n.º 30
0
ConditionFunction* _ConditionFunction_New( 
		SizeT				_sizeOfSelf, 
		Type				type,
		Stg_Class_DeleteFunction*		_delete,
		Stg_Class_PrintFunction*		_print, 
		Stg_Class_CopyFunction*		_copy, 
		ConditionFunction_ApplyFunc*	apply,
		Name				name)
{
	ConditionFunction* self;
	
	/* Allocate memory */
	assert( _sizeOfSelf >= sizeof(ConditionFunction) );
	self = (ConditionFunction*)_Stg_Class_New(_sizeOfSelf, type, _delete, _print, _copy);
	
	/* General info */
	
	/* Virtual functions */
	
	/* Stg_Class info */
	_ConditionFunction_Init(self, apply, name);
	
	return self;
}