精华内容
下载资源
问答
  • Bridge

    2017-08-22 09:56:07
    A suspension bridge suspends the roadway from huge main cables, which extend from one end of the bridge to the other. These cables rest on top of high towers and are secured at each end by anchorages....
  • bridge

    2012-07-06 11:12:36
    http://tldp.org/HOWTO/BRIDGE-STP-HOWTO/index.html
    展开全文
  • Design Pattern - Bridge(C#)

    万次阅读 多人点赞 2019-02-03 10:51:07
    This real-world code demonstrates the Bridge pattern in which a Business Object abstraction is decoupled from the implementation in DataObject. The DataObject implementations can evolve dynamically ...

    分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net 

    Definition

    Decouple an abstraction from its implementation so that the two can vary independently.

    Participants

        The classes and/or objects participating in this pattern are:

    • Abstraction (BusinessObject)
      • Defines the abstraction's interface.
      • Maintains a reference to an object of type Implementor.
    • RefinedAbstraction (CustomersBusinessObject)
      • Extends the interface defined by Abstraction.
    • Implementor (DataObject)
      • Defines the interface for implementation classes. This interface doesn't have to correspond exactly to Abstraction's interface; in fact the two interfaces can be quite different. Typically the Implementation interface provides only primitive operations, and Abstraction defines higher-level operations based on these primitives.
    • ConcreteImplementor (CustomersDataObject)
      • Implements the Implementor interface and defines its concrete implementation.

    Sample Code in C#


    This structural code demonstrates the Bridge pattern which separates (decouples) the interface from its implementation. The implementation can evolve without changing clients which use the abstraction of the object.

    /*
     * Structural Bridge Design Pattern.
     */
    
    namespace Bridge.Sample
    {
        using System;
    
        /// <summary>
        /// Startup class for Structural Bridge Design Pattern.
        /// </summary>
        internal static class Program
        {
            #region Methods
    
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            private static void Main()
            {
                Abstraction ab = new RefinedAbstraction();
    
                // Set implementation and call.
                ab.Implementor = new ConcreteImplementorA();
                ab.Operation();
    
                // Change implementation and call.
                ab.Implementor = new ConcreteImplementorB();
                ab.Operation();
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'Abstraction' class.
        /// </summary>
        internal class Abstraction
        {
            #region Fields
    
            /// <summary>
            /// The implementor.
            /// </summary>
            protected Implementor implementor;
    
            #endregion
    
            #region Public Properties
    
            /// <summary>
            /// Sets the implementor.
            /// </summary>
            public Implementor Implementor
            {
                set { implementor = value; }
            }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// The operation.
            /// </summary>
            public virtual void Operation()
            {
                implementor.Operation();
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'Implementor' abstract class.
        /// </summary>
        internal abstract class Implementor
        {
            #region Public Methods and Operators
    
            /// <summary>
            /// The operation.
            /// </summary>
            public abstract void Operation();
    
            #endregion
        }
    
        /// <summary>
        /// The 'RefinedAbstraction' class.
        /// </summary>
        internal class RefinedAbstraction : Abstraction
        {
            #region Public Methods and Operators
    
            /// <summary>
            /// The operation.
            /// </summary>
            public override void Operation()
            {
                implementor.Operation();
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'ConcreteImplementorA' class.
        /// </summary>
        internal class ConcreteImplementorA : Implementor
        {
            #region Public Methods and Operators
    
            /// <summary>
            /// The operation.
            /// </summary>
            public override void Operation()
            {
                Console.WriteLine("ConcreteImplementorA Operation");
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'ConcreteImplementorB' class.
        /// </summary>
        internal class ConcreteImplementorB : Implementor
        {
            #region Public Methods and Operators
    
            /// <summary>
            /// The operation.
            /// </summary>
            public override void Operation()
            {
                Console.WriteLine("ConcreteImplementorB Operation");
            }
    
            #endregion
        }
    }
    
    // Output:
    /*
    ConcreteImplementorA Operation
    ConcreteImplementorB Operation
    
    */

    This real-world code demonstrates the Bridge pattern in which a Business Object abstraction is decoupled from the implementation in DataObject. The DataObject implementations can evolve dynamically without changing any clients.

    /*
     * Real-World Bridge Design Pattern.
     */
    
    namespace Bridge.RealWorld
    {
        using System;
        using System.Collections.Generic;
    
        /// <summary>
        /// Startup class for Real-World Bridge Design Pattern.
        /// </summary>
        internal static class Program
        {
            #region Methods
    
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            private static void Main()
            {
                // Create RefinedAbstraction.
                var customers = new Customers("Chicago") {Data = new CustomersData()};
    
                // Set ConcreteImplementor.
                // Exercise the bridge.
                customers.Show();
                customers.Next();
                customers.Show();
                customers.Next();
                customers.Show();
                customers.Add("Henry Velasquez");
                customers.ShowAll();
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'Abstraction' class.
        /// </summary>
        internal class CustomersBase
        {
            #region Fields
    
            /// <summary>
            /// The group.
            /// </summary>
            protected readonly string Group;
    
            /// <summary>
            /// The data object.
            /// </summary>
            private DataObject _dataObject;
    
            #endregion
    
            #region Constructors and Destructors
    
            /// <summary>
            /// Initializes a new instance of the <see cref="CustomersBase"/> class.
            /// </summary>
            /// <param name="group">
            /// The group.
            /// </param>
            public CustomersBase(string group)
            {
                Group = group;
            }
    
            #endregion
    
            #region Public Properties
    
            /// <summary>
            /// Gets or sets the data.
            /// </summary>
            public DataObject Data
            {
                get { return _dataObject; }
    
                set { _dataObject = value; }
            }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// Add.
            /// </summary>
            /// <param name="customer">
            /// The customer.
            /// </param>
            public virtual void Add(string customer)
            {
                _dataObject.AddRecord(customer);
            }
    
            /// <summary>
            /// Delete.
            /// </summary>
            /// <param name="customer">
            /// The customer.
            /// </param>
            public virtual void Delete(string customer)
            {
                _dataObject.DeleteRecord(customer);
            }
    
            /// <summary>
            /// Next.
            /// </summary>
            public virtual void Next()
            {
                _dataObject.NextRecord();
            }
    
            /// <summary>
            /// Prior.
            /// </summary>
            public virtual void Prior()
            {
                _dataObject.PriorRecord();
            }
    
            /// <summary>
            /// Show.
            /// </summary>
            public virtual void Show()
            {
                _dataObject.ShowRecord();
            }
    
            /// <summary>
            /// Show all.
            /// </summary>
            public virtual void ShowAll()
            {
                Console.WriteLine("Customer Group: " + Group);
    
                _dataObject.ShowAllRecords();
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'RefinedAbstraction' class.
        /// </summary>
        internal class Customers : CustomersBase
        {
            // Constructor
    
            #region Constructors and Destructors
    
            /// <summary>
            /// Initializes a new instance of the <see cref="Customers"/> class.
            /// </summary>
            /// <param name="group">
            /// The group.
            /// </param>
            public Customers(string group)
                : base(group)
            {
            }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// Show all.
            /// </summary>
            public override void ShowAll()
            {
                // Add separator lines.
                Console.WriteLine();
                Console.WriteLine("------");
                base.ShowAll();
                Console.WriteLine("------");
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'Implementor' abstract class.
        /// </summary>
        internal abstract class DataObject
        {
            #region Public Methods and Operators
    
            /// <summary>
            /// Add record.
            /// </summary>
            /// <param name="name">
            /// The name.
            /// </param>
            public abstract void AddRecord(string name);
    
            /// <summary>
            /// Delete record.
            /// </summary>
            /// <param name="name">
            /// The name.
            /// </param>
            public abstract void DeleteRecord(string name);
    
            /// <summary>
            /// Next record.
            /// </summary>
            public abstract void NextRecord();
    
            /// <summary>
            /// Prior record.
            /// </summary>
            public abstract void PriorRecord();
    
            /// <summary>
            /// Show all records.
            /// </summary>
            public abstract void ShowAllRecords();
    
            /// <summary>
            /// Show record.
            /// </summary>
            public abstract void ShowRecord();
    
            #endregion
        }
    
        /// <summary>
        /// The 'ConcreteImplementor' class.
        /// </summary>
        internal class CustomersData : DataObject
        {
            #region Fields
    
            /// <summary>
            /// The current.
            /// </summary>
            private int _current;
    
            /// <summary>
            /// The customers.
            /// </summary>
            private readonly List<string> _customers = new List<string>();
    
            #endregion
    
            #region Constructors and Destructors
    
            /// <summary>
            /// Initializes a new instance of the <see cref="CustomersData"/> class.
            /// </summary>
            public CustomersData()
            {
                // Loaded from a database 
                _customers.Add("Jim Jones");
                _customers.Add("Samual Jackson");
                _customers.Add("Allen Good");
                _customers.Add("Ann Stills");
                _customers.Add("Lisa Giolani");
            }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// Add record.
            /// </summary>
            /// <param name="customer">
            /// The customer.
            /// </param>
            public override void AddRecord(string customer)
            {
                _customers.Add(customer);
            }
    
            /// <summary>
            /// Delete record.
            /// </summary>
            /// <param name="customer">
            /// The customer.
            /// </param>
            public override void DeleteRecord(string customer)
            {
                _customers.Remove(customer);
            }
    
            /// <summary>
            /// Next record.
            /// </summary>
            public override void NextRecord()
            {
                if (_current <= _customers.Count - 1)
                {
                    _current++;
                }
            }
    
            /// <summary>
            /// Prior record.
            /// </summary>
            public override void PriorRecord()
            {
                if (_current > 0)
                {
                    _current--;
                }
            }
    
            /// <summary>
            /// Show all records.
            /// </summary>
            public override void ShowAllRecords()
            {
                foreach (string customer in _customers)
                {
                    Console.WriteLine(" " + customer);
                }
            }
    
            /// <summary>
            /// Show record.
            /// </summary>
            public override void ShowRecord()
            {
                Console.WriteLine(_customers[_current]);
            }
    
            #endregion
        }
    }
    
    // Output:
    /*
    Jim Jones
    Samual Jackson
    Allen Good
    
    ------
    Customer Group: Chicago
     Jim Jones
     Samual Jackson
     Allen Good
     Ann Stills
     Lisa Giolani
     Henry Velasquez
    ------
    
    */

     

    展开全文
  • ProtonMail Bridge和导入导出应用程序 版权所有(c)2020 Proton Technologies AG 该存储库包含ProtonMail Bridge和ProtonMail Import-Export应用程序。有关详细的构建信息,请参见 。许可证可以在文件中找到,有关...
  • 学习Linux Bridge与利用Bridge创建虚拟网络

    千次阅读 多人点赞 2021-03-22 23:43:25
    学习Linux Bridge并用Bridge创建虚拟网络** 一、Linux Bridge简介 Linux Bridge 模拟了物理网络中网桥的概念,既将若干个服务器的端口加入到网桥中,网桥端口对端相连的设备发送报文给Linux Bridge,并通过Linux ...

    学习Linux Bridge并用Bridge创建虚拟网络**

    一、Linux Bridge简介

    Linux Bridge 模拟了物理网络中网桥的概念,既将若干个服务器的端口加入到网桥中,网桥端口对端相连的设备发送报文给Linux Bridge,并通过Linux Bridge学习报文SMAC(MAC全称是Medium/Media Access Control,用来表示互联网上每一个站点的标识符,SMAC则表示发起网络连接的源端MAC地址),以及查找报文的DMAC(表示接受网络链接的目的端MAC地址)并转发到相应的目的地。这点和普通的二层交换机非常类似,Linux Bridge的端口可以是物理网卡端口,也可以是虚拟的端口。*

    二、利用Bridge创建虚拟网络

    我所用的环境为CentOS7,若用其他的版本可能在一下步骤中网卡配置有差异,没太大的影响

    • 大概步骤:
      1.安装网桥模块;
      2.查询网桥模块;
      3.加载网桥模块;
      4.创建逻辑网段,名称为br0;
      5.安装tunctl,并新增网卡eth0;
      6.编辑网桥br0修改配置文件;
      7.加载br0与eth0并重启网络;
      8.检查添加的状态;

    • 具体如下操作:
      1.安装网桥模块:

    # yum install  -y  bridge-utils
    

    在这里插入图片描述
    2.查询网桥模块:

    # modinfo  bridge
    

    在这里插入图片描述3.加载网桥模块:检查网桥挂载情况并检查网桥

    # modprobe bridge
    # lsmod  |grep bridge
    bridge               83177   0
    stp                   2218   1 bridge
    llc                   5546   2 bridge,stp
    # brctl show
    bridge name    bridge id     STP enabled  interfaces
    

    在这里插入图片描述4.创建逻辑网段,名称为br0:

    # brctl  addbr br0
    # brctl  show
    

    在这里插入图片描述
    5.安装tunctl,并新增网卡eth0,不设置临时IP

    • 检查TUN模块:
    # modinfo  tun
    

    在这里插入图片描述

    • 加载TUN模块
    # modprobe  tun
    # lsmod  | grep tun
    

    在这里插入图片描述

    • 配置YUM源:
    # vim /etc/yum.repos.d/nux-misc.repo
    [nux-misc]
    name=Nux Misc
    baseurl=http://li.nux.ro/download/nux/misc/el7/x86_64/
    enabled=0
    gpgcheck=0
    gpgkey=http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
    

    在这里插入图片描述

    • 安装tunctl
    # yum  --enablerepo=nux-misc  install  tunctl
    

    在这里插入图片描述

    • 创建虚拟网卡eth0
    # tunctl  -b -u root -t eth0
    eth0
    

    在这里插入图片描述
    6.创建网桥br0,并编辑配置文件:

    #vim /etc/sysconfig/network-scripts/ifcfg-br0
    
    

    在这里插入图片描述
    7.加载br0与eth0并重启网络

    # brctl addif br0 eth0
    # systemctl restart network
    

    8.检查添加情况

    # brctl show
    # route -n
    

    在这里插入图片描述
    做到此步如上图出现红色部分即表示Linux Bridge配置完成!!!!
    图片内容自己在虚拟机上完成的截图,一些详细配置信息根据自己为主,有问题私。

    展开全文
  • bridge-utils

    2018-09-18 11:17:02
    bridge-utils - Utilities for configuring the Linux Ethernet bridge
  • <div><p>Removing condition in bridge port bridge id attribute as it is required for all types of bridge ports</p><p>该提问来源于开源项目:opencomputeproject/SAI</p></div>
  • <div><h3>bridge.json <p>Default value of <strong>output</strong> option is changed: - Old - <code>"bridge/output"; - Revised - <code>"$(OutDir)/bridge/"</code> (for example, project&#...
  • network bridge

    2019-03-29 12:57:08
    docker network create -d bridge my-bridge 创建一个名为my-bridgebridge docker network ls 查看所有的network 查看local的网络信息: [root@docker ~]# docker network ls NETWORK ID NAME DRIVER ...

    docker network create -d bridge my-bridge 创建一个名为my-bridge的bridge

    docker network ls 查看所有的network

    查看local的网络信息:

    [root@docker ~]# docker network ls
    NETWORK ID          NAME                DRIVER              SCOPE
    5133ec415c3c        bridge              bridge              local
    f359ca4e2d39        host                host                local
    8d68673c045c        none                null                local

    现在创建一个网络名为my_net且driver为bridge的网络:(默认创建的就是bridge)

    [root@docker ~]# docker network create my_net
    67e29f0e4a77c79144efc337a081a889188b5b8e289968f22be6e4ddd9b80610
    [root@docker ~]# docker network ls
    NETWORK ID          NAME                DRIVER              SCOPE
    5133ec415c3c        bridge              bridge              local
    f359ca4e2d39        host                host                local
    67e29f0e4a77        my_net              bridge              local
    8d68673c045c        none                null                local
    

    brctl show 查看本地bridge

    利用--network启动容器提供服务:

    [root@docker ~]# docker run -d --name=php --network my_net --network-alias php -v /www:/usr/local/nginx/html php
    6b493cbe8207dee4cb4d5945cfce305dba96914083bd7f46841b0b42376bcb99
    [root@docker ~]# docker run -d --name=nginx --network my_net --network-alias nginx -v /www:/usr/local/nginx/html -p 80:80 nginx
    5ab220196b52bb768bef508433f0b920eecee70c3ee47880ebc5e2a74b5ee254
    展开全文
  • Adobe® Bridge CS6 数字资产管理软件是功能强大的照片和设计管理工具,能够集中访问您的所有创意资产。借助 Adobe InDesign®、Photoshop® 和 Photoshop Extended 软件中的可自定义面板 Adobe Mini Bridge,在您的...
  • Linux bridge

    千次阅读 2016-08-30 22:49:22
    Linux bridge
  • Bridge Pattern

    2019-07-10 22:20:57
    文章目录Bridge Pattern使用范围 Bridge Pattern 一张图来展示 使用范围 将接口定义和实现分离 接口定义和实现分辨独立扩展 用户端对实现端的代码修改无感知 对用户端屏蔽实现部分 多个对象之间共享实现部分 ...
  • ros-melodic-rosbridge-server:ros-melodic-rosbridge-serverAUR软件包
  • JavaBridge下载

    2015-04-13 17:08:22
    JavaBridge + java.inc
  • JavaBridge

    2018-04-12 17:07:00
    一般的做法是采用php-java-bridge做桥接 1.实现原理:  先打开java的一个监听端口,php调用java的时候,将对应的方法调用转发到java的指定端口,由java执行后再将结果返回给php  Java Bridge Web应用程序包含库...
  • 由于ARC不能管理Core Foundation Object的生命周期,所以在Core Foundation和ARC之间,我们需要使用到__bridge,__bridge_retained和__bridge_transfer三个转换关键字。 1.__bridge CF和OC对象转化时只涉及对象类型不...
  • Rosbridge学习

    2019-12-25 17:50:32
    rosbridge rosbridge(rosbridge_suite):一个用于非ROS系统和ROS系统进行交互的通信的功能包。 rosbridge主要包含两个部分Rosbridge Protocol和Rosbridge Implementation。 Rosbridge Protocol 协议部分主要提供了非...
  • Bridge模式代码

    2011-02-12 20:33:36
    Bridge模式代码Bridge模式代码Bridge模式代码Bridge模式代码
  • Bridge桥接模式

    2020-02-28 16:19:01
    文章目录Bridge patternStructureExampleSummary Bridge pattern The bridge pattern is a design pattern used in software engineering that is meant to “decouple an abstraction from its implementation so ...
  • 上一篇讲到 新建容器之后,是默认连到bridge网络上的,那么我们自己可以自定义bridge吗,答案是可以的。 首先先讲–link这个命令,–link可以给容器添加一个dns记录,然后就可以用名字访问,而不需每次都使用ip进行...
  • Linux Bridge

    千次阅读 2016-03-11 19:11:40
    linux bridge遇到过的坑,MTU和multicast
  • Adobe Bridge 2021 for Mac,简称BR,这是一款数字资产管理软件,Bridge 2021破解版集预览、整理、编辑和发布等多个文件管理功能于一体,能够轻松帮助用户管理文件,这次的br2021破解版带来了很多改进和增强,比如...
  • Quixel bridge桥接设置

    千次阅读 热门讨论 2020-07-09 10:07:43
    Quixel bridge桥接到UE4设置 在网上下载的资源包,可以拷贝到Quixel bridge的Megascans Library里,如路径:C:\Users\user\Documents\Megascans Library\Downloaded
  • net bridge bridge-nf-call-iptables=1

    千次阅读 2019-04-14 09:34:00
    net bridge bridge-nf-call-iptables=1
  • Bridge模式

    千次阅读 2015-07-11 21:39:13
    Bridge模式的核心在于将抽象部分和实现分离,它们两者可以独立的变化。Bridge模式就是解决这个问题的,它将抽象和实现分离,使两者可以独立的变化。
  • Running Rosbridge

    2018-10-26 22:08:09
    Running Rosbridge Description: This tutorial shows you how to launch a rosbridge server and talk to it.Keywords: rosbridge, roslibjs, teleoperation, Robot Web Tools   目录 Installing Rosbridge ...
  • 网桥bridge

    2017-11-24 00:07:00
    1. 网桥基础 什么是网桥 网桥将多个网络在数据链路层...Linux下的bridge,工作于数据链路层,对下层而言是一个桥设备,进行数据的转发;对上层而言,它就像普通的ethernet设备一样,有自己的IP和MAC地址,上层可以...
  • Linux 创建Bridge

    2018-01-16 23:20:00
    安装Bridge工具软件包 Linux可以工作在网桥模式,必须安装网桥工具bridge-utils,运行命令:  yum install bridge-utils 或 apt-get install bridge-utils Linux KVM Bridge逻辑结构图 通过命令行创建...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 47,601
精华内容 19,040
关键字:

bridge