Index: trunk/src/mesh/Makefile
===================================================================
--- trunk/src/mesh/Makefile	(revision 293)
+++ trunk/src/mesh/Makefile	(revision 294)
@@ -94,6 +94,6 @@
                   # RpValueDouble.o RpValueString.o
 RP_MESH_DEPS = 	grid1d.o grid1d_reg.o grid2d.o node3d.o node2d.o \
-		element.o mesh.o serializer.o util.o \
-		#field.o 
+		element.o mesh.o serializable.o serializer.o util.o \
+		const.o #field.o 
 
 LDLIB_MACOSX = -dynamiclib -o $(LIB_DIR)/$@.dylib
@@ -188,4 +188,6 @@
 util.o: util.cc
 	$(CXX) $(CFLAGS) $(DEBUG) -c $?
+const.o: const.cc
+	$(CXX) $(CFLAGS) $(DEBUG) -c $?
 node2d.o: node2d.cc
 	$(CXX) $(CFLAGS) $(DEBUG) -c $?
@@ -196,6 +198,6 @@
 mesh.o: mesh.cc
 	$(CXX) $(CFLAGS) $(DEBUG) -c $?
-#serializable.o: serializable.cc
-#	$(CXX) $(CFLAGS) $(DEBUG) -c $?
+serializable.o: serializable.cc
+	$(CXX) $(CFLAGS) $(DEBUG) -c $?
 serializer.o: serializer.cc
 	$(CXX) $(CFLAGS) $(DEBUG) -c $?
Index: trunk/src/mesh/grid1d.cc
===================================================================
--- trunk/src/mesh/grid1d.cc	(revision 293)
+++ trunk/src/mesh/grid1d.cc	(revision 294)
@@ -111,5 +111,5 @@
 	char * ptr = buf;
 
-	writeHeader(ptr, Grid1d_current_version, nbytes);
+	writeHeader(ptr, RpGrid1d_current_version, nbytes);
 	ptr += HEADER_SIZE + sizeof(int);
 	
@@ -140,5 +140,5 @@
 	ptr += HEADER_SIZE and sizeof(int);
 	
-	if (header ==  Grid1d_current_version)
+	if (header == RpGrid1d_current_version)
 		return doDeserialize(ptr);
 
Index: trunk/src/mesh/rp_types.h
===================================================================
--- trunk/src/mesh/rp_types.h	(revision 293)
+++ trunk/src/mesh/rp_types.h	(revision 294)
@@ -18,29 +18,16 @@
 };
 
-const char* RpObjectTypes[] = {
-	"BOOLEAN",
-	"NUMBER",
-	"STRING",
-	"FIELD",
-	"MESH3D",
-	"ELEMENT",
-	"NODE2D",
-	"NODE3D",
-	"GRID1D",
-	"GRID2D",
-	"GRID3D",
-	"CURVE2D"
-};
+extern const char* RpObjectTypes[];
 
-const int HEADER_SIZE = 16;
+extern const int HEADER_SIZE;
 
-const char* Grid1d_current_version = "RV-A-GRID1D";
-const char* Grid2d_current_version = "RV-A-GRID2D";
-const char* Mesh3d_current_version = "RV-A-MESH3D";
-const char* Field_current_version = "RV-A-FIELD";
-const char* Curve_current_version = "RV-A-CURVE";
-const char* Element_current_version = "RV-A-ELEMENT";
-const char* Node2d_current_version = "RV-A-NODE2D";
-const char* Node3d_current_version = "RV-A-NODE3D";
+extern const char* RpGrid1d_current_version;
+extern const char* RpGrid2d_current_version;
+extern const char* RpMesh3d_current_version;
+extern const char* RpField_current_version;
+extern const char* RpCurve_current_version;
+extern const char* RpElement_current_version;
+extern const char* RpNode2d_current_version;
+extern const char* RpNode3d_current_version;
 
 #endif
Index: trunk/src/mesh/serializer.cc
===================================================================
--- trunk/src/mesh/serializer.cc	(revision 293)
+++ trunk/src/mesh/serializer.cc	(revision 294)
@@ -5,5 +5,5 @@
 //
 void 
-Serializer::addObject(RpSerializable* obj)
+RpSerializer::addObject(RpSerializable* obj)
 {
 	// add object pointer to object map
@@ -17,14 +17,11 @@
 // Input:
 // 	a byte stream of a serialized object
-// 		RV-<object-type>-A<numBytes>.....
+// 		RV-A-<object-type><numBytes>.....
 //
 void 
-Serializer::addObject(const char* buf)
+RpSerializer::addObject(const char* buf)
 {
-	// add object pointer to object map
-	m_objMap[obj->objectName()] = obj; 
-
-	// add object entry to reference count table
-	m_refCount[obj->objectName()] = 0; 
+	// todo 
+	
 }
 
@@ -35,5 +32,5 @@
 //
 void 
-Serializer::deleteObject(const char* name);
+RpSerializer::deleteObject(const char* name)
 {
 	typeObjMap::iterator iter = m_objMap.find(name);
@@ -42,5 +39,5 @@
 		return;
 
-	Serializable* obj_ptr = (*iter).second;
+	RpSerializable* obj_ptr = (*iter).second;
 
 	// decrement object's reference count
@@ -56,12 +53,14 @@
 
 void 
-Serializer::deleteObject(Serializable* obj)
+RpSerializer::deleteObject(RpSerializable* obj)
 {
+	const char* name = obj->objectName();
 	typeObjMap::iterator iter = m_objMap.find(name);
+
 	if (iter == m_objMap.end())
 		// does not exist
 		return;
 
-	Serializable* obj_ptr = (*iter).second;
+	RpSerializable* obj_ptr = (*iter).second;
 
 	// decrement object's reference count
@@ -77,5 +76,5 @@
 
 void 
-Serializer::deleteAllObjects()
+RpSerializer::deleteAllObjects()
 {
 	typeObjMap::iterator iter;
@@ -97,8 +96,8 @@
 
 // retrieve object
-Serializable* 
+RpSerializable* 
 RpSerializer::getObject(const char* objectName)
 {
-	typeObjMap::iterator iter m_objMap.find(objectName);
+	typeObjMap::iterator iter = m_objMap.find(objectName);
 	
 	if (iter != m_objMap.end()) {
@@ -139,8 +138,10 @@
 	// call each object to serialize itself
 	char* ptr = buf + headerSize;
+	int nb;
 	for (iter = m_objMap.begin(); iter != m_objMap.end(); iter++) {
-		Serializable* obj = (*iter).second;
-		obj->serialize(ptr); // object serialization
-		ptr += obj->numBytes(); // advance buffer pointer
+		RpSerializable* obj = (*iter).second;
+		nb = obj->numBytes();
+		obj->doSerialize(ptr, nb); // object serialization
+		ptr += nb; // advance buffer pointer
 	}
 
@@ -161,5 +162,5 @@
 RpSerializer::deserialize(const char* buf)
 {
-	// 
+	
 }
 
