NDEVR
API Documentation
InputInfoPipe.h
1#pragma once
2#include <NDEVR/InfoPipe.h>
3#include <NDEVR/String.h>
4namespace NDEVR
5{
9 class InputInfoPipe : public LogPtr
10 {
11 public:
16 : LogPtr()
17 , m_idx(Constant<uint04>::Invalid)
18 {}
19
25 : LogPtr(pipe)
26 , m_idx(Constant<uint04>::Invalid)
27 {
28 m_idx = LogPtr::addInputGuard(name);
29 }
30
35 InputInfoPipe(const TranslatedString& name, const LogPtr& pipe)
36 : LogPtr(pipe)
37 , m_idx(Constant<uint04>::Invalid)
38 {
39 m_idx = LogPtr::addInputGuard(name);
40 }
41
47 : LogPtr(pipe)
48 , m_idx(Constant<uint04>::Invalid)
49 {
50 m_idx = LogPtr::addInputGuard(name);
51 }
52
53 InputInfoPipe(const InputInfoPipe& info) = delete;
58 {
59 LogPtr::removeInputGuard(m_idx);
60 }
61
65 void setPipe(InfoPipe* pipe)
66 {
67 finish();
68 m_log = pipe;
69 }
70
73 void finish()
74 {
75 LogPtr::removeInputGuard(m_idx);
76 m_idx = Constant<uint04>::Invalid;
77 }
78
83 {
84 LogPtr::removeInputGuard(m_idx);
85 m_idx = LogPtr::addInputGuard(name);
86 }
87
93 {
94 LogPtr::removeInputGuard(m_idx);
95 m_log = log;
96 m_idx = LogPtr::addInputGuard(name);
97 }
98
103 String getInput(bool clear)
104 {
105 String s;
106 LogPtr::getInputIdx(s, m_idx, clear);
107 return s;
108 }
109
113 {
114 LogPtr::clearInputIdx(m_idx);
115 }
116 protected:
118 };
119}
A light-weight base class for Log that allows processes to update, without the need for additional in...
InputInfoPipe(const TranslatedString &name, const LogPtr &pipe)
Constructs an InputInfoPipe from a LogPtr reference and registers an input guard.
InputInfoPipe(const TranslatedString &name, InfoPipe &pipe)
Constructs an InputInfoPipe from an InfoPipe reference and registers an input guard.
InputInfoPipe(const TranslatedString &name, InfoPipe *pipe)
Constructs an InputInfoPipe from a raw InfoPipe pointer and registers an input guard.
String getInput(bool clear)
Retrieves the current input string from the pipe.
InputInfoPipe(const InputInfoPipe &info)=delete
Copy constructor is deleted to prevent duplicate input guard ownership.
InputInfoPipe()
Constructs a default InputInfoPipe with no associated pipe and an invalid index.
void restart(const TranslatedString &name, InfoPipe *log)
Removes the current input guard, reassigns the pipe, and registers a new input guard.
~InputInfoPipe()
Destructor that removes the registered input guard from the pipe.
void clearInput()
Clears the input buffer for this input guard without reading it.
uint04 m_idx
The index of the registered input guard within the pipe.
void setPipe(InfoPipe *pipe)
Replaces the associated pipe, finishing the current input guard first.
void restart(const TranslatedString &name)
Removes the current input guard and registers a new one with the given name.
void finish()
Removes the current input guard and invalidates the index.
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ name
The display name of the object.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...