Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 09:13:00

0001 /**
0002  * Copyright (c) 2017-present, Facebook, Inc.
0003  * All rights reserved.
0004  *
0005  * This source code is licensed under the BSD-style license found in the
0006  * LICENSE file in the root directory of this source tree.
0007  */
0008 
0009 #pragma once
0010 
0011 #include <stddef.h>
0012 
0013 namespace gloo {
0014 namespace transport {
0015 
0016 class Buffer {
0017  public:
0018   explicit Buffer(int slot, void* ptr, size_t size)
0019       : slot_(slot), ptr_(ptr), size_(size), debug_(false) {}
0020   virtual ~Buffer() = 0;
0021 
0022   virtual void setDebug(bool debug) {
0023     debug_ = debug;
0024   }
0025 
0026   virtual void send(size_t offset, size_t length, size_t roffset = 0) = 0;
0027 
0028   // Send entire buffer by default
0029   void send() {
0030     send(0, size_);
0031   }
0032 
0033   virtual void waitRecv() = 0;
0034   virtual void waitSend() = 0;
0035 
0036  protected:
0037   int slot_;
0038   void* ptr_;
0039   size_t size_;
0040   bool debug_;
0041 };
0042 
0043 } // namespace transport
0044 } // namespace gloo