view topology/manager/StartTopologyManager.cs @ 59:c4f8630b7822

topology manager fix
author KaitoMaeshiro <aosskaito@cr.ie.u-ryukyu.ac.jp>
date Thu, 27 Jan 2022 01:19:51 +0900
parents 0d2c956060d8
children 1a42115e51bb
line wrap: on
line source

using System;
using System.Threading;
using Christie_net.annotation;
using Christie_net.codegear;
using Christie_net.topology.node;
using Christie_net.topology.manager;

namespace Christie_net.topology.manager {
    
    public class StartTopologyManager : StartCodeGear {
        public StartTopologyManager(string[] args) : this(CreateCgm(new TopologyManagerConfig(args).localPort), new TopologyManagerConfig(args)){
        }
        public StartTopologyManager(TopologyManagerConfig topologyManagerConfig) : this(CreateCgm(topologyManagerConfig.localPort), topologyManagerConfig){
        }
        
        public StartTopologyManager(CodeGearManager cgm, TopologyManagerConfig topologyManagerConfig) : base(cgm) {
            cgm.Setup(new TopologyManager());
            cgm.GetLocalDGM().Put("topologyManagerConfig", topologyManagerConfig);
        }
        
        public StartTopologyManager(TopologyManagerConfig conf, CodeGear startCG) :this(CreateCgm(conf.localPort), conf, startCG){

        }

        public StartTopologyManager(CodeGearManager cgm, TopologyManagerConfig conf, CodeGear startCG) : base(cgm) {
            cgm.Setup(new TopologyManager());
            cgm.Setup(new Start());
            cgm.GetLocalDGM().Put("startCG", startCG);
            cgm.GetLocalDGM().Put("topologyNodeConfig", conf);

        }
        
        
        
        public static void Main(string[] args) {
            TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(args);
            new StartTopologyManager(topologyManagerConfig);
        }
    }
}