VPTissue Reference Manual
WorkspaceFactory.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "WorkspaceFactory.h"
21 
22 #include "workspace/CliWorkspace.h"
23 #include "workspace/GuiWorkspace.h"
24 #include "workspace/Workspace.h"
25 
26 #include "common/InstallDirs.h"
27 
28 namespace SimPT_Shell {
29 namespace Ws {
30 
31 using namespace std;
32 using namespace SimShell;
33 using namespace SimShell::Ws;
34 
35 shared_ptr<IWorkspace> WorkspaceFactory::CreateCliWorkspace(const string& path)
36 {
37  return make_shared<CliWorkspace>(path);
38 }
39 
40 shared_ptr<IWorkspace> WorkspaceFactory::CreateWorkspace(const string& path)
41 {
42  return make_shared<GuiWorkspace>(path);
43 }
44 
46 {
48 }
49 
51 {
52  return "simPT_Default_workspace";
53 }
54 
55 void WorkspaceFactory::InitWorkspace(const string& p)
56 {
57  Workspace::Init(p);
58 }
59 
60 const string WorkspaceFactory::g_project_index_file(".simPT-project.xml");
61 
62 const string WorkspaceFactory::g_workspace_index_file(".simPT-workspace.xml");
63 
64 } // namespace
65 } // namespace
STL namespace.
virtual std::string GetWorkspaceTemplatePath() const
Namespace for SimPT shell package.
Definition: Client.cpp:50
Interface for workspace.
virtual std::string GetDefaultWorkspaceName() const
virtual std::shared_ptr< SimShell::Ws::IWorkspace > CreateWorkspace(const std::string &path)
Namespace for generic workspace classes.
Definition: SimSession.h:32
Interface for workspace.
static std::string GetWorkspaceDir()
Utility method: get name of the directory for data files.
virtual void InitWorkspace(const std::string &path)
Interface for WorkspaceFactory.
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
Interface for FileSys.