diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
commit | 72231250ed81e10d66bfe70701e64fa5fe50f712 (patch) | |
tree | 2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /configd/src/apps/sentinel/command-connection.h |
Publish
Diffstat (limited to 'configd/src/apps/sentinel/command-connection.h')
-rw-r--r-- | configd/src/apps/sentinel/command-connection.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/configd/src/apps/sentinel/command-connection.h b/configd/src/apps/sentinel/command-connection.h new file mode 100644 index 00000000000..355ee4e72b1 --- /dev/null +++ b/configd/src/apps/sentinel/command-connection.h @@ -0,0 +1,31 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#pragma once + +#include "line-splitter.h" + +namespace config { +namespace sentinel { + +class CommandConnection { +private: + int _fd; + LineSplitter _lines; + + // Unused constructors/assignment operator: + CommandConnection(); + CommandConnection(const CommandConnection&); + CommandConnection& operator =(const CommandConnection&); + +public: + explicit CommandConnection(int fd); + ~CommandConnection(); + bool isFinished() const; + char *getCommand(); + int printf(const char *fmt, ...) __attribute__((format(printf, 2, 3))); + void finish(); + int fd() const { return _fd; } +}; + +} // end namespace sentinel +} // end namespace config + |