carl  24.04
Computer ARithmetic Library
UFManager.cpp
Go to the documentation of this file.
1 /**
2  * @file UFManager.cpp
3  * @author Florian Corzilius <corzilius@cs.rwth-aachen.de>
4  * @since 2014-10-30
5  * @version 2014-10-30
6  */
7 
8 #include "UFManager.h"
9 #include <string>
10 
11 namespace carl {
12 
13  UninterpretedFunction UFManager::newUF(std::unique_ptr<UFContent>&& ufc) {
14  auto iter = mUFIdMap.find(ufc.get());
15  // Check if this uninterpreted function content has already been created
16  if (iter != mUFIdMap.end()) {
17  return UninterpretedFunction(iter->second);
18  }
19  // Create the uninterpreted function
20  mUFIdMap.emplace(ufc.get(), mUFs.size());
21  UninterpretedFunction uf(mUFs.size());
22  mUFs.push_back(std::move(ufc));
23  return uf;
24  }
25 }
carl is the main namespace for the library.
FastPointerMap< UFContent, std::size_t > mUFIdMap
Stores all instantiated uninterpreted function's contents and maps them to their unique id.
Definition: UFManager.h:121
std::vector< std::unique_ptr< UFContent > > mUFs
Maps the unique ids to the instantiated uninterpreted function's content.
Definition: UFManager.h:123
UninterpretedFunction newUF(std::unique_ptr< UFContent > &&sc)
Tries to add the given uninterpreted function's content to the so far stored uninterpreted function's...
Definition: UFManager.cpp:13
Implements an uninterpreted function.