Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena_MET
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Plebani
athena_MET
Commits
c3d95fb2
Commit
c3d95fb2
authored
2 years ago
by
Johannes Elmsheuser
Browse files
Options
Downloads
Patches
Plain Diff
Remove the fReaddCache.* files
parent
e480c74b
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Event/ByteStreamStoragePlugins/src/fReaddCache.cxx
+0
-134
0 additions, 134 deletions
Event/ByteStreamStoragePlugins/src/fReaddCache.cxx
Event/ByteStreamStoragePlugins/src/fReaddCache.h
+0
-35
0 additions, 35 deletions
Event/ByteStreamStoragePlugins/src/fReaddCache.h
with
0 additions
and
169 deletions
Event/ByteStreamStoragePlugins/src/fReaddCache.cxx
deleted
100644 → 0
+
0
−
134
View file @
e480c74b
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef __APPLE__
#include
"ers/ers.h"
#include
<dcap.h>
#include
"fReaddCache.h"
#include
"EventStorage/EventStorageIssues.h"
fReaddCache
::
fReaddCache
()
{
m_pfd
=
NULL
;
}
fReaddCache
::~
fReaddCache
()
{
this
->
closeFile
();
}
bool
fReaddCache
::
isOpen
()
{
return
m_pfd
!=
NULL
;}
bool
fReaddCache
::
isEoF
()
{
if
(
this
->
isOpen
())
{
return
dc_feof
(
m_pfd
);
}
else
{
return
false
;
}
}
bool
fReaddCache
::
fileExists
(
std
::
string
fName
)
const
{
char
*
nm
=
new
char
[
fName
.
size
()
+
1
];
memcpy
(
nm
,
fName
.
c_str
(),
fName
.
size
());
nm
[
fName
.
size
()]
=
0
;
FILE
*
pf
=
dc_fopen
(
nm
,(
char
*
)
"r"
);
bool
isThere
=
(
pf
!=
NULL
);
if
(
isThere
)
dc_fclose
(
pf
);
delete
[]
nm
;
return
isThere
;
}
void
fReaddCache
::
openFile
(
std
::
string
fName
)
{
if
(
this
->
isOpen
())
this
->
closeFile
();
char
*
nm
=
new
char
[
fName
.
size
()
+
1
];
memcpy
(
nm
,
fName
.
c_str
(),
fName
.
size
());
nm
[
fName
.
size
()]
=
0
;
m_pfd
=
dc_fopen
(
nm
,(
char
*
)
"r"
);
// A missing initialization was discovered in dCache.
// Diagnosed by Tadashi. It will be fixed in the next release
// of dCache. For the moment we do the reset ourselves.
if
(
m_pfd
!=
NULL
)
m_pfd
->
_flags
=
0
;
delete
[]
nm
;
}
void
fReaddCache
::
closeFile
()
{
if
(
m_pfd
!=
NULL
)
dc_fclose
(
m_pfd
);
m_pfd
=
NULL
;
}
void
fReaddCache
::
readData
(
char
*
buffer
,
unsigned
int
sizeBytes
)
{
if
(
sizeBytes
==
0
)
return
;
if
(
this
->
isOpen
())
{
unsigned
int
totalRead
=
0
,
ntry
=
0
;
while
(
sizeBytes
>
totalRead
)
{
int
ret
=
dc_fread
(
buffer
+
totalRead
,
sizeof
(
char
),
(
sizeBytes
-
totalRead
),
m_pfd
);
totalRead
+=
ret
;
++
ntry
;
if
(
ntry
>
5
)
{
/* ERS_WARNING("Problem reading from the data file. "
<<"fReadCastor::readData asked to read "<<sizeBytes
<<" bytes and managed to read only "<<totalRead
<<" bytes.");
*/
std
::
stringstream
mystream
;
mystream
<<
"Problem reading from the data file. "
<<
"fReaddCache::readData asked to read "
<<
sizeBytes
<<
" bytes and managed to read only "
<<
totalRead
<<
" bytes."
;
EventStorage
::
ReadingIssue
ci
(
ERS_HERE
,
mystream
.
str
().
c_str
());
ers
::
warning
(
ci
);
return
;
}
}
}
}
int64_t
fReaddCache
::
getPosition
()
{
if
(
this
->
isOpen
())
return
dc_ftell
(
m_pfd
);
return
-
1
;
}
void
fReaddCache
::
setPosition
(
int64_t
p
)
{
if
(
this
->
isOpen
())
dc_fseek
(
m_pfd
,
p
,
SEEK_SET
);
}
void
fReaddCache
::
setPositionFromEnd
(
int64_t
p
)
{
if
(
this
->
isOpen
())
dc_fseek
(
m_pfd
,
p
,
SEEK_END
);
}
fRead
*
fReaddCache
::
newReader
()
const
{
fReaddCache
*
nfr
=
new
fReaddCache
();
return
(
fRead
*
)
nfr
;
}
extern
"C"
{
fRead
*
fReadFactory
()
{
fReaddCache
*
nfr
=
new
fReaddCache
();
return
(
fRead
*
)
nfr
;
}
}
#endif
This diff is collapsed.
Click to expand it.
Event/ByteStreamStoragePlugins/src/fReaddCache.h
deleted
100644 → 0
+
0
−
35
View file @
e480c74b
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef FREADDCACHE_H
#define FREADDCACHE_H
#include
"EventStorage/fRead.h"
#include
<stdio.h>
class
fReaddCache
:
public
fRead
{
public:
fReaddCache
();
~
fReaddCache
();
bool
isOpen
();
bool
isEoF
();
bool
fileExists
(
std
::
string
fName
)
const
;
void
openFile
(
std
::
string
fName
);
void
closeFile
();
void
readData
(
char
*
buffer
,
unsigned
int
sizeBytes
);
int64_t
getPosition
();
void
setPosition
(
int64_t
p
);
void
setPositionFromEnd
(
int64_t
p
);
fRead
*
newReader
()
const
;
private:
FILE
*
m_pfd
;
// current file
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment