Use fewer pointers refactor: eliminate some pointers in DrivenEngine

This commit is contained in:
2026-02-21 18:47:54 -05:00
parent 0531f50056
commit 48b7bf37da
3 changed files with 11 additions and 36 deletions

View File

@@ -65,8 +65,8 @@ class Channel : public eng::opnew {
public:
// Get the buffers associated with this channel.
//
StreamBuffer *out() { return sb_out_.get(); }
StreamBuffer *in() { return sb_in_.get(); }
StreamBuffer *out() { return &sb_out_; }
StreamBuffer *in() { return &sb_in_; }
// The channel ID. These are reused.
//
@@ -96,7 +96,7 @@ public:
// Channels are referenced by shared_ptr. You can
// release your shared_ptr at any time.
//
Channel(DrivenEngine *de, int chid, int port, const eng::string &target, bool stop);
Channel(int chid, int port, const eng::string &target, bool stop);
~Channel() {};
private:
@@ -110,8 +110,8 @@ private:
int chid_;
// These are the in/out buffers presented to the user.
std::shared_ptr<StreamBuffer> sb_in_;
std::shared_ptr<StreamBuffer> sb_out_;
StreamBuffer sb_in_;
StreamBuffer sb_out_;
int port_;
bool closed_;