CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::InfoCommand Class Reference

#include <info.hh>

+ Inheritance diagram for CASM::InfoCommand:

Detailed Description

'casm info' implementation

Output of information about CASM objects – meant to be a quick way of implementing new functions in C++ for use via CLI or Python, etc.

There are no enforced limits on what the methods may do, but the current intention is that the input is simple JSON, with optional PrimClex pointer if provided by the API call.

The input should include a list of "properties" to query via DataFormatters, with default empty array indicating to print all properties in a DataFormatterDictionary. For example:

{
"prim": <prim.json format>, // optional, else current project prim
"something_else": ..., // for example Configuration JSON or other inputs
// optional, default=[] prints all DataFormatter properties///
"properties": ["name", "name", "name(args, ...)"]
}

The output is primarily intended to be JSON directly to the CASM::log(), but it is up to the each method to document itself.

Implement a new casm info method by following the example of PrimInfoInterface.

Definition at line 38 of file info.hh.

Public Types

typedef Completer::InfoOption OptionType
 

Public Member Functions

 InfoCommand (const CommandArgs &_args, Completer::InfoOption &_opt)
 
int vm_count_check () const override
 
int help () const override
 
int desc () const override
 
int run () const override
 
InfoInterfaceVector const & info_methods () const
 
void print_names (std::ostream &sout, InfoInterfaceVector const &info_methods) const
 
int count (std::string s) const
 
const po::variables_map & vm () const
 
const OptionTypeopt () const
 
const CommandArgsargs () const
 
fs::path root () const
 
bool in_project () const
 
PrimClexprimclex () const
 

Static Public Attributes

static const std::string name = "info"
 

Private Attributes

InfoInterfaceVector m_standard_info_methods
 
InfoInterfaceVector const * m_info_method_vector
 
OptionTypem_opt
 
const CommandArgsm_args
 
bool m_in_project
 
std::unique_ptr< PrimClexm_primclex
 

Member Typedef Documentation

◆ OptionType

Definition at line 52 of file APICommand.hh.

Constructor & Destructor Documentation

◆ InfoCommand()

CASM::InfoCommand::InfoCommand ( const CommandArgs _args,
Completer::InfoOption _opt 
)

Definition at line 56 of file info.cc.

Member Function Documentation

◆ args()

const CommandArgs & CASM::APICommandBase::args ( ) const
inherited

Definition at line 11 of file APICommand.cc.

◆ count()

int CASM::APICommand< Completer::InfoOption >::count ( std::string  s) const
inlineinherited

Definition at line 57 of file APICommand.hh.

◆ desc()

int CASM::InfoCommand::desc ( ) const
overridevirtual

Implements CASM::APICommandBase.

Definition at line 87 of file info.cc.

◆ help()

int CASM::InfoCommand::help ( ) const
overridevirtual

Implements CASM::APICommandBase.

Definition at line 77 of file info.cc.

◆ in_project()

bool CASM::APICommandBase::in_project ( ) const
inherited

Definition at line 15 of file APICommand.cc.

◆ info_methods()

InfoInterfaceVector const & CASM::InfoCommand::info_methods ( ) const

Definition at line 193 of file info.cc.

◆ opt()

const OptionType& CASM::APICommand< Completer::InfoOption >::opt ( ) const
inlineinherited

Definition at line 61 of file APICommand.hh.

◆ primclex()

PrimClex & CASM::APICommandBase::primclex ( ) const
inherited

Definition at line 17 of file APICommand.cc.

◆ print_names()

void CASM::InfoCommand::print_names ( std::ostream &  sout,
InfoInterfaceVector const &  info_methods 
) const

Definition at line 203 of file info.cc.

◆ root()

fs::path CASM::APICommandBase::root ( ) const
inherited

Definition at line 13 of file APICommand.cc.

◆ run()

int CASM::InfoCommand::run ( ) const
overridevirtual

Implements CASM::APICommandBase.

Definition at line 129 of file info.cc.

◆ vm()

const po::variables_map& CASM::APICommand< Completer::InfoOption >::vm ( ) const
inlineinherited

Definition at line 59 of file APICommand.hh.

◆ vm_count_check()

int CASM::InfoCommand::vm_count_check ( ) const
overridevirtual

Implements CASM::APICommandBase.

Definition at line 60 of file info.cc.

Member Data Documentation

◆ m_args

const CommandArgs& CASM::APICommandBase::m_args
privateinherited

Definition at line 41 of file APICommand.hh.

◆ m_in_project

bool CASM::APICommandBase::m_in_project
privateinherited

Definition at line 42 of file APICommand.hh.

◆ m_info_method_vector

InfoInterfaceVector const* CASM::InfoCommand::m_info_method_vector
mutableprivate

Definition at line 61 of file info.hh.

◆ m_opt

OptionType& CASM::APICommand< Completer::InfoOption >::m_opt
privateinherited

Definition at line 64 of file APICommand.hh.

◆ m_primclex

std::unique_ptr<PrimClex> CASM::APICommandBase::m_primclex
mutableprivateinherited

Definition at line 43 of file APICommand.hh.

◆ m_standard_info_methods

InfoInterfaceVector CASM::InfoCommand::m_standard_info_methods
mutableprivate

Definition at line 60 of file info.hh.

◆ name

const std::string CASM::InfoCommand::name = "info"
static

Definition at line 40 of file info.hh.


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