Coder Social home page Coder Social logo

black8mamba / muduo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexstocks/muduo

0.0 1.0 0.0 2.54 MB

a muduo branch without boost and cmake, just using c++11 and makefile to make

License: Other

Shell 0.15% C++ 76.52% Makefile 1.26% C 21.20% Objective-C 0.87%

muduo's Introduction

README

Intro


AlexStocks/muduo is a fork of chenshuo/muduo. Any issue or pr is welcome.

DOC


Muduo is based on boost which is a large monst lib. And muduo also use cmake to build & link. This branch just has two targets:

  • 1 use C++11 instead of boost;
  • 2 use makefile instead of cmake.

Regulations of using C++11 instead of boost


  • 1 boost::shared_ptr -> std::shared_ptr;
  • 2 boost::weak_ptr -> std::weak_ptr;
  • 3 boost::scoped_ptr -> std::unique_ptr; Pls attention that unique_ptr does not have unique_ptr::release method,its inner class object will live as long as the program.
  • 4 get_pointer(unique_ptr) -> unique_ptr.get();
  • 5 boost::ptr_vector -> std::vector<std::unique_ptr>;
  • 6 boost::ptr_vector(size) --> std::vector<std::unique_ptr>(size); The above symbol "-->" means "not equals to". boost::ptr_vector::ptr_vector(size). The "ptr_vector(size_type to_reserve)" just constructs an empty vector with a buffer of size least to_reserve. While std::vector<std::unique_ptr>(v_size) Constructs a container with a buffer of size "v_size" and fill each element of this container with object of type std::unique_ptr(code example:muduo/base/ests/BlockingQueue_bench.cc和muduo/base/ests/BlockingQueue_test.cc).
  • 7 boost::ptr_vector::pop_back -> std::vector<std::unique_ptr>::back + std::vector<std::unique_ptr>::pop_back; Pls attention that the return value of boost::ptr_vector::pop_back is its last element while the return value of std::vector::pop_back is void.
  • 8 new T + boost::ptr_vector::push_back -> std::vector<std::unique_ptr>::push_bck(new T); Pls attention that std::unique_ptr does not support copy construct and assignment operator. So I complete std::vector::push_back task just in one step to create a new class object and assign this new object to a std::unique_ptr object(code example:EventLoopThreadPool.ccmuduo/net/EventLoopThreadPool.cc line45-line50).
  • 9 boost::bind-> std::bind; Pls attention that the function that std::bind use should be C-style function of C++ class static funtion(code example:muduo/net/TcpConnection.cc line110 & line131).
  • 10 boost::any-> cdiggins::any(muduo/other/any.h)
  • 11 boost::noncopyable -> muduo::noncopyable(muduo/base/noncopyable.h)
  • 12 add offsetof macro in muduo/net/InetAddress.cc

Change Log


  • 1 create this project 2015-05-20.
  • 2 sync with github.com/chenshuo/muduo master on 2016-10-16 which lastest version is v1.0.8.
  • 3 sync with https://github.com/chenshuo/muduo/tree/cpp11 on 2017-09-14 which lastest version is v1.0.9.
  • 4 add contrib/hiredis on 2017-10-17.

muduo's People

Contributors

alexstocks avatar baiyanhuang avatar bi1bfr avatar byzhang avatar chenshuo avatar chinaminiren avatar decimalbell avatar demiaowu avatar donzell avatar enyruas avatar fxsjy avatar gamedevelope avatar gzc9047 avatar harrywong avatar huahang avatar liyuan989 avatar lotusnowshen avatar paizzj avatar renzhong avatar seasonlee avatar xanpeng avatar zhenthy avatar zieckey avatar

Watchers

 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.