-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmi_model_impl.hpp
More file actions
62 lines (43 loc) · 1.53 KB
/
mi_model_impl.hpp
File metadata and controls
62 lines (43 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "model_includes/api/mi_model.hpp"
#include "model_includes/api/mi_include.hpp"
#include "tools/std_hash_fs_path.hpp"
#include <unordered_map>
#include <vector>
//------------------------------------------------------------------------------
namespace model_includes
{
//------------------------------------------------------------------------------
class ModelImpl final : public Model
{
public:
ModelImpl();
~ModelImpl() override;
std::size_t getFilesCount() const override;
void forEachFile( FileCallback _callback ) const override;
void setProjectDir( const Path & _path ) override;
const Path & getProjectDir() const override;
File & ensureFile( const Path & _filePath, FileType _fileType ) override;
const File * findFile( const Path & _filePath ) const override;
void forEachInclude( IncludeCallback _callback ) const override;
const Include & createInclude(
const IncludeLocationInfo & _location,
File & _sourceFile,
File & _destinationFile,
IncludeStatus _status,
IncludeType _type ) override;
private:
using IncludeLocationPtr = std::unique_ptr< IncludeLocation >;
IncludeLocationPtr
createIncludeLocation( const IncludeLocationInfo & _location ) const;
private:
using FilePtr = std::unique_ptr< File >;
using Files = std::unordered_map< Path, FilePtr >;
using IncludePtr = std::unique_ptr< Include >;
using Includes = std::vector< IncludePtr >;
Files m_files;
Includes m_includes;
Path m_projectDir;
};
//------------------------------------------------------------------------------
}