Giter VIP home page Giter VIP logo

muduo's Introduction

README

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).
  • 5 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.
  • 6 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).
  • 7 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).
  • 8 boost::any-> cdiggins::any(muduo/other/any.h)
  • 9 boost::noncopyable -> muduo::noncopyable(muduo/other/noncopyable.h)
  • 10 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.

muduo's People

Contributors

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

Watchers

James Cloos avatar  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.