Serialize.cc

Go to the documentation of this file.
00001 /*
00002  *    Copyright 2004-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 #include "Serialize.h"
00018 #include "debug/DebugUtils.h"
00019 
00020 namespace oasys {
00021 
00022 //----------------------------------------------------------------------
00023 SerializeAction::SerializeAction(action_t  action, 
00024                                  context_t context, 
00025                                  int       options)
00026     : action_(action), 
00027       context_(context), 
00028       options_(options), 
00029       log_(0), 
00030       error_(false)
00031 {
00032 }
00033 
00034 //----------------------------------------------------------------------
00035 SerializeAction::~SerializeAction()
00036 {
00037 }
00038 
00039 //----------------------------------------------------------------------
00040 int
00041 SerializeAction::action(SerializableObject* object)
00042 {
00043     error_ = false;
00044 
00045     begin_action();
00046     object->serialize(this);
00047     end_action();
00048     
00049     if (error_ == true)
00050         return -1;
00051     
00052     return 0;
00053 }
00054 
00055 
00056 //----------------------------------------------------------------------
00057 void
00058 SerializeAction::begin_action()
00059 {
00060 }
00061 
00062 //----------------------------------------------------------------------
00063 void
00064 SerializeAction::end_action()
00065 {
00066 }
00067 
00068 //----------------------------------------------------------------------
00069 Builder Builder::static_builder_;
00070 
00071 } // namespace oasys

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