/// Test module
module class Foo::Test;

// Dependencies
using std::string;
using std::iostream;
using std::vector;

// Data to be added to the header
export
{
    #define foreach(a,b) for (a = b.begin(); a != b.end(); ++a)
}

// Data to be added to the source file
using
{
    struct InternalStruct
    {
        float f;
        int i;
    };
}

public :

/// Nested class
template<class T>
class Nested
{
public :

    /// Nested union
    union MyUnion
    {
        float f;
        int   i;
    };

    /// Constructor
    new()
    {
    }
    
    /// Member function
    /** \param f The float
    */
    void MemberFunction(T f)
    {
        std::cout << "Nested::MemberFunction : " << f << std::endl;
    }
    
private :

    struct PrivateData
    {
        MyUnion u;
    };

    /// Member variable
    float fMember_;
    
};

/// Typedef
global typedef unsigned int uint;

/// Template typedef
typedef vector<Test> MyVector;

/// Function typedef
typedef double (Test::*MyFunctionPointer)(int, float*, const char*) const;

/// Enum
enum MyEnum
{
    SOME_VALUE,             /// A value
    SOME_OTHER_VALUE = 1,   /// Another value
    SOME_DEFAULT = 1000     /// Default value
}

/// Member variable
string sMember;

/// Second member variable
int* pPointer;

Nested::PrivateData pd;

/// Static variable
static string CLASS_NAME = "Foo::Test{The)String < ] >";

/// Global variable
global float fTheFloat = 5.0f;

/// Constructor
new(string s) : sMember(s), fMember_(0.0f)
{
    cout << "Constructor" << endl;
}

/// Destructor
delete()
{
    cout << "Destructor" << endl;
}

/// Test function
/** \param s The string
*   \param f The float
*/
void MemberFunction1(string s, float f)
{
    cout << "MemberFunction1 : " << s << ", " << f << endl;
    sMember = s;
    fMember_ = f;
}

/// Template function
/** \param s The string
*   \param f The float
*/
template<class T>, using std::iostream,
void MemberFunction2(T t)
{
    std::cout << "MemberFunction2 : " << t << std::endl;
}

private :

/// Private member variable
float fMember_;

/// Free function
global float FreeFunction()
{
    float a = 2.0f;
    float b = 5.0f;
    return a + b;
}
