aGrUM 3.2.0
a C++ library for (probabilistic) graphical models
gum::prm::o3prmr::O3prmrSession< GUM_SCALAR > Class Template Reference

This class contains a o3prmr session. More...

#include <O3prmrContext.h>

Public Member Functions

 O3prmrSession (std::string_view name="")
 O3prmrSession (const O3prmrSession &s)
virtual ~O3prmrSession ()
std::string name () const
std::vector< O3prmrCommand * > commands () const
void addObserve (int line, std::string_view leftValue, std::string_view rightValue)
void addUnobserve (int line, std::string_view value)
void addQuery (int line, std::string_view value)
void addSetEngine (int line, std::string_view value)
void addSetGndEngine (int line, std::string_view value)
void addCommand (const O3prmrCommand *command)
virtual std::string toString () const
O3prmrSession & operator+= (const O3prmrSession &c)

Private Member Functions

void addCommand (O3prmrCommand *command)

Private Attributes

std::string m_name
 The session name;.
std::vector< O3prmrCommand * > m_commands
 A sequence of commands.
std::map< const PRMSystem< GUM_SCALAR > *, PRMInference< GUM_SCALAR > * > m_infEngineMap

Detailed Description

template<GUM_Numeric GUM_SCALAR>
class gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >

This class contains a o3prmr session.

It have a name and a sequence of commands.

Definition at line 182 of file O3prmrContext.h.

Constructor & Destructor Documentation

