/**
    @file hello5.h
    @brief Example of support for base classes.

    The class Hello in this example will have both the method Say() defined in
    it and the method SetName() defined in the base class.
 */

#ifndef _HELLO_H_
#define _HELLO_H_

#include "tt/string.h"

/**
    A base class for greeting messages, such as Hello or GoodBye.

    Because of noexport keyword below, this class will not appear in the COM
    interface at all (but its methods will still appear as part of the derived
    Hello class). You may also remove the noexport but then you will have to
    add a coclass section for the Greeting to the main IDL file and also define
    the IID for this class.

    @noexport
 */
class Greeting
{
public:
    /**
        Set the name associated with the greeting.

        @param name the name to use in the greeting, shouldn't be empty
     */
    void SetName(const std::string& name) { m_name = name; }

protected:
    std::string m_name;
};

/**
    A class generating a welcome greeting deriving from another class.

    @iid 2ec1a276-5bb7-4fe2-a16c-3f7c2acaa16a
 */
class Hello : public Greeting
{
public:
    /**
        Show the greeting to the user.

        Greeting::SetName() must be called before this function.
     */
    void Say();
};

#endif // _HELLO_H_

