C++ Standard Library Converters – pyne.stlcontainers

This module contains wrapper classes for commonly used constructs in the C++ standard library. Because Cython does not yet do templating, these classes must be declared and defined for every type.

All functionality may be found in the stlcontainers module:

from pyne import stlcontainers

This module is largely used by PyNE under the convers, in Cython and elsewhere. However, these classes are of more general interest, so feel free to use them in your own code as well.

Set Proxies

class pyne.stlcontainers.SetInt

Wrapper class for C++ standard library sets of type <integer>. Provides set like interface on the Python level.

Parameters:

new_set : bool or set-like

Boolean on whether to make a new set or not, or set-like object with values which are castable to the appropriate type.

free_set : bool

Flag for whether the pointer to the C++ set should be deallocated when the wrapper is dereferenced.

class pyne.stlcontainers.SetStr

Wrapper class for C++ standard library sets of type <string>. Provides set like interface on the Python level.

Parameters:

new_set : bool or set-like

Boolean on whether to make a new set or not, or set-like object with values which are castable to the appropriate type.

free_set : bool

Flag for whether the pointer to the C++ set should be deallocated when the wrapper is dereferenced.

Map Proxies

class pyne.stlcontainers.MapStrInt

Wrapper class for C++ standard library maps of type <string, integer>. Provides dictionary like interface on the Python level.

Parameters:

new_map : bool or dict-like

Boolean on whether to make a new map or not, or dict-like object with keys and values which are castable to the appropriate type.

free_map : bool

Flag for whether the pointer to the C++ map should be deallocated when the wrapper is dereferenced.

class pyne.stlcontainers.MapIntStr

Wrapper class for C++ standard library maps of type <integer, string>. Provides dictionary like interface on the Python level.

Parameters:

new_map : bool or dict-like

Boolean on whether to make a new map or not, or dict-like object with keys and values which are castable to the appropriate type.

free_map : bool

Flag for whether the pointer to the C++ map should be deallocated when the wrapper is dereferenced.

class pyne.stlcontainers.MapIntDouble

Wrapper class for C++ standard library maps of type <integer, double>. Provides dictionary like interface on the Python level.

Parameters:

new_map : bool or dict-like

Boolean on whether to make a new map or not, or dict-like object with keys and values which are castable to the appropriate type.

free_map : bool

Flag for whether the pointer to the C++ map should be deallocated when the wrapper is dereferenced.

class pyne.stlcontainers.MapIntComplex

Wrapper class for C++ standard library maps of type <integer, complex>. Provides dictionary like interface on the Python level.

Parameters:

new_map : bool or dict-like

Boolean on whether to make a new map or not, or dict-like object with keys and values which are castable to the appropriate type.

free_map : bool

Flag for whether the pointer to the C++ map should be deallocated when the wrapper is dereferenced.