images/plugin_impl/marker_entry_impl.h

Go to the documentation of this file.
00001 /*
00002  * File Name: marker_entry_impl.h
00003  */
00004 
00005 /*
00006  * This file is part of uds-plugin-images.
00007  *
00008  * uds-plugin-images is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * uds-plugin-images is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 /**
00023  * Copyright (C) 2008 iRex Technologies B.V.
00024  * All rights reserved.
00025  */
00026 
00027 #ifndef IMAGES_MARKER_ENTRY_IMPL_H_
00028 #define IMAGES_MARKER_ENTRY_IMPL_H_
00029 
00030 #include "plugin_inc.h"
00031 #include "collection_impl.h"
00032 #include "string_impl.h"
00033 #include "log.h"
00034 
00035 namespace images
00036 {
00037 
00038 // Function to allocate a MarkerEntry structure.
00039 MarkerEntry* marker_entry_new(unsigned int uds_private_size);
00040 
00041 // Release the whole marker tree pointed by self.
00042 void marker_entry_free_recursive(MarkerEntry* self);
00043 
00044 template <>
00045 class DataContainer<MarkerEntry *> : public DataContainerBase
00046 {
00047 public:
00048     DataContainer(){}
00049     ~DataContainer()
00050     {
00051         for (unsigned int i=0; i<data.size(); i++)
00052         {
00053             marker_entry_free_recursive(data[i]);
00054         }
00055     }
00056 
00057 public:
00058     virtual bool get_first_element(void **data_ptr)
00059     {
00060         *data_ptr = &data[0];
00061         return true;
00062     }
00063 
00064     virtual int  get_count()
00065     {
00066         return static_cast<int>(data.size());
00067     }
00068 
00069     std::vector<MarkerEntry *> & ref() 
00070     {
00071         return data;
00072     }
00073 
00074 private:
00075     std::vector<MarkerEntry *> data;
00076 };
00077 
00078 };  // namespace pdf
00079 
00080 #endif
Generated by  doxygen 1.6.2-20100208