TclListSerialize.h

Go to the documentation of this file.
00001 /*
00002  *    Copyright 2006 Intel Corporation
00003  * 
00004  *    Licensed under the Apache License, Version 2.0 (the "License");
00005  *    you may not use this file except in compliance with the License.
00006  *    You may obtain a copy of the License at
00007  * 
00008  *        http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  *    Unless required by applicable law or agreed to in writing, software
00011  *    distributed under the License is distributed on an "AS IS" BASIS,
00012  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *    See the License for the specific language governing permissions and
00014  *    limitations under the License.
00015  */
00016 
00017 #ifndef _OASYS_TCL_LIST_SERIALIZE_H_
00018 #define _OASYS_TCL_LIST_SERIALIZE_H_
00019 
00020 #include <tcl.h>
00021 #include "Serialize.h"
00022 
00023 namespace oasys {
00024 
00032 class TclListSerialize : public SerializeAction {
00033 public:
00037     enum {
00038         KEEP_SINGLETON_SUBLISTS = 1,    
00039     };
00040         
00044     TclListSerialize(Tcl_Interp* interp, Tcl_Obj* list_obj,
00045                      context_t context, int options);
00046 
00050     ~TclListSerialize();
00051  
00055     int action(const SerializableObject* const_object)
00056     {
00057         SerializableObject* object = (SerializableObject*)const_object;
00058         return SerializeAction::action(object);
00059     }
00060     
00063     void process(const char* name, u_int64_t* i);
00064     void process(const char* name, u_int32_t* i);
00065     void process(const char* name, u_int16_t* i);
00066     void process(const char* name, u_int8_t* i);
00067     void process(const char* name, bool* b);
00068     void process(const char* name, u_char* bp, u_int32_t len);
00069     void process(const char* name, u_char** bp, u_int32_t* lenp, int flags);
00070     void process(const char* name, std::string* s);
00071     void process(const char* name, SerializableObject* object);
00073 
00074 private:
00075     Tcl_Interp* interp_;
00076     Tcl_Obj*    list_obj_;
00077 };
00078 
00079 } // namespace oasys
00080 
00081 #endif /* _OASYS_TCL_LIST_SERIALIZE_H_ */

Generated on Sat Sep 8 08:43:35 2007 for DTN Reference Implementation by  doxygen 1.5.3