#include <shader_map.h>
Public Member Functions | |
virtual miUint | size () const =0 |
returns the number of elements in the map. | |
virtual bool | is_empty () const =0 |
returns true if the map is empty. | |
virtual bool | has_declaration () const =0 |
returns true if the map has a declaration. | |
virtual Map_status | get (const miUint index, Map_element &map_element) const =0 |
gets the copy of an element. | |
virtual Map_status | set (const miUint index, const Map_element &map_element)=0 |
sets the desired element in the map. | |
virtual Map_status | append (const Map_element &map_element)=0 |
appends the desired element at the end. | |
virtual Map_status | read (const char *file_name)=0 |
reads a map from a file. | |
virtual Map_status | append_to (const char *file_name) const =0 |
appends the map to the existing file. | |
virtual Map_status | append_from (const char *file_name)=0 |
appends the contents of the file to the map. | |
virtual Map_status | write (const char *file_name) const =0 |
writes the map to file. |
The Map_base class is an interface class which provides access to a map, to its elements through the use of get/set methods and to its declaration, and it also provides ways to read/write maps from/to files. There are two wrapper classes which provide a convenient way to manage this class: the Access_map class (read-only access to a map) and the Edit_map class (read-write access to a map). For example, a shader might access and use a map in the following way:
Access_map map (tag);
if (!map->is_empty()) { ... }
|
appends the desired element at the end.
|
|
appends the contents of the file to the map.
|
|
appends the map to the existing file.
|
|
gets the copy of an element.
|
|
returns true if the map has a declaration.
|
|
returns true if the map is empty.
|
|
reads a map from a file.
|
|
sets the desired element in the map.
|
|
returns the number of elements in the map.
|
|
writes the map to file.
|
Copyright © 1986-2009 by
mental images GmbH