summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/value/Factory.cpp
blob: a94b94dec818f7024dc5eb16a0b6a3f1b000ae82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

#include <Ice/Ice.h>
#include <Factory.h>
#include <ValueI.h>

using namespace std;

Ice::ObjectPtr
Factory::create(const string& id)
{
    if (id == "::Printer")
	return new PrinterI;

    if (id == "::DerivedPrinter")
	return new DerivedPrinterI;

    assert(false);
    return 0;
}