@name Client Examples /* */ /** @name Client Coding Examples Example 1 Declaration of a Class and the addition of qualifiers, properties, and methods to that class. Finally, the code converts the class defined to XML with print, outputs it, restores it to a new class and compares the results. This example is one of the tests defined for Pegasus in the /commmon/tests directory

Example of Class Declaration

#include 
#include 

using namespace Pegasus;

void test01()
{
    ClassDecl class1("MyClass", "YourClass");

    class1
	.addQualifier(Qualifier("association", true))
	.addQualifier(Qualifier("q1", Uint32(55)))
	.addQualifier(Qualifier("q2", "Hello"))
	.addProperty(Property("message", "Hello"))
	.addProperty(Property("count", Uint32(77)))
	.addProperty(
	    Property("ref1", Reference("MyClass.key1=\"fred\""), "MyClass"))
	.addMethod(Method("isActive", Type::BOOLEAN)
	    .addParameter(Parameter("hostname", Type::STRING))
	    .addParameter(Parameter("port", Type::UINT32)));

    // class1.print();

    OutBuffer out;
    out << class1;

    InBuffer in(out.getData());
    ClassDecl tmp;
    in >> tmp;

    assert(class1.identical(tmp));
}

int main()
{
    try
    {
	test01();
    }
    catch (Exception& e)
    {
	cout << "Exception: " << e.getMessage() << endl;
    }

    cout << "+++++ passed all tests" << endl;

    return 0;
}


*/