ROOT
6.08/02
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
net
davix
src
TDavixFileInternal.h
Go to the documentation of this file.
1
// @(#)root/net:$Id$
2
// Author: Adrien Devresse and Tigran Mkrtchyan
3
4
/*************************************************************************
5
* Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#ifndef ROOT_TDavixFileInternal
13
#define ROOT_TDavixFileInternal
14
15
#include "
TUrl.h
"
16
#include "
TMutex.h
"
17
18
#include <vector>
19
#include <iterator>
20
#include <algorithm>
21
#include <errno.h>
22
#include <stdlib.h>
23
#include <unistd.h>
24
#include <fcntl.h>
25
#include <sys/stat.h>
26
#include <sstream>
27
#include <string>
28
#include <cstring>
29
30
//////////////////////////////////////////////////////////////////////////
31
// //
32
// TDavixFileInternal //
33
// //
34
// //
35
// Support class, common to TDavixFile and TDavixSystem //
36
// //
37
// Authors: Adrien Devresse (CERN IT/SDC) //
38
// Fabrizio Furano (CERN IT/SDC) //
39
// //
40
// September 2013 //
41
// //
42
//////////////////////////////////////////////////////////////////////////
43
44
namespace
Davix {
45
class
Context
;
46
class
RequestParams;
47
class
DavPosix;
48
}
49
struct
Davix_fd;
50
51
52
class
TDavixFileInternal
{
53
friend
class
TDavixFile
;
54
friend
class
TDavixSystem
;
55
56
private
:
57
TDavixFileInternal
(
const
TUrl
& mUrl,
Option_t
* mopt) :
58
positionLock
(),
59
openLock
(),
60
davixContext
(
getDavixInstance
()),
61
davixParam
(
NULL
),
62
davixPosix
(
NULL
),
63
davixFd
(
NULL
),
64
fUrl
(mUrl),
65
opt
(mopt),
66
oflags
(0),
67
dirdVec
() { }
68
69
TDavixFileInternal
(
const
char
* url,
Option_t
* mopt) :
70
positionLock
(),
71
openLock
(),
72
davixContext
(
getDavixInstance
()),
73
davixParam
(
NULL
),
74
davixPosix
(
NULL
),
75
davixFd
(
NULL
),
76
fUrl
(url),
77
opt
(mopt),
78
oflags
(0),
79
dirdVec
() { }
80
81
~TDavixFileInternal
();
82
83
Davix_fd *
getDavixFileInstance
()
84
{
85
// singleton init
86
if
(
davixFd
==
NULL
) {
87
TLockGuard
l
(&(
openLock
));
88
if
(
davixFd
==
NULL
) {
89
davixFd
= this->
Open
();
90
}
91
}
92
return
davixFd
;
93
}
94
95
Davix_fd *
Open
();
96
97
void
Close
();
98
99
void
enableGridMode
();
100
101
void
setAwsRegion
(
const
std::string & region);
102
void
setAwsToken
(
const
std::string & token);
103
104
void
setS3Auth
(
const
std::string & secret,
const
std::string & access,
105
const
std::string & region,
const
std::string & token);
106
107
void
parseConfig
();
108
109
void
parseParams
(
Option_t
* option);
110
111
void
init
();
112
113
bool
isMyDird
(
void
* fd);
114
115
void
addDird
(
void
* fd);
116
117
void
removeDird
(
void
* fd);
118
119
TMutex
positionLock
;
120
TMutex
openLock
;
121
122
// DAVIX
123
Davix::Context *
davixContext
;
124
Davix::RequestParams *
davixParam
;
125
Davix::DavPosix *
davixPosix
;
126
Davix_fd *
davixFd
;
127
TUrl
fUrl
;
128
Option_t
*
opt
;
129
int
oflags
;
130
std::vector<void*>
dirdVec
;
131
132
public
:
133
Int_t
DavixStat
(
const
char
*url,
struct
stat *st);
134
135
static
Davix::Context*
getDavixInstance
();
136
};
137
138
#endif
TDavixFileInternal
Definition:
TDavixFileInternal.h:52
TMutex
Definition:
TMutex.h:34
TDavixFileInternal::TDavixFileInternal
TDavixFileInternal(const char *url, Option_t *mopt)
Definition:
TDavixFileInternal.h:69
Option_t
const char Option_t
Definition:
RtypesCore.h:62
TDavixFileInternal::setS3Auth
void setS3Auth(const std::string &secret, const std::string &access, const std::string ®ion, const std::string &token)
Definition:
TDavixFile.cxx:336
TUrl
This class represents a WWW compatible URL.
Definition:
TUrl.h:41
TDavixFileInternal::davixParam
Davix::RequestParams * davixParam
Definition:
TDavixFileInternal.h:124
TDavixFileInternal::oflags
int oflags
Definition:
TDavixFileInternal.h:129
Context
Small helper to keep current directory context.
TDavixFileInternal::Open
Davix_fd * Open()
Definition:
TDavixFile.cxx:242
TDavixFileInternal::addDird
void addDird(void *fd)
Definition:
TDavixFile.cxx:653
Int_t
int Int_t
Definition:
RtypesCore.h:41
TDavixFileInternal::getDavixFileInstance
Davix_fd * getDavixFileInstance()
Definition:
TDavixFileInternal.h:83
TDavixFileInternal::setAwsRegion
void setAwsRegion(const std::string ®ion)
Definition:
TDavixFile.cxx:324
TLockGuard
Definition:
TVirtualMutex.h:69
TDavixFileInternal::davixPosix
Davix::DavPosix * davixPosix
Definition:
TDavixFileInternal.h:125
TDavixFileInternal::DavixStat
Int_t DavixStat(const char *url, struct stat *st)
Definition:
TDavixFile.cxx:458
TDavixFileInternal::positionLock
TMutex positionLock
Definition:
TDavixFileInternal.h:119
TDavixFileInternal::TDavixFileInternal
TDavixFileInternal(const TUrl &mUrl, Option_t *mopt)
Definition:
TDavixFileInternal.h:57
TDavixFileInternal::getDavixInstance
static Davix::Context * getDavixInstance()
Definition:
TDavixFile.cxx:229
TDavixFileInternal::removeDird
void removeDird(void *fd)
Definition:
TDavixFile.cxx:661
TDavixFileInternal::enableGridMode
void enableGridMode()
Definition:
TDavixFile.cxx:272
TUrl.h
TDavixFileInternal::parseConfig
void parseConfig()
Definition:
TDavixFile.cxx:351
TDavixFileInternal::isMyDird
bool isMyDird(void *fd)
Definition:
TDavixFile.cxx:644
l
TLine * l
Definition:
textangle.C:4
TDavixFileInternal::~TDavixFileInternal
~TDavixFileInternal()
Definition:
TDavixFile.cxx:221
TMutex.h
TDavixFileInternal::Close
void Close()
Definition:
TDavixFile.cxx:260
TDavixFileInternal::dirdVec
std::vector< void * > dirdVec
Definition:
TDavixFileInternal.h:130
TDavixFileInternal::davixFd
Davix_fd * davixFd
Definition:
TDavixFileInternal.h:126
TDavixFileInternal::opt
Option_t * opt
Definition:
TDavixFileInternal.h:128
TDavixSystem
Definition:
TDavixSystem.h:41
TDavixFileInternal::setAwsToken
void setAwsToken(const std::string &token)
Definition:
TDavixFile.cxx:330
NULL
#define NULL
Definition:
Rtypes.h:82
TDavixFileInternal::openLock
TMutex openLock
Definition:
TDavixFileInternal.h:120
TDavixFile
Definition:
TDavixFile.h:66
TDavixFileInternal::parseParams
void parseParams(Option_t *option)
intput params
Definition:
TDavixFile.cxx:395
TDavixFileInternal::init
void init()
Definition:
TDavixFile.cxx:446
TDavixFileInternal::davixContext
Davix::Context * davixContext
Definition:
TDavixFileInternal.h:123
TDavixFileInternal::fUrl
TUrl fUrl
Definition:
TDavixFileInternal.h:127