Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
fragment
picking_old
FragmentLibraryManager.cc
Go to the documentation of this file.
1
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2
// vi: set ts=2 noet:
3
//
4
// (c) Copyright Rosetta Commons Member Institutions.
5
// (c) This file is part of the Rosetta software suite and is made available under license.
6
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9
10
/// @file core/fragment/picking_old/FragmentLibraryManager.cc
11
/// @brief singleton class for accessing fragment libraries
12
/// @author Yih-En Andrew Ban (yab@u.washington.edu)
13
14
// unit headers
15
#include <
core/fragment/picking_old/FragmentLibraryManager.hh
>
16
17
// package headers
18
#include <
core/fragment/picking_old/vall/VallLibrary.hh
>
19
#include <
core/fragment/picking_old/vall/vall_io.hh
>
20
21
// project headers
22
#include <basic/database/open.hh>
23
#include <basic/options/option.hh>
24
#include <basic/options/keys/in.OptionKeys.gen.hh>
25
26
#include <utility/vector1.hh>
27
28
29
30
namespace
core {
31
namespace
fragment {
32
namespace
picking_old {
33
34
35
// static initialization
36
FragmentLibraryManager *
FragmentLibraryManager::instance_
= NULL;
37
38
39
/// @brief default constructor
40
FragmentLibraryManager::FragmentLibraryManager
() :
41
vall_( NULL )
42
{}
43
44
45
/// @brief return singleton instance of manager
46
FragmentLibraryManager
*
FragmentLibraryManager::get_instance
() {
47
// TODO: we need proper locking support here for multi-threaded access
48
if
(
instance_
== NULL ) {
49
instance_
=
new
FragmentLibraryManager
();
50
}
51
52
return
instance_
;
53
}
54
55
56
/// @brief return instance of standard Vall library
57
vall::VallLibrary
const
&
FragmentLibraryManager::get_Vall
()
const
{
58
using namespace
basic::options::OptionKeys;
59
using
basic::options::option;
60
using
basic::database::full_name;
61
62
// TODO: we need proper locking support here for multi-threaded access
63
if
(
vall_
== NULL ) {
64
vall_
=
new
vall::VallLibrary
();
65
vall::vall_library_from_file
( full_name( option[ in::file::vall ][1] ), *
vall_
, 62471 );
66
}
67
68
return
*
vall_
;
69
}
70
71
72
/// @brief clear standard Vall library from memory
73
void
FragmentLibraryManager::clear_Vall
() {
74
if
(
vall_
!= NULL ) {
75
delete
vall_
;
76
vall_
= NULL;
77
}
78
}
79
80
81
}
// picking_old
82
}
// fragment
83
}
// core
Generated on Sat Jun 1 2013 11:32:37 for Rosetta 3.5 by
1.8.4