[0b990d] | 1 | //
|
---|
| 2 | // File: MPQC_ComponentFactory_Impl.cc
|
---|
| 3 | // Symbol: MPQC.ComponentFactory-v0.2
|
---|
| 4 | // Symbol Type: class
|
---|
| 5 | // Babel Version: 0.10.2
|
---|
| 6 | // Description: Server-side implementation for MPQC.ComponentFactory
|
---|
| 7 | //
|
---|
| 8 | // WARNING: Automatically generated; only changes within splicers preserved
|
---|
| 9 | //
|
---|
| 10 | // babel-version = 0.10.2
|
---|
| 11 | //
|
---|
| 12 | #include "MPQC_ComponentFactory_Impl.hh"
|
---|
| 13 |
|
---|
| 14 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory._includes)
|
---|
| 15 | #include "dc/babel/babel-cca/AllBabelCCA.hh"
|
---|
| 16 | #include "MPQC_ComponentClassDescription.hh"
|
---|
| 17 | #include "MPQC_IntegralEvaluatorFactory.hh"
|
---|
| 18 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory._includes)
|
---|
| 19 |
|
---|
| 20 | // user-defined constructor.
|
---|
| 21 | void MPQC::ComponentFactory_impl::_ctor() {
|
---|
| 22 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory._ctor)
|
---|
| 23 | addDescription( "MPQC.IntegralEvaluatorFactory", "IntegralEvaluatorFactory");
|
---|
| 24 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory._ctor)
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | // user-defined destructor.
|
---|
| 28 | void MPQC::ComponentFactory_impl::_dtor() {
|
---|
| 29 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory._dtor)
|
---|
| 30 | // add destruction details here
|
---|
| 31 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory._dtor)
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | // static class initializer.
|
---|
| 35 | void MPQC::ComponentFactory_impl::_load() {
|
---|
| 36 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory._load)
|
---|
| 37 | // guaranteed to be called at most once before any other method in this class
|
---|
| 38 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory._load)
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | // user-defined static methods: (none)
|
---|
| 42 |
|
---|
| 43 | // user-defined non-static methods:
|
---|
| 44 | /**
|
---|
| 45 | * Method: addDescription[]
|
---|
| 46 | */
|
---|
| 47 | void
|
---|
| 48 | MPQC::ComponentFactory_impl::addDescription (
|
---|
| 49 | /* in */ const ::std::string& className,
|
---|
| 50 | /* in */ const ::std::string& classAlias )
|
---|
| 51 | throw ()
|
---|
| 52 | {
|
---|
| 53 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory.addDescription)
|
---|
| 54 |
|
---|
| 55 | MPQC::ComponentClassDescription cccd;
|
---|
| 56 | cccd = MPQC::ComponentClassDescription::_create();
|
---|
| 57 | cccd.initialize(className, classAlias);
|
---|
| 58 | gov::cca::ComponentClassDescription gcccd = cccd;
|
---|
| 59 | descriptions.push_back(gcccd);
|
---|
| 60 |
|
---|
| 61 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory.addDescription)
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | /**
|
---|
| 65 | * Collect the currently obtainable class name strings from
|
---|
| 66 | * factories known to the builder and the from the
|
---|
| 67 | * already instantiated components.
|
---|
| 68 | * @return The list of class description, which may be empty, that are
|
---|
| 69 | * known a priori to contain valid values for the className
|
---|
| 70 | * argument of createInstance.
|
---|
| 71 | * @throws CCAException in the event of error.
|
---|
| 72 | */
|
---|
| 73 | ::sidl::array< ::gov::cca::ComponentClassDescription>
|
---|
| 74 | MPQC::ComponentFactory_impl::getAvailableComponentClasses ()
|
---|
| 75 | throw (
|
---|
| 76 | ::gov::cca::CCAException
|
---|
| 77 | )
|
---|
| 78 | {
|
---|
| 79 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory.getAvailableComponentClasses)
|
---|
| 80 |
|
---|
| 81 | size_t nd = descriptions.size();
|
---|
| 82 | ::sidl::array< ::gov::cca::ComponentClassDescription> descArray =
|
---|
| 83 | ::sidl::array< ::gov::cca::ComponentClassDescription>::create1d(nd);
|
---|
| 84 | for (size_t i = 0; i < nd; i++) {
|
---|
| 85 | descArray.set(i, descriptions[i]);
|
---|
| 86 | }
|
---|
| 87 | return descArray;
|
---|
| 88 |
|
---|
| 89 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory.getAvailableComponentClasses)
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | /**
|
---|
| 93 | * the component instance returned is nil if the name is unknown
|
---|
| 94 | * to the factory. The component is raw: it has been constructed
|
---|
| 95 | * but not initialized via setServices.
|
---|
| 96 | */
|
---|
| 97 | ::gov::cca::Component
|
---|
| 98 | MPQC::ComponentFactory_impl::createComponentInstance (
|
---|
| 99 | /* in */ const ::std::string& className )
|
---|
| 100 | throw ()
|
---|
| 101 | {
|
---|
| 102 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory.createComponentInstance)
|
---|
| 103 |
|
---|
| 104 | if (className == "MPQC.IntegralEvaluatorFactory") {
|
---|
| 105 | MPQC::IntegralEvaluatorFactory x =
|
---|
| 106 | MPQC::IntegralEvaluatorFactory::_create();
|
---|
| 107 | gov::cca::Component c = x;
|
---|
| 108 | return c;
|
---|
| 109 | }
|
---|
| 110 |
|
---|
| 111 | gov::cca::Component dummy;
|
---|
| 112 | return dummy;
|
---|
| 113 |
|
---|
| 114 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory.createComponentInstance)
|
---|
| 115 | }
|
---|
| 116 |
|
---|
| 117 | /**
|
---|
| 118 | * reclaim any resources the factory may have associated with
|
---|
| 119 | * the port it is using. This will occur after the
|
---|
| 120 | * normal component shutdown (ala componentrelease) is finished.
|
---|
| 121 | */
|
---|
| 122 | void
|
---|
| 123 | MPQC::ComponentFactory_impl::destroyComponentInstance (
|
---|
| 124 | /* in */ const ::std::string& className,
|
---|
| 125 | /* in */ ::gov::cca::Component c )
|
---|
| 126 | throw ()
|
---|
| 127 | {
|
---|
| 128 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory.destroyComponentInstance)
|
---|
| 129 | // insert implementation here
|
---|
| 130 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory.destroyComponentInstance)
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 |
|
---|
| 134 | // DO-NOT-DELETE splicer.begin(MPQC.ComponentFactory._misc)
|
---|
| 135 | // Put miscellaneous code here
|
---|
| 136 | // DO-NOT-DELETE splicer.end(MPQC.ComponentFactory._misc)
|
---|
| 137 |
|
---|