当前位置: 首页>>代码示例>>C#>>正文


C# ICpu类代码示例

本文整理汇总了C#中ICpu的典型用法代码示例。如果您正苦于以下问题:C# ICpu类的具体用法?C# ICpu怎么用?C# ICpu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ICpu类属于命名空间,在下文中一共展示了ICpu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MotherBoard

 public MotherBoard(IRamMemory ram, ICpu cpu, IHardDrive hardDrive, IVideoCard videoCard)
 {
     this.ram = ram;
     this.cpu = cpu;
     this.hardDrive = hardDrive;
     this.videoCard = videoCard;
 }
开发者ID:VDGone,项目名称:TelerikAcademy-2,代码行数:7,代码来源:MotherBoard.cs

示例2: Computer

 public Computer(ICpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, VideoCardBase videoCard)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = videoCard;
 }
开发者ID:jesusico83,项目名称:Telerik,代码行数:7,代码来源:Computer.cs

示例3: Server

 public Server(ICpu cpu, IRamMemory ram, IEnumerable<IHardDrive> hardDrives)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = this.defaultVideoCard;
 }
开发者ID:TishoAngelov,项目名称:TelerikAcademy,代码行数:7,代码来源:Server.cs

示例4: Computer

 public Computer(ICpu cpu, IRamMemory ram, IVideoCard videoCard, IEnumerable<IHardDrive> hardDrives)
 {
     this.cpu = cpu;
     this.ram = ram;
     this.videoCard = videoCard;
     this.hardDrives = hardDrives;
 }
开发者ID:TishoAngelov,项目名称:TelerikAcademy,代码行数:7,代码来源:Computer.cs

示例5: GetPc

 public IPc GetPc(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     return new Pc(cpu, hardDrives, motherboard);
 }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:7,代码来源:ComputerFactory.cs

示例6: GetServer

 public IServer GetServer(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     return new Server(cpu, hardDrives, motherboard);
 }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:7,代码来源:ComputerFactory.cs

示例7: ReverseStackArgs

        /// <summary>
        /// Take the topmost arguments down to the ARG_MARKER_STRING, pop them off, and then
        /// put them back again in reversed order so a function can read them in normal order.
        /// Note that if this is an indirect call, it will also consume the thing just under
        /// the ARG_MARKER, since that's expected to be the delegate or KOSDelegate that we already
        /// read and pulled the needed information from.
        /// <param name="cpu">the cpu we are running on, fur stack manipulation purposes</param>
        /// <param name="direct">need to know if this was a direct or indirect call.  If indirect,
        /// then that means it also needs to consume the indirect reference off the stack just under
        /// the args</param>
        /// </summary>
        public static void ReverseStackArgs(ICpu cpu, bool direct)
        {
            List<object> args = new List<object>();
            object arg = cpu.PopValue();
            while (cpu.GetStackSize() > 0 && arg.GetType() != ArgMarkerType)
            {
                args.Add(arg);

                // It's important to dereference with PopValue, not using PopStack, because the function
                // being called might not even be able to see the variable in scope anyway.
                // In other words, if calling a function like so:
                //     declare foo to 3.
                //     myfunc(foo).
                // The code inside myfunc needs to see that as being identical to just saying:
                //     myfunc(3).
                // It has to be unaware of the fact that the name of the argument was 'foo'.  It just needs to
                // see the contents that were inside foo.
                arg = cpu.PopValue();
            }
            if (! direct)
                cpu.PopStack(); // throw away the delegate or KOSDelegate info - we already snarfed it by now.
            // Push the arg marker back on again.
            cpu.PushStack(new KOSArgMarkerType());
            // Push the arguments back on again, which will invert their order:
            foreach (object item in args)
                cpu.PushStack(item);
        }
开发者ID:CalebJ2,项目名称:KOS,代码行数:38,代码来源:CpuUtility.cs

示例8: Server

 public Server(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
     : base(cpu, hardDrives, motherboard)
 {
 }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:7,代码来源:Server.cs

示例9: Computer

 public Computer(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage)
 {
     Storage = storage;
     Gpu = gpu;
     Ram = ram;
     Cpu = cpu;
 }
开发者ID:didimitrov,项目名称:Algo,代码行数:7,代码来源:Computer.cs

示例10: Computer

 public Computer(ComputerType type, ICpu cpu, Ram ram, IEnumerable<HardDrive> hardDrives, IVideoCard videoCard)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = videoCard;
     this.Type = type;
 }
开发者ID:damy90,项目名称:Telerik-all,代码行数:8,代码来源:Computer.cs

示例11: GetLaptop

 public ILaptop GetLaptop(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard,
     ILaptopBattery battery)
 {
     return new Laptop(cpu, hardDrives, motherboard, battery);
 }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:8,代码来源:ComputerFactory.cs

示例12: Laptop

 public Laptop(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard,
     ILaptopBattery battery)
     : base(cpu, hardDrives, motherboard)
 {
     this.Battery = battery;
 }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:9,代码来源:Laptop.cs

示例13: Computer

 public Computer(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     this.Cpu = cpu;
     this.HardDrives = hardDrives;
     this.Motherboard = motherboard;
 }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:9,代码来源:Computer.cs

示例14: Console

 public Console(ICpu cpu, IMmu mmu, IGpu gpu, ITimer timer, IController controller)
 {
     Cpu = cpu;
     Mmu = mmu;
     Gpu = gpu;
     Timer = timer;
     Controller = controller;
     _emitFrames = true;
     _breakpoints = new HashSet<uint>();
 }
开发者ID:justinricheson,项目名称:GameBoyEm,代码行数:10,代码来源:Console.cs

示例15: UserDelegate

 /// <summary>
 /// Make a new UserDelegate given the current state of the CPU and its stack, and
 /// the entry point location of the function to call.
 /// </summary>
 /// <param name="cpu">the CPU on which this program is running.</param>
 /// <param name="context">The IProgramContext in which the entryPoint is stored.  Entry point 27 in the interpreter is not the same as entrypoint 27 in program context.</param>
 /// <param name="entryPoint">instruction address where OpcodeCall should jump to to call the function.</param>
 /// <param name="useClosure">If true, then a snapshot of the current scoping stack, and thus a persistent ref to its variables,
 ///   will be kept in the delegate so it can be called later as a callback with closure.  Set to false if the
 ///   function is only getting called instantly using whatever the scope is at the time of the call.</param>
 public UserDelegate(ICpu cpu, IProgramContext context, int entryPoint, bool useClosure)
 {
     this.cpu = cpu;
     ProgContext = context;
     EntryPoint = entryPoint;
     if (useClosure)
         CaptureClosure();
     else
         Closure = new List<VariableScope>(); // make sure it exists as an empty list so we don't have to have 'if null' checks everwywhere.
 }
开发者ID:Whitecaribou,项目名称:KOS,代码行数:20,代码来源:UserDelegate.cs


注:本文中的ICpu类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。