$search
00001 #ifndef TYPELIB_LANG_C_CONTAINERS_HH 00002 #define TYPELIB_LANG_C_CONTAINERS_HH 00003 00004 #include <typelib/typemodel.hh> 00005 00006 class Vector : public Typelib::Container 00007 { 00008 bool is_memcpy; 00009 using Typelib::Container::resize; 00010 void resize(std::vector<uint8_t>* ptr, size_t new_size) const; 00011 void copy(std::vector<uint8_t>* dst_ptr, size_t dst_idx, std::vector<uint8_t>* src_ptr, size_t src_idx, size_t count) const; 00012 void erase(std::vector<uint8_t>* ptr, size_t idx) const; 00013 std::string getIndirectTypeName(std::string const& element_name) const; 00014 00015 public: 00016 static std::string fullName(std::string const& element_name); 00017 Vector(Typelib::Type const& on); 00018 00019 bool isRandomAccess() const; 00020 void setElement(void* ptr, int idx, Typelib::Value value) const; 00021 Typelib::Value getElement(void* ptr, int idx) const; 00022 00023 size_t getElementCount(void const* ptr) const; 00024 void init(void* ptr) const; 00025 void destroy(void* ptr) const; 00026 void clear(void*) const; 00027 long getNaturalSize() const; 00028 void push(void* ptr, Typelib::Value v) const; 00029 bool erase(void* ptr, Typelib::Value v) const; 00030 bool compare(void* ptr, void* other) const; 00031 void copy(void* dst, void* src) const; 00032 bool visit(void* ptr, Typelib::ValueVisitor& visitor) const; 00033 void delete_if_impl(void* ptr, DeleteIfPredicate& pred) const; 00034 00035 MarshalOps::const_iterator dump( 00036 void const* container_ptr, size_t element_count, Typelib::OutputStream& stream, 00037 MarshalOps::const_iterator const begin, MarshalOps::const_iterator const end) const; 00038 00039 MarshalOps::const_iterator load( 00040 void* container_ptr, size_t element_count, 00041 Typelib::InputStream& stream, 00042 MarshalOps::const_iterator const begin, MarshalOps::const_iterator const end) const; 00043 00044 static Container const& factory(Typelib::Registry& registry, std::list<Typelib::Type const*> const& on); 00045 ContainerFactory getFactory() const; 00046 }; 00047 00048 class String : public Typelib::Container 00049 { 00050 public: 00051 String(Typelib::Registry const& registry); 00052 00053 size_t getElementCount(void const* ptr) const; 00054 void init(void* ptr) const; 00055 void destroy(void* ptr) const; 00056 void clear(void*) const; 00057 00058 long getNaturalSize() const; 00059 00060 void push(void* ptr, Typelib::Value v) const; 00061 00062 bool erase(void* ptr, Typelib::Value v) const; 00063 00064 bool compare(void* ptr, void* other) const; 00065 00066 void copy(void* dst, void* src) const; 00067 00068 bool visit(void* ptr, Typelib::ValueVisitor& visitor) const; 00069 00070 MarshalOps::const_iterator dump( 00071 void const* container_ptr, size_t element_count, Typelib::OutputStream& stream, 00072 MarshalOps::const_iterator const begin, MarshalOps::const_iterator const end) const; 00073 00074 MarshalOps::const_iterator load( 00075 void* container_ptr, size_t element_count, 00076 Typelib::InputStream& stream, 00077 MarshalOps::const_iterator const begin, MarshalOps::const_iterator const end) const; 00078 00079 void delete_if_impl(void* ptr, DeleteIfPredicate& pred) const; 00080 00081 static Container const& factory(Typelib::Registry& registry, std::list<Type const*> const& on); 00082 ContainerFactory getFactory() const; 00083 00084 static Type const& getElementType(Typelib::Registry const& registry); 00085 00086 // This method is never called since we redefine modifiedDependencyAliases 00087 std::string getIndirectTypeName(std::string const& element_name) const { return ""; } 00088 void modifiedDependencyAliases(Typelib::Registry& registry) const {} 00089 }; 00090 00091 00092 #endif 00093