-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariant_layout.C
executable file
·91 lines (80 loc) · 3.05 KB
/
variant_layout.C
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2013, Lawrence Livermore National Security, LLC.
// Produced at the Lawrence Livermore National Laboratory.
// Written by the Greg Bronevetsky <bronevetsky1@llnl.gov> / <greg@bronevetsky.com>.
//
// LLNL-CODE-642002
// All rights reserved.
//
// This file is part of Sight. For details, see https://e-reports-ext.llnl.gov/pdf/781752.pdf or
// https://github.com/bronevet/sight.
//
// Licensed under the GNU Lesser General Public License (Lesser GPU) Version 2.1,
// February 1999; you may not use this file except in compliance with the License.
// The full licence is included in file LICENCE and you may obtain a copy of the
// License at:
// https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the license.
////////////////////////////////////////////////////////////////////////////////
#include "sight_layout.h"
#include "sight_common.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
using namespace std;
using namespace sight::common;
namespace sight {
namespace layout {
// Record the layout handlers in this file
void* variantEnterHandler(properties::iterator props) { variant* v=new variant(props); return v; }
void variantExitHandler(void* obj) { variant* v = static_cast<variant*>(obj); delete v; }
void* interVariantHandler(properties::iterator props) {
dbg.ownerAccessing();
dbg << endl << "</td><td>" << endl;
dbg.userAccessing();
return NULL;
}
variantLayoutHandlerInstantiator::variantLayoutHandlerInstantiator() {
// Called when a group of variants are entered or exited
(*layoutEnterHandlers)["variants"] = &variantEnterHandler;
(*layoutExitHandlers) ["variants"] = &variantExitHandler;
// Called between individual variants within a group
(*layoutEnterHandlers)["inter_variants"] = &interVariantHandler;
}
variantLayoutHandlerInstantiator variantLayoutHandlerInstance;
variant::variant(properties::iterator props) :
scope("Variants",
false, // ownFile
true, // ownColor
false, // labelInteractive
false, // labelShown
true) // summaryEntry
{
numVariants = props.getInt("numSubDirs");
dbg.ownerAccessing();
dbg << "<table border=1 width=\"100\%\"><tr><td colspan=\""<<numVariants<<"\">Variants</td></tr>"<<endl;
dbg << "<tr><td>"<<endl;
//dbg << "<script type=\"text/javascript\">"<<loadCmd<<"</script>"<<endl;
dbg.flush();
dbg.userAccessing();
}
variant::~variant() {
// Close this scope
dbg.ownerAccessing();
dbg << "</td></tr></table>"<<endl;
dbg.userAccessing();
}
}; // namespace layout
}; // namespace sight