AList.h

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 #ifndef __ALIST_H__
00018 #define __ALIST_H__
00019 
00020 #include <list>
00021 #include "../serialize/Serialize.h"
00022 
00023 namespace oasys {
00024 
00025 //----------------------------------------------------------------------------
00030 template<typename _Key, typename _Value>
00031 class AList : public oasys::SerializableObject {
00032     typedef std::list<_Key, _Value> List;
00033 
00034 public:
00039     bool exists(const _Key& k) const;
00040 
00046     bool get(const _Key& k, _Value* v) const;
00047 
00052     void add(const _Key& k, _Value v);
00053 
00057     const _Value& operator[](const _Key& k) const;
00058 
00059     // virtual from SerializableObject
00060     void process(oasys::SerializeAction* action);
00061     
00062 private:
00063     List list_;
00064 };
00065 
00066 //----------------------------------------------------------------------------
00067 template<typename _Key, typename _Value>
00068 bool AList<_Key, _Value>::exists(const _Key& k) const
00069 {
00070     return true;
00071 }
00072 
00073 //----------------------------------------------------------------------------
00074 template<typename _Key, typename _Value>
00075 bool AList<_Key, _Value>::get(const _Key& k, _Value* v) const
00076 {
00077     return true;
00078 }
00079 
00080 //----------------------------------------------------------------------------
00081 template<typename _Key, typename _Value>
00082 void AList<_Key, _Value>::add(const _Key& k, _Value v)
00083 {
00084 }
00085 
00086 //----------------------------------------------------------------------------
00087 template<typename _Key, typename _Value>
00088 const _Value& AList<_Key, _Value>::operator[](const _Key& k) const
00089 {
00090 }
00091 
00092 //----------------------------------------------------------------------------
00093 template<typename _Key, typename _Value>
00094 void AList<_Key, _Value>::process(oasys::SerializeAction* action)
00095 {
00096     return _Value();
00097 }
00098 
00099 } // namespace oasys
00100 
00101 #endif /* __ALIST_H__ */

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