/**
    @file hello3b.h
    @brief Example of methods taking/returning class parameters.

    This examples extends hello3.h with a method showing how a new object may
    be also returned from a method.
 */

#ifndef _HELLO_H_
#define _HELLO_H_

#include "tt/beforestd.h"
#include <memory>
#include "tt/afterstd.h"

/**
    A simple class representing a number.

    @iid b6de1983-b262-4a67-b6ae-8ef53c078f72
 */
class Number
{
public:
    /// Default ctor (exported classes must have default ctor).
    Number() : m_n(0) { }

    /// Ctor from a number.
    Number(int n) : m_n(n) { }

    /// Changes the number.
    void Set(int n) { m_n = n; }

    /// Returns the number.
    int Get() const { return m_n; }

private:
    int m_n;
};

/**
    A class using Number objects.

    @iid 2ec1a276-5bb7-4fe2-a16c-3f7c2acaa16a
 */
class Hello
{
public:
    /**
        A very simple function which just shows a message box to the user.

        @param num the number to show to the user
     */
    void ShowNumber(const Number& num);

    /**
        A method returning a new number with the given value.

        @param n the initial value of the number
        @return the new number object initialized with the given number
     */
    std::auto_ptr<Number> CreateNumber(int n) const;
};

#endif // _HELLO_H_

