57 _os <<
"--------------------------------------------------" << endl;
58 _os <<
" Select message to create" << endl;
59 _os <<
"--------------------------------------------------" << endl;
62 for (
unsigned nlines(0); pp != _ctx._bme.end(); ++pp)
64 _os <<
'[' << _opt_keys[nlines] <<
"] " << pp->_value._name <<
'(' << pp->_key <<
')' << endl;
67 if (nlines % _lpp == 0 || (nlines + _lpp * page) == _ctx._bme.size())
69 _os <<
"Page " << (page + 1) <<
'/' << (1 + (_ctx._bme.size() / _lpp)) <<
' ';
70 if ((opt = get_key(_fld_prompt,
true)))
84 if ((idx = _opt_keys.find_first_of(opt)) != f8String::npos)
87 if (idx < _ctx._bme.size())
105 ostr << msg->
get_msgtype() <<
" (" << grpid <<
')';
107 ostr << _ctx._bme.find_ptr(msg->
get_msgtype().c_str())->_name;
114 _os <<
"--------------------------------------------------" << endl;
115 _os <<
' ' << ostr.str() <<
": Select field to add (*:mandatory +:present)" << endl;
116 _os <<
"--------------------------------------------------" << endl;
121 const BaseEntry *tbe(_ctx.find_be(itr->_fnum));
122 _os <<
'[' << _opt_keys[nlines] <<
"] ";
123 if (msg->
have(itr->_fnum))
131 << tbe->_name <<
'(' << itr->_fnum <<
')' << endl;
138 if ((opt = get_key(_fld_prompt,
true)))
152 if ((idx = _opt_keys.find_first_of(opt)) != f8String::npos)
154 idx += (page * _lpp);
157 return _ctx._be.find_pair_ptr(fitr->_fnum);
176 _os <<
"--------------------------------------------------" << endl;
177 _os <<
' ' << be->_name <<
": Select realm value to add" << endl;
178 _os <<
"--------------------------------------------------" << endl;
181 for (
int nlines(0); pp < rb->
_sz; ++pp)
183 _os <<
'[' << _opt_keys[nlines] <<
"] " << *(rb->
_descriptions + pp) <<
" (";
188 if (nlines % _lpp == 0 || (nlines + _lpp * page) == rb->
_sz)
190 _os <<
"Page " << (page + 1) <<
'/' << (1 + (rb->
_sz / _lpp)) <<
' ';
191 if ((opt = get_key(_fld_prompt,
true)))
205 if (static_cast<size_t>((idx = (static_cast<int>(_opt_keys.find_first_of(opt))))) != f8String::npos)
207 idx += (page * _lpp);
225 MsgList::const_iterator itr(lst.begin());
228 _os <<
"--------------------------------------------------" << endl;
229 _os <<
"Select from " << lst.size() <<
" messages" << endl;
230 _os <<
"--------------------------------------------------" << endl;
233 for (
unsigned nlines(0); itr != lst.end(); ++itr)
235 const MsgTable::Pair *tbme(_ctx._bme.find_pair_ptr((*itr)->get_msgtype().c_str()));
240 if ((*itr)->Header())
242 (*itr)->Header()->get(sndtime);
243 (*itr)->Header()->get(msgseqnum);
245 _os <<
'[' << _opt_keys[nlines] <<
"] " << tbme->
_value._name <<
'(' << tbme->
_key <<
")\t"
246 << sndtime() <<
' ' << msgseqnum() <<
' ' << txt() << endl;
249 if (nlines % _lpp == 0 || (nlines + _lpp * page) == lst.size())
251 _os <<
"Page " << (page + 1) <<
' ';
252 if ((opt = get_key(_fld_prompt,
true)))
266 if ((idx = _opt_keys.find_first_of(opt)) != f8String::npos)
268 idx += (page * _lpp);
269 if (idx < lst.size())
286 unique_ptr<Message> msg(mc->
_create.
_do(
true));
287 Message *fmsg(SelectFromMsg(from));
289 fmsg->copy_legal(msg.get());
291 while((fld = SelectField(msg.get())))
292 EditMsg(tty, fld, msg.get());
293 _os << endl << endl << *static_cast<MessageBase *>(msg.get()) << endl;
294 if (get_yn(
"Add to list? (y/n):",
true))
295 lst.push_back(msg.release());
298 return static_cast<int>(lst.size());
309 unique_ptr<Message> msg(mc->
_create.
_do(
true));
311 while((fld = SelectField(msg.get())))
312 EditMsg(tty, fld, msg.get());
313 _os << endl << endl << *static_cast<MessageBase *>(msg.get()) << endl;
314 if (get_yn(
"Add to list? (y/n):",
true))
315 lst.push_back(msg.release());
318 return static_cast<int>(lst.size());
326 _is.getline(buff,
sizeof(buff));
337 rval = SelectRealm(fld->
_key, fld->
_value._rlm);
340 _os << endl << fld->
_value._name <<
": " << flush;
348 for (
int ii(0); ii < cnt; ++ii)
350 Message *gmsg(static_cast<Message *>(gb->create_group(
true)));
352 while((fld = SelectField(gmsg, ii + 1)))
353 EditMsg(tty, fld, gmsg);
354 _os << endl << endl << *static_cast<MessageBase *>(gmsg) << endl;
355 if (get_yn(
"Add group to msg? (y/n):",
true))
371 Message *msg(SelectFromMsg(lst));
375 while((fld = SelectField(msg)))
376 EditMsg(tty, fld, msg);
377 _os << endl << endl << *static_cast<MessageBase *>(msg) << endl;
380 return static_cast<int>(lst.size());
386 Message *msg(SelectFromMsg(lst));
389 for (MsgList::iterator itr(lst.begin()); itr != lst.end(); ++itr)
394 if (get_yn(
"Remove msg from list? (y/n, n=return a copy):",
true))
410 if (lst.size() && get_yn(
"Delete all msgs? (y/n):",
true))
412 for_each(lst.begin(), lst.end(), [](
const Message *pp){
delete pp; pp =
nullptr; });
424 Message *msg(SelectFromMsg(lst));
427 for (MsgList::iterator itr(lst.begin()); itr != lst.end(); ++itr)
431 if (get_yn(
" Delete msg? (y/n):",
true))
441 return static_cast<int>(lst.size());
bool have(const unsigned short fnum) const
virtual F8API void print_field(const unsigned short fnum, std::ostream &os) const
Message instantiation table entry.
Pair abstraction for use with GeneratedTable.
GroupBase * find_group() const
bool is_mandatory(const unsigned short field) const
std::function< Message *(bool)> _do
const Presence & get_presence() const
std::deque< FIX8::Message * > MsgList
Domain range/set static metadata base class.
Abstract base class for all repeating groups.
Used for static trait interrogation.
const_iterator at(const size_t idx) const
const f8String & get_msgtype() const
F8API Message * clone() const
A complete Fix message with header, body and trailer.
bool is_group(const unsigned short field, Presence::const_iterator &itr) const
Field template. There will ONLY be partial template specialisations of this template.
std::ostream & print(std::ostream &os, int idx) const
const FieldTraits & get_fp() const
void add_field(const unsigned short fnum, Presence::const_iterator itr, const unsigned pos, BaseField *what, bool check)
The base field class (ABC) for all fields.
unsigned short get_tag() const
const char *const * _descriptions