GithubHelp home page GithubHelp logo

yx-null / cplusplus-eventspring Goto Github PK

View Code? Open in Web Editor NEW

This project forked from langya0/eventspring

0.0 0.0 0.0 5 KB

设计模式实现事件触发器(工厂方法&模板方法&观察者&中介者)

C++ 97.44% C 2.56%

cplusplus-eventspring's Introduction

.
├── eventCustomer.h		//事件执行/消费者中心
├── eventDispatch.h		//事件分发中心/调度器
├── main.cpp			//主测试
├── observer.h			//观察者接口->提供dispatch接口,供productevent使用
├── productEvent.h		//事件封装,消息合成事件
├── product.h			//消息产生,使用单一调用工厂实现
├── README
└── trace.h				//trace跟踪调试程序

0 directories, 8 files

运行实例:
注册一个读事件执行者
注册一个写事件执行者

=============模拟产生事件===============
随机产生一个事件:事件类型 3
事件发生。触发器工作....
未注册执行者

=============模拟产生事件===============
随机产生一个事件:事件类型 2
事件发生。触发器工作....
read执行者:执行[ 写事件] 事件类型2

=============模拟产生事件===============
随机产生一个事件:事件类型 1
事件发生。触发器工作....
read执行者:执行[ 写事件] 事件类型1

=============模拟产生事件===============
随机产生一个事件:事件类型 3
事件发生。触发器工作....
未注册执行者

=============模拟产生事件===============
随机产生一个事件:事件类型 1
事件发生。触发器工作....
read执行者:执行[ 写事件] 事件类型1

=============模拟产生事件===============
随机产生一个事件:事件类型 3
事件发生。触发器工作....
未注册执行者

=============模拟产生事件===============
随机产生一个事件:事件类型 2
事件发生。触发器工作....
read执行者:执行[ 写事件] 事件类型2

=============模拟产生事件===============
随机产生一个事件:事件类型 0
事件发生。触发器工作....
未注册执行者

=============模拟产生事件===============
随机产生一个事件:事件类型 1
事件发生。触发器工作....
read执行者:执行[ 写事件] 事件类型1

=============模拟产生事件===============
随机产生一个事件:事件类型 1
事件发生。触发器工作....
read执行者:执行[ 写事件] 事件类型1

cplusplus-eventspring's People

Contributors

langya0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.