Public Member Functions | Static Public Member Functions
String Class Reference

#include <containers.hh>

Inheritance diagram for String:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void clear (void *) const
bool compare (void *ptr, void *other) const
void copy (void *dst, void *src) const
void delete_if_impl (void *ptr, DeleteIfPredicate &pred) const
void destroy (void *ptr) const
MarshalOps::const_iterator dump (void const *container_ptr, size_t element_count, Typelib::OutputStream &stream, MarshalOps::const_iterator const begin, MarshalOps::const_iterator const end) const
bool erase (void *ptr, Typelib::Value v) const
size_t getElementCount (void const *ptr) const
ContainerFactory getFactory () const
std::string getIndirectTypeName (std::string const &element_name) const
long getNaturalSize () const
void init (void *ptr) const
MarshalOps::const_iterator load (void *container_ptr, size_t element_count, Typelib::InputStream &stream, MarshalOps::const_iterator const begin, MarshalOps::const_iterator const end) const
void modifiedDependencyAliases (Typelib::Registry &registry) const
void push (void *ptr, Typelib::Value v) const
 String (Typelib::Registry const &registry)
bool visit (void *ptr, Typelib::ValueVisitor &visitor) const

Static Public Member Functions

static Container const & factory (Typelib::Registry &registry, std::list< Type const * > const &on)
static Type const & getElementType (Typelib::Registry const &registry)

Detailed Description

Definition at line 48 of file containers.hh.


Constructor & Destructor Documentation

String::String ( Typelib::Registry const &  registry)

Definition at line 365 of file containers.cc.


Member Function Documentation

void String::clear ( void *  ptr) const [virtual]

Removes all elements from this container

Implements Typelib::Container.

Definition at line 381 of file containers.cc.

bool String::compare ( void *  ptr,
void *  other 
) const [virtual]

Called to check if +ptr+ and +other+, which are containers of the same type, actually contain the same data

Returns:
true if the two containers have the same data, false otherwise

Implements Typelib::Container.

Definition at line 408 of file containers.cc.

void String::copy ( void *  dst,
void *  src 
) const [virtual]

Called to copy the contents of +src+ into +dst+, which are both containers of the same type.

Implements Typelib::Container.

Definition at line 415 of file containers.cc.

void String::delete_if_impl ( void *  ptr,
DeleteIfPredicate pred 
) const [virtual]

Implements Typelib::Container.

Definition at line 460 of file containers.cc.

void String::destroy ( void *  ptr) const [virtual]

Implements Typelib::Container.

Definition at line 377 of file containers.cc.

Container::MarshalOps::const_iterator String::dump ( void const *  container_ptr,
size_t  element_count,
Typelib::OutputStream stream,
MarshalOps::const_iterator const  begin,
MarshalOps::const_iterator const  end 
) const [virtual]

The marshalling process calls this method so that the contents of the container are dumped into the provided buffer.

In the marshalled stream, all containers are dumped as <element-count [64 bits]> <elements>

  • container_ptr the pointer to the container data
  • element_count the count of elements in the container. This is passed here to avoid costly computations: getElementCount is already called by the marshalling code itself.
  • stream the stream that will be used to dump the data
  • begin the marshalling code that describes the marshalling process for one element
  • end end of the marshalling code that describes the marshalling process for one element
    Returns:
    the marshalling process should end at the first FLAG_END found in [begin, end) (with nesting taken into account). The returned value is the iterator on this FLAG_END element (i.e. *retval == FLAG_END is a postcondition of this method)

Implements Typelib::Container.

Definition at line 435 of file containers.cc.

bool String::erase ( void *  ptr,
Typelib::Value  v 
) const [virtual]

Removes the element equal to in ptr.

Returns:
true if has been found in ptr, false otherwise.

Implements Typelib::Container.

Definition at line 403 of file containers.cc.

Container const & String::factory ( Typelib::Registry registry,
std::list< Type const * > const &  on 
) [static]

Definition at line 463 of file containers.cc.

size_t String::getElementCount ( void const *  ptr) const [virtual]

Implements Typelib::Container.

Definition at line 368 of file containers.cc.

Type const & String::getElementType ( Typelib::Registry const &  registry) [static]

Definition at line 358 of file containers.cc.

Container::ContainerFactory String::getFactory ( ) const [virtual]

Implements Typelib::Container.

Definition at line 480 of file containers.cc.

std::string String::getIndirectTypeName ( std::string const &  inside_name) const [inline, virtual]

Overloaded in subclasses to return the name of this type based on the name of the indirection

This is solely used by modifiedDependencyAliases() to update the set of aliases for a given type

Implements Typelib::Indirect.

Definition at line 87 of file containers.hh.

long String::getNaturalSize ( ) const [virtual]

Called to return the natural size of the container, i.e. the size it has on this particular machine. This can be different than getSize() in case of registries generated on other machines.

Implements Typelib::Container.

Definition at line 387 of file containers.cc.

void String::init ( void *  ptr) const [virtual]

Implements Typelib::Container.

Definition at line 373 of file containers.cc.

Container::MarshalOps::const_iterator String::load ( void *  container_ptr,
size_t  element_count,
Typelib::InputStream stream,
MarshalOps::const_iterator const  begin,
MarshalOps::const_iterator const  end 
) const [virtual]

The marshalling process calls this method so that the contents of the container are loaded from the provided buffer.

In the marshalled stream, all containers are dumped as <element-count [64 bits]> <elements>

  • container_ptr the pointer to the container data
  • element_count the count of elements in the container, loaded from the stream.
  • stream the stream from which the data will be read
  • in_offset the offset in buffer of the first element of the container
  • begin the marshalling code that describes the loading process for one element
  • end end of the marshalling code that describes the loading process for one element
    Returns:
    the marshalling process should end at the first FLAG_END found in [begin, end) (with nesting taken into account). The first element of the returned value is the iterator on this FLAG_END element (i.e. *retval == FLAG_END is a postcondition of this method). The second element is the new value of in_offset

Implements Typelib::Container.

Definition at line 446 of file containers.cc.

void String::modifiedDependencyAliases ( Typelib::Registry registry) const [inline, virtual]

Called by the registry if one (or more) of this type's dependencies is aliased

The default implementation does nothing. It is reimplemented in types for which the name is built from the dependencies' name

Reimplemented from Typelib::Indirect.

Definition at line 88 of file containers.hh.

void String::push ( void *  ptr,
Typelib::Value  v 
) const [virtual]

Pushes the given element v into the container at +ptr+

Implements Typelib::Container.

Definition at line 392 of file containers.cc.

bool String::visit ( void *  ptr,
Typelib::ValueVisitor visitor 
) const [virtual]

Implements Typelib::Container.

Definition at line 422 of file containers.cc.


The documentation for this class was generated from the following files:


typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Mon Sep 14 2015 15:08:18