next up previous
Next: HDMC Module Parts (3) Up: l1joint_0330_hdmc Previous: HDMC Module Parts (1)

HDMC Module Parts (2)



Possible Implementation

    MyModule.h:             (write by hand)
    
    #include "MyModule_include.h"
    class MyModule : public Module {
      // ...module specific methods...
      #include "MyModule_parts.h"
    }
    
    MyModule_include.h:     (generated code)
    
    #include "MyModule.ControlReg.h"
    #include "MyModule.StatusReg.h"
    
    MyModule_parts.h:       (generated code)
    
    public:
    void initialise_parts() {
      // Use inherited (to be written!) function to find known 
      // Register Parts from PartManager. Exception if not found?
      m_ControlReg = find_part_by_name("MyModule.ControlReg");
      m_StatusReg = find_part_by_name("MyModule.StatusReg");
    }
    private:
    MyModule.ControlReg *m_ControlReg;
    MyModule.StatusReg *m_StatusReg;



Murrough Landon (m.p.j.landon@qmw.ac.uk)