Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- builder::prepareAndDeliverMsg1(msg1_arg1,msg1_arg2)
- {
- }
- builder::prepareAndDeliverMsg2(msg2_arg1,msg2_arg2)
- {
- }
- ///----
- builder::prepareMsg1(msg1_arg1,msg1_arg2)
- {
- }
- builder::prepareMsg2(msg2_arg1,msg2_arg2)
- {
- }
- builder::deliverMsg1(msg1_arg1)
- {
- This function, inserts re-calculated msg1_arg1 into the prepared message in stage1
- }
- builder::deliverMsg2(msg2_arg1)
- {
- This function, inserts re-calculated msg2_arg1 into the prepared message in stage1
- }
- // These two functions are still retained for the usage of class A
- builder::prepareAndDeliverMsg1(msg1_arg1,msg1_arg2)
- {
- }
- builder::prepareAndDeliverMsg2(msg2_arg1,msg2_arg2)
- {
- }
- //---
- class base {
- virtual bool prepareMsg1() = 0;
- virtual bool prepareMsg2() = 0;
- virtual bool deliverMsg1() = 0;
- virtual bool deliverMsg2() = 0;
- bool prepareAndDeliverMsg1(){
- prepareMsg1();
- deliverMsg1();
- }
- bool prepareAndDeliverMsg2(msg2_arg1,msg2_arg2){
- prepareMsg2();
- deliverMsg2();
- }
- };
- class base {
- virtual bool prepareMsg1(args) {//not pure virtual
- //do the common stuff
- }
- };
- class derived {
- bool prepareMsg1( args ) {
- base::prepareMsg1(args);
- //code to specailise the message
- }
- };
- class TBaseMsg
- {
- public:
- virtual void prepare() = 0;
- virtual void deliver() = 0;
- }
Add Comment
Please, Sign In to add comment