Exemplo n.º 1
0
cmeth objrtn UnsignedShortInteger_cm_gNewWithUnsigned(object self, unsigned val)
{ 
	object obj = oSuper(UnsignedShortInteger_c, gNew, self)(self); 
	ivType *iv = ivPtr(obj); 
	iv->iVal = (unsigned short int) val; 
	return(obj); 
} 
Exemplo n.º 2
0
imeth objrtn ObjectPool_im_gDispose(object self)
{ ObjectPool_iv_t *iv = GetIVs(ObjectPool, self);
	object ass; 

	while (ass = gFirst(iv->iObjects)) 
		gDisposeObject(self, (object) gPointerValue(gKey(ass))); 
	gDeepDispose(iv->iObjects); 
	return oSuper(ObjectPool_c, gDispose, self)(self); 
} 
Exemplo n.º 3
0
cmeth objrtn BTreeNode_cm_gNewNode(object self, object btree, int type)
{ 
	object obj = oSuper(BTreeNode_c, gNew, self)(self); 
	accessIVsOf(obj); 
	iv->iBTree = btree; 
	iv->iType = type; 
	if (!BTreeNode_cv->cData) 
		BTreeNode_cv->cData = gNew(Constant); 
	return obj; 
} 
Exemplo n.º 4
0
cmeth objrtn ArgumentList_cm_gNewArglist(object self, int argc, char **argv)
{ 
	int i; 
	object obj = oSuper(ArgumentList_c, gNew, self)(self); 
	for (i=0 ; i < argc ; i++) 
		if (argv[i][0] == '@') 
		process_file(obj, 1+argv[i]); 
	else 
		gAddLast(obj, gNewWithStr(String, argv[i])); 
	return obj; 
} 
Exemplo n.º 5
0
imeth int UnsignedShortInteger_im_gCompare(object self, object obj)
{ UnsignedShortInteger_iv_t *iv = GetIVs(UnsignedShortInteger, self);
	unsigned short sv, ov; 

	ChkArg(obj, 2); 
	if (ClassOf(obj) != CLASS) 
		return oSuper(UnsignedShortInteger_c, gCompare, self)(self, obj); 
	if ((sv=iv->iVal) < (ov=ivPtr(obj)->iVal)) 
		return -1; 
	else if (sv == ov) 
		return 0; 
	else 
		return 1; 
} 
Exemplo n.º 6
0
imeth objrtn BTreeNode_im_gDeepDispose(object self)
{ BTreeNode_iv_t *iv = GetIVs(BTreeNode, self);
	int i; 
	object n; 

	for (i=0 ; i < iv->iUsed ; ++i) { 
		if (n = iv->iKeys[i]) 
			gDeepDispose(n); 
		if (n = iv->iObjects[i]) 
			gDeepDispose(n); 
	} 
	if (iv->iType == 1 && (n = iv->iObjects[iv->iUsed])) 
		gDeepDispose(n); 
	return oSuper(BTreeNode_c, gDispose, self)(self); 
} 
Exemplo n.º 7
0
cmeth objrtn InputStream_cm_gNewWithStr(object self, char *file)
{ 
	object s, obj; 
	ivType *iv; 

	s = open_file(file, RMODE, 0); 
	if (!s) 
		return NULL; 
	obj = oSuper(InputStream_c, gNew, self)(self); 
	iv = ivPtr(obj); 
	iv->iStream = s; 
	iv->iBuf = Tnalloc(char, MAXBUF); 
	*iv->iBuf = '\0'; 
	iv->iPtr = iv->iBuf; 
	return obj; 
} 
Exemplo n.º 8
0
imeth objrtn BufferedTempFile_im_gGCDispose(object self)
{ BufferedTempFile_iv_t *iv = GetIVs(BufferedTempFile, self);
	free(iv->iBuffer); 
	return oSuper(BufferedTempFile_c, gDispose, self)(self); 
} 
Exemplo n.º 9
0
cmeth objrtn BufferedTempFile_cm_gOpenTempFile(object self)
{ 
	return BufferedTempFile_initVars(oSuper(BufferedTempFile_c, gNew, self)(self)); 
} 
Exemplo n.º 10
0
cmeth objrtn ObjectPool_cm_gNewWithInt(object self, int siz)
{ 
	return init(oSuper(ObjectPool_c, gNew, self)(self), siz); 
} 
Exemplo n.º 11
0
cmeth objrtn ObjectPool_cm_gNew(object self)
{ 
	return init(oSuper(ObjectPool_c, gNew, self)(self), DFLT_SIZE); 
} 
Exemplo n.º 12
0
imeth objrtn InputStream_im_gGCDispose(object self)
{ InputStream_iv_t *iv = GetIVs(InputStream, self);
	free(iv->iBuf); 
	return oSuper(InputStream_c, gGCDispose, self)(self); 
} 
Exemplo n.º 13
0
 template <typename _ArgT> _return_t<_ArgT> operator()(_ArgT&& oArgs){
   _super_t & oSuper = static_cast<_super_t&>(*this);
   return oSuper(std::forward<_ArgT>(oArgs));
 }
Exemplo n.º 14
0
 template <typename ... _ArgTs> typename std::result_of<_super_t(_ArgTs...)>::type operator()(_ArgTs...oArgs){
   _super_t & oSuper = static_cast<_super_t&>(*this);
   return oSuper(std::forward<_ArgTs>(oArgs)...);
 }
Exemplo n.º 15
0
 template <typename _ArgT> _return_t<_ArgT> operator()(_ArgT&& oArg) const{
   auto & oNext = static_cast<const _next_t&>(*this);
   auto & oSuper = static_cast<const _super_t&>(*this);
   return oSuper(oNext(std::forward<_ArgT>(oArg)));
 }