FAUST compiler  0.9.9.6b8
Public Member Functions | Private Member Functions | Private Attributes
property< P > Class Template Reference

#include <property.hh>

Inheritance diagram for property< P >:
Inheritance graph
[legend]
Collaboration diagram for property< P >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 property ()
 property (const char *keyname)
void set (Tree t, const P &data)
bool get (Tree t, P &data)
void clear (Tree t)

Private Member Functions

Paccess (Tree t)

Private Attributes

Tree fKey

Detailed Description

template<class P>
class property< P >

Definition at line 6 of file property.hh.


Constructor & Destructor Documentation

template<class P>
property< P >::property ( ) [inline]

Definition at line 18 of file property.hh.

: fKey(tree(Node(unique("property_")))) {}
template<class P>
property< P >::property ( const char *  keyname) [inline]

Definition at line 20 of file property.hh.

: fKey(tree(Node(keyname))) {}

Member Function Documentation

template<class P>
P* property< P >::access ( Tree  t) [inline, private]

Definition at line 10 of file property.hh.

Referenced by property< Loop * >::clear(), property< Loop * >::get(), and property< Loop * >::set().

    {
        Tree d = t->getProperty(fKey);
        return d ? (P*)(d->node().getPointer()) : 0;
    }

Here is the caller graph for this function:

template<class P>
void property< P >::clear ( Tree  t) [inline]

Definition at line 43 of file property.hh.

    {
        P* p = access(t);
        if (p) { delete p; }
        t->clearProperty(fKey);
    }
template<class P>
bool property< P >::get ( Tree  t,
P data 
) [inline]

Definition at line 32 of file property.hh.

Referenced by DocCompiler::getCompiledExpression(), Klass::getLoopProperty(), DocCompiler::getVectorNameProperty(), makeSimpleType(), makeTableType(), and makeTupletType().

    {
        P* p = access(t);
        if (p) {
            data = *p;
            return true;
        } else {
            return false;
        }
    }

Here is the caller graph for this function:

template<class P>
void property< P >::set ( Tree  t,
const P data 
) [inline]

Definition at line 22 of file property.hh.

Referenced by makeSimpleType(), makeTableType(), makeTupletType(), DocCompiler::setCompiledExpression(), Klass::setLoopProperty(), and DocCompiler::setVectorNameProperty().

    {
        P* p = access(t);
        if (p) {
            *p = data;
        } else {
            t->setProperty(fKey, tree(Node(new P(data))));
        }
    }

Here is the caller graph for this function:


Member Data Documentation

template<class P>
Tree property< P >::fKey [private]

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