The Gaudi Framework  master (37c0b60a)
Analyzer.cpp File Reference
#include "Analyzer.h"
#include "Catalog.h"
#include "IncludedFiles.h"
#include "Messages.h"
#include "Node.h"
#include "Parser.h"
#include "PragmaOptions.h"
#include "PropertyName.h"
#include "PropertyValue.h"
#include "Units.h"
#include <GaudiKernel/Environment.h>
#include <fmt/format.h>
#include <iostream>
#include <memory>
Include dependency graph for Analyzer.cpp:

Go to the source code of this file.

Functions

bool Unreference (gp::Catalog &catalog, gp::Messages *messages)
 

Function Documentation

◆ Unreference()

bool Unreference ( gp::Catalog catalog,
gp::Messages messages 
)

Definition at line 366 of file Analyzer.cpp.

366  {
367  bool unreference_result = true;
368  for ( auto& client : catalog ) {
369  for ( auto& current : client.second ) {
370  if ( current.IsReference() ) {
371  gp::PropertyValue& value = current.property_value();
372  const std::vector<std::string>& names = value.Vector();
373  gp::Property* property = catalog.Find( names[0], names[1] );
374  if ( !property ) {
375  messages->AddError( value.position(), "Could not unreference " + current.ValueAsString() );
376  unreference_result = false;
377  } else {
378  value = property->property_value();
379  }
380  }
381  }
382  }
383  return unreference_result;
384 }
Gaudi::Parsers::Property
Definition: Property.h:27
std::vector< std::string >
Gaudi::Parsers::PropertyValue
Definition: PropertyValue.h:29
Gaudi::Parsers::Messages::AddError
void AddError(std::string_view error)
Definition: Messages.h:39
Gaudi::Parsers::PropertyValue::position
const Position & position() const
Definition: PropertyValue.h:42
Gaudi::Parsers::PropertyValue::Vector
VectorOfStrings & Vector()
Definition: PropertyValue.h:47