◆ O3prmrSession() [1/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::O3prmrSession ( std::string_view name = "")
explicit

Definition at line 252 of file O3prmrContext_tpl.h.

252 {
253 m_name = name;
254 }
std::string m_name
The session name;.

References m_name, and name().

Referenced by O3prmrSession(), gum::prm::o3prmr::O3prmrInterpreter::checkSemantic(), and operator+=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ O3prmrSession() [2/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::O3prmrSession ( const O3prmrSession< GUM_SCALAR > & s)

Definition at line 257 of file O3prmrContext_tpl.h.

257 {
258 m_name = s.m_name;
259 *this += s;
260 }
This class contains a o3prmr session.

References O3prmrSession(), and m_name.

Here is the call graph for this function:

◆ ~O3prmrSession()

template<GUM_Numeric GUM_SCALAR>
gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::~O3prmrSession ( )
virtual

Definition at line 263 of file O3prmrContext_tpl.h.

263 {
264 for (Idx i = Size(m_commands.size()); i >= 1; i--)
265 delete m_commands[i - 1];
266
267 m_commands.clear();
268 }
std::vector< O3prmrCommand * > m_commands
A sequence of commands.

References m_commands.

Member Function Documentation

◆ addCommand() [1/2]

template<GUM_Numeric GUM_SCALAR>
void gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::addCommand ( const O3prmrCommand * command)

Definition at line 313 of file O3prmrContext_tpl.h.

313 {
314 switch (command->type()) {
317 break;
318
321 break;
322
324 m_commands.push_back(
326 break;
327
329 m_commands.push_back(
331 break;
332
334 m_commands.push_back(
336 break;
337 }
338 }
SetEngineCommand(int line, std::string_view value)
SetGndEngineCommand(int line, std::string_view value)

References gum::prm::o3prmr::SetEngineCommand::SetEngineCommand(), gum::prm::o3prmr::SetGndEngineCommand::SetGndEngineCommand(), m_commands, gum::prm::o3prmr::O3prmrCommand::Observe, gum::prm::o3prmr::O3prmrCommand::Query, gum::prm::o3prmr::O3prmrCommand::SetEngine, gum::prm::o3prmr::O3prmrCommand::SetGndEngine, gum::prm::o3prmr::O3prmrCommand::type(), and gum::prm::o3prmr::O3prmrCommand::Unobserve.

Referenced by addObserve(), addQuery(), addSetEngine(), addSetGndEngine(), addUnobserve(), gum::prm::o3prmr::O3prmrInterpreter::checkSemantic(), and operator+=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCommand() [2/2]

template<GUM_Numeric GUM_SCALAR>
void gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::addCommand ( O3prmrCommand * command)
private

Definition at line 281 of file O3prmrContext_tpl.h.

281 {
282 m_commands.push_back(command);
283 }

References m_commands.

◆ addObserve()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::addObserve ( int line,
std::string_view leftValue,
std::string_view rightValue )

Definition at line 286 of file O3prmrContext_tpl.h.

288 {
290 }
void addCommand(const O3prmrCommand *command)

References addCommand().

Here is the call graph for this function:

◆ addQuery()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::addQuery ( int line,
std::string_view value )

Definition at line 298 of file O3prmrContext_tpl.h.

References addCommand().

Here is the call graph for this function:

◆ addSetEngine()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::addSetEngine ( int line,
std::string_view value )

Definition at line 303 of file O3prmrContext_tpl.h.

303 {
305 }

References gum::prm::o3prmr::SetEngineCommand::SetEngineCommand(), and addCommand().

Here is the call graph for this function:

◆ addSetGndEngine()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::addSetGndEngine ( int line,
std::string_view value )

Definition at line 308 of file O3prmrContext_tpl.h.

308 {
310 }

References gum::prm::o3prmr::SetGndEngineCommand::SetGndEngineCommand(), and addCommand().

Here is the call graph for this function:

◆ addUnobserve()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::addUnobserve ( int line,
std::string_view value )

Definition at line 293 of file O3prmrContext_tpl.h.

References addCommand().

Here is the call graph for this function:

◆ commands()

template<GUM_Numeric GUM_SCALAR>
std::vector< O3prmrCommand * > gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::commands ( ) const

Definition at line 276 of file O3prmrContext_tpl.h.

276 {
277 return m_commands;
278 }

References m_commands.

◆ name()

template<GUM_Numeric GUM_SCALAR>
std::string gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::name ( ) const

Definition at line 271 of file O3prmrContext_tpl.h.

271 {
272 return m_name;
273 }

References m_name.

Referenced by O3prmrSession().

Here is the caller graph for this function:

◆ operator+=()

template<GUM_Numeric GUM_SCALAR>
O3prmrSession< GUM_SCALAR > & gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::operator+= ( const O3prmrSession< GUM_SCALAR > & c)

Definition at line 360 of file O3prmrContext_tpl.h.

360 {
362 i < c.m_commands.end();
363 i++)
364 addCommand(*i);
365
366 return *this;
367 }

References O3prmrSession(), addCommand(), and m_commands.

Here is the call graph for this function:

◆ toString()

template<GUM_Numeric GUM_SCALAR>
std::string gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::toString ( ) const
virtual

Definition at line 341 of file O3prmrContext_tpl.h.

341 {
343
344 output += "request " + m_name + " {\n";
345
347 i < m_commands.end();
348 i++) {
349 output += "\t";
350 output += (*i)->toString() + "\n";
351 }
352
353 output += "}\n";
354
355 return output;
356 }
virtual std::string toString() const

References m_commands, and m_name.

Member Data Documentation

◆ m_commands

template<GUM_Numeric GUM_SCALAR>
std::vector< O3prmrCommand* > gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::m_commands
private

A sequence of commands.

Definition at line 186 of file O3prmrContext.h.

Referenced by ~O3prmrSession(), addCommand(), addCommand(), commands(), operator+=(), and toString().

◆ m_infEngineMap

template<GUM_Numeric GUM_SCALAR>
std::map< const PRMSystem< GUM_SCALAR >*, PRMInference< GUM_SCALAR >* > gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::m_infEngineMap
private

Definition at line 187 of file O3prmrContext.h.

◆ m_name

template<GUM_Numeric GUM_SCALAR>
std::string gum::prm::o3prmr::O3prmrSession< GUM_SCALAR >::m_name
private

The session name;.

Definition at line 184 of file O3prmrContext.h.

Referenced by O3prmrSession(), O3prmrSession(), name(), and toString().


The documentation for this class was generated from the following files: