?? kr_serializer.h
字號:
/***************************************************************************
KR_Serializer.h -
-------------------
begin : Tue Mar 3 2004
copyright : (C) 2004 by DigitalAirways
email : info@digitalairways.com
***************************************************************************/
/*
* Copyright (c) 2000-2004 DigitalAirways, sarl. All Rights Reserved.
*
* This software is the confidential and proprietary information of
* DigitalAirways, sarl. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with DigitalAirways.
* A copy of this license is included in the licence.txt file included
* in this software package.
*/
/*
**************************************************************
* TODO
**************************************************************
-
**************************************************************
* HISTORY
**************************************************************
-
*/
#ifndef __KR_Serializer__
#define __KR_Serializer__
#include "SmallArrayList.h"
class Serializer {
public:
SmallArrayList* /* BinaryMarshalizableIF */ sfObjects; // extrastatic
DEFINE_NEW(Serializer);
DEFINE_DELETE(Serializer);
Serializer(long nb)
{
sfObjects=XNEW(SmallArrayList) (nb);
}
~Serializer()
{
// Not here...
// for(int i=0; i<sfObjects->size(); i++)
// if(sfObjects->get(i))
// delete(sfObjects->get(i));
SAFE_DELETE(sfObjects);
}
/* OBSOLETE: just delete the object
void dispose() {
sfObjects=0; // todo: disposer chaque elt
}
*/
long add(void* o) {
sfObjects->add(o);
return sfObjects->size() - 1;
}
void* elementAt(long i) {
if (i == -1)
return 0;
return sfObjects->get(i);
}
void registerObject(void* o) {
if(sfObjects)
addIfNotExists(o);
}
long exists(void* o) ;
long addIfNotExists(void* o) ;
long instance2Id(void* o) ;
void* id2Instance(long v) {
//assert the array exists
return elementAt(v);
}
};
#endif // ndef __KR_Serializer__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -