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.

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.