(file) Return to ExamplesClient.dxx CVS log (file) (dir) Up to [Pegasus] / pegasus / doc / DevManual

File: [Pegasus] / pegasus / doc / DevManual / ExamplesClient.dxx (download)
Revision: 1.1, Fri Feb 23 20:29:05 2001 UTC (23 years, 2 months ago) by karl
Branch: MAIN
CVS Tags: version_1_01, version_0_99_1, version_0_99, version_0_97_3, version_0_97_2, version_0_97_1, version_0_97, version_0_96, version_0_95, version_0_8, version_0_79_4, test, stable_0_95, stable, pep_88, pegasus25BeforeLicenseUpdate, merge_of_dev, mday-merge-start, mday-merge-pegasus/src/Pegasus/Server, mday-merge-pegasus/src/Pegasus/Common, mday-2-0-patches, main, local, dev_dead, dev, VERSION_2_1_RELEASE_HEAD, VERSION_2_1_RELEASE_BRANCH, VERSION_2_1_RELEASE, VERSION_2_1_1_RELEASE, VERSION_2_01_01, VERSION_2_00_RC_4, VERSION_2_00_RC_3, VERSION_2_00_RC_2, VERSION_2_00_RC_1, VERSION_2_00_BRANCH, VERSION_1_10, VERSION_1_09, VERSION_1_08, VERSION_1_07, TEST, SNAPSHOT_1_04, SLPPERFINST-root, SLPPERFINST-branch, RELEASE_2_5_0-RC1, RELEASE_2_5_0, RELEASE_2_4_FC_CANDIDATE_1, RELEASE_2_4_3, RELEASE_2_4_2, RELEASE_2_4_1-BETA3, RELEASE_2_4_1-BETA2, RELEASE_2_4_1-BETA1, RELEASE_2_4_1, RELEASE_2_4_0-RC3, RELEASE_2_4_0-RC2, RELEASE_2_4_0, RELEASE_2_4-root, RELEASE_2_4-branch, RELEASE_2_3_2-testfreeze, RELEASE_2_3_2-root, RELEASE_2_3_2-releasesnapshot, RELEASE_2_3_2-branch-freeze, RELEASE_2_3_2-branch, RELEASE_2_3_1-root, RELEASE_2_3_1-branch, RELEASE_2_3_0-root, RELEASE_2_3_0-msg-freeze, RELEASE_2_3_0-branch, RELEASE_2_2_1-snapshot, RELEASE_2_2_0_0-release, RELEASE_2_2_0-root, RELEASE_2_2_0-branch, RELEASE_2_2-root, PRE_LICENSE_UPDATE_2003, POST_LICENSE_UPDATE_2003, PEP217_PRE_BRANCH, PEP217_POST_BRANCH, PEP217_BRANCH, PEP214ROOT, PEP214BRANCH, PEP214-root, PEP214-branch, PEP213_SIZE_OPTIMIZATIONS, PEP-214B-root, PEGASUS_FC_VERSION_2_2, PEGASUS_2_5_0_PerformanceDev-string-end, PEGASUS_2_5_0_PerformanceDev-rootlt, PEGASUS_2_5_0_PerformanceDev-root, PEGASUS_2_5_0_PerformanceDev-r2, PEGASUS_2_5_0_PerformanceDev-r1, PEGASUS_2_5_0_PerformanceDev-lit-end, PEGASUS_2_5_0_PerformanceDev-buffer-end, PEGASUS_2_5_0_PerformanceDev-branch, PEGASUS_2_5_0_PerformanceDev-AtomicInt-branch, PEG25_IBM_5_16_05, NPEGASUS_2_5_0_PerformanceDev-String-root, NNPEGASUS_2_5_0_PerformanceDev-String-branch, MONITOR_CONSOLIDATION_2_5_BRANCH, LOCAL_ASSOCPROV-ROOT, LOCAL_ASSOCPROV-BRANCH, IBM_241_April1405, CQL_2_5_BRANCH, CHUNKTESTDONE_PEP140, BUG_4225_PERFORMANCE_VERSION_1_DONE
documentation cleanup

@name Client Examples
/*
	$Log: ExamplesClient.dxx,v $
	Revision 1.1  2001/02/23 20:29:05  karl
	documentation cleanup

*/

/** @name Client Coding Examples


<B>Example 1</B>

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

<PRE><CODE>
Example of Class Declaration

#include <Pegasus/ClassDecl.h>
#include <Pegasus/Name.h>

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;
}

</CODE/>
</PRE>
*/

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2