The Gaudi Framework  master (d98a2936)
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 <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 345 of file Analyzer.cpp.

345  {
346  bool unreference_result = true;
347  for ( auto& client : catalog ) {
348  for ( auto& current : client.second ) {
349  if ( current.IsReference() ) {
350  gp::PropertyValue& value = current.property_value();
351  const std::vector<std::string>& names = value.Vector();
352  gp::Property* property = catalog.Find( names[0], names[1] );
353  if ( !property ) {
354  messages->AddError( value.position(), "Could not unreference " + current.ValueAsString() );
355  unreference_result = false;
356  } else {
357  value = property->property_value();
358  }
359  }
360  }
361  }
362  return unreference_result;
363 }
Gaudi::Parsers::Property
Definition: Property.h:20
Gaudi::Parsers::PropertyValue
Definition: PropertyValue.h:22
Gaudi::Parsers::Messages::AddError
void AddError(std::string_view error)
Definition: Messages.h:28
Gaudi::Parsers::PropertyValue::position
const Position & position() const
Definition: PropertyValue.h:34
Gaudi::Parsers::PropertyValue::Vector
VectorOfStrings & Vector()
Definition: PropertyValue.h:39