1 /* Copyright 2016 Google Inc. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 #include "workspace.h"
17 
18 #include "base.h"
19 
20 namespace chrome_lang_id {
21 
WorkspaceSet()22 WorkspaceSet::WorkspaceSet() {}
23 
~WorkspaceSet()24 WorkspaceSet::~WorkspaceSet() { Reset(WorkspaceRegistry()); }
25 
WorkspaceRegistry()26 WorkspaceRegistry::WorkspaceRegistry() {}
27 
~WorkspaceRegistry()28 WorkspaceRegistry::~WorkspaceRegistry() {}
29 
DebugString() const30 string WorkspaceRegistry::DebugString() const {
31   string str;
32   for (auto &it : workspace_names_) {
33     const string &type_name = workspace_types_.at(it.first);
34     for (size_t index = 0; index < it.second.size(); ++index) {
35       const string &workspace_name = it.second[index];
36       str += "\n  ";
37       str += type_name;
38       str += " :: ";
39       str += workspace_name;
40     }
41   }
42   return str;
43 }
44 
~VectorIntWorkspace()45 VectorIntWorkspace::~VectorIntWorkspace() {}
46 
VectorIntWorkspace(int size)47 VectorIntWorkspace::VectorIntWorkspace(int size) : elements_(size) {}
48 
VectorIntWorkspace(int size,int value)49 VectorIntWorkspace::VectorIntWorkspace(int size, int value)
50     : elements_(size, value) {}
51 
VectorIntWorkspace(const std::vector<int> & elements)52 VectorIntWorkspace::VectorIntWorkspace(const std::vector<int> &elements)
53     : elements_(elements) {}
54 
TypeName()55 string VectorIntWorkspace::TypeName() { return "Vector"; }
56 
~VectorVectorIntWorkspace()57 VectorVectorIntWorkspace::~VectorVectorIntWorkspace() {}
58 
VectorVectorIntWorkspace(int size)59 VectorVectorIntWorkspace::VectorVectorIntWorkspace(int size)
60     : elements_(size) {}
61 
TypeName()62 string VectorVectorIntWorkspace::TypeName() { return "VectorVector"; }
63 
64 }  // namespace chrome_lang_id
65