Writing
CIDL files:
Distributor:
·
In Quoter/Distributor sub-directory, place a cidl file
StockDistributor.cidl that looks like this.
·
The MPC files we generated
earlier automatically invoked the CIDLC compiler to generate the Servants, Executors,
and Contexts for us. To reduce the amount of work and typing we need to do, we
will next instruct the CIDLC compiler to generate an empty StockDistributor Executor
implementation (Object implementation in the figure above). In the Quoter/Distributor
sub-directory, type
the following:
cidlc -I$TAO_ROOT -I$TAO_ROOT/tao
-I$CIAO_ROOT/ciao --gen-exec-impl StockDistributor.cidl
The above command will generate a
StockDistributor_exec.h and
StockDistributor_exec.cpp files. These
generated files greatly reduced the amount of work we do. We’ll edit
those files later in the tutorial to insert our business logic in the
Distributor component.
Broker:
·
In Quoter/Broker sub-directory, place a cidl file StockBroker.cidl that
looks like this.
·
The MPC files we
generated earlier automatically invoked the CIDLC compiler to generate the
Servants, Executors, and Contexts for us. To reduce the amount of work and typing we
need to do, we will next instruct the CIDLC compiler to generate an empty StockBroker
Executor implementation (Object implementation in the figure above). In the Quoter/Broker
sub-directory, type the
following:
cidlc -I$TAO_ROOT
-I$TAO_ROOT/tao -I$CIAO_ROOT/ciao --gen-exec-impl StockBroker.cidl
The above command will generate a
StockBroker_exec.h and StockBroker_exec.cpp
files. These generated
files greatly reduced the amount of work we do. We’ll edit those files
later in the tutorial to insert our business logic in the Broker component.
Note:
To
understand the meaning of different parameters passed to the CIDLC compiler
click here or type the following command:
cidlc --h
Implement
the Components:
Distributor:
·
The CIDLC compiler generated an
empty StockDistributor_exec.h
and StockDistributor_exec.cpp
files for us. You should now add your business logic to the executors. Look
into StockDistributor_exec.h
and
StockDistributor_exec.cpp to see how we implemented this.
Broker:
·
The CIDLC compiler generated an
empty StockBroker_exec.h
and StockBroker_exec.cpp files for us. You should now add your business logic to the executors. Look
into StockBroker_exec.h and
StockBroker_exec.cpp to see how we implemented this.