philo.idl

来自「MICO2.3.13 corba 环境平台」· IDL 代码 · 共 70 行

IDL
70
字号
#include <mico/CCM.idl>module DiningPhilosophers {  exception InUse {};  interface Fork {    void get () raises (InUse);    void release ();  };  component ForkManager {    provides Fork the_fork;  };  home ForkHome manages ForkManager {};};module DiningPhilosophers {  enum PhilosopherState {    EATING, THINKING, HUNGRY, STARVING, DEAD  };  eventtype StatusInfo {    public string name;    public PhilosopherState state;    public unsigned long ticks_since_last_meal;    public boolean has_left_fork;    public boolean has_right_fork;  };};module DiningPhilosophers {  component Observer {    consumes StatusInfo info;  };  home ObserverHome manages Observer {};};module DiningPhilosophers {  component Philosopher {    attribute string name;    uses Fork left;    uses Fork right;    publishes StatusInfo info;  };  home PhilosopherHome manages Philosopher {    factory new (in string name);  };};local interface MyFork :	DiningPhilosophers::CCM_ForkManager,	DiningPhilosophers::CCM_Fork{};local interface MyPhilosopher :	DiningPhilosophers::CCM_Philosopher,	Components::SessionComponent{};local interface MyObserver :	DiningPhilosophers::CCM_Observer,	Components::SessionComponent{};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?