XRootD
Loading...
Searching...
No Matches
XrdSutPFEntry Class Reference

#include <XrdSutPFEntry.hh>

+ Collaboration diagram for XrdSutPFEntry:

Public Member Functions

 XrdSutPFEntry (const char *n=0, short st=0, short cn=0, kXR_int32 mt=0)
 
 XrdSutPFEntry (const XrdSutPFEntry &e)
 
virtual ~XrdSutPFEntry ()
 
char * AsString () const
 
kXR_int32 Length () const
 
XrdSutPFEntryoperator= (const XrdSutPFEntry &pfe)
 
void Reset ()
 
void SetName (const char *n=0)
 

Public Attributes

XrdSutPFBuf buf1
 
XrdSutPFBuf buf2
 
XrdSutPFBuf buf3
 
XrdSutPFBuf buf4
 
short cnt
 
kXR_int32 mtime
 
char * name
 
XrdSysMutex pfeMutex
 
short status
 

Detailed Description

Definition at line 78 of file XrdSutPFEntry.hh.

Constructor & Destructor Documentation

◆ XrdSutPFEntry() [1/2]

XrdSutPFEntry::XrdSutPFEntry ( const char * n = 0,
short st = 0,
short cn = 0,
kXR_int32 mt = 0 )

Definition at line 85 of file XrdSutPFEntry.cc.

87{
88 // Constructor
89
90 name = 0;
91 status = st;
92 cnt = cn;
93 mtime = (mt > 0) ? mt : (kXR_int32)time(0);
94 if (n) {
95 name = new char[strlen(n)+1];
96 if (name)
97 strcpy(name,n);
98 }
99}
int kXR_int32
Definition XPtypes.hh:89
kXR_int32 mtime

References cnt, mtime, name, and status.

◆ XrdSutPFEntry() [2/2]

XrdSutPFEntry::XrdSutPFEntry ( const XrdSutPFEntry & e)

Definition at line 102 of file XrdSutPFEntry.cc.

102 : buf1(e.buf1),
103 buf2(e.buf2), buf3(e.buf3), buf4(e.buf4)
104{
105 // Copy constructor
106
107 name = 0;
108 status = e.status;
109 cnt = e.cnt;
110 mtime = e.mtime;
111 if (e.name) {
112 name = new char[strlen(e.name)+1];
113 if (name)
114 strcpy(name,e.name);
115 }
116}
XrdSutPFBuf buf3
XrdSutPFBuf buf1
XrdSutPFBuf buf2
XrdSutPFBuf buf4

References cnt, mtime, name, and status.

◆ ~XrdSutPFEntry()

virtual XrdSutPFEntry::~XrdSutPFEntry ( )
inlinevirtual

Definition at line 92 of file XrdSutPFEntry.hh.

92{ if (name) delete[] name; }

References name.

Member Function Documentation

◆ AsString()

char * XrdSutPFEntry::AsString ( ) const

Definition at line 152 of file XrdSutPFEntry.cc.

153{
154 // Return a string with serialized information
155 // For print purposes
156 // The output string points to a static buffer, so it must
157 // not be deleted by the caller
158 static char pbuf[2048];
159
160 char smt[20] = {0};
162
163 sprintf(pbuf,"st:%d cn:%d buf:%d,%d,%d,%d modified:%s name:%s",
165
166 return pbuf;
167}
int XrdSutTimeString(int t, char *st, int opt)
Definition XrdSutAux.cc:311
kXR_int32 len

References buf1, buf2, buf3, buf4, cnt, XrdSutPFBuf::len, mtime, name, status, and XrdSutTimeString().

Referenced by GetEntry(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Length()

kXR_int32 XrdSutPFEntry::Length ( ) const
inline

Definition at line 93 of file XrdSutPFEntry.hh.

93 { return (buf1.len + buf2.len + 2*sizeof(short) +
94 buf3.len + buf4.len + 5*sizeof(kXR_int32)); }

References buf1, buf2, buf3, buf4, and XrdSutPFBuf::len.

Referenced by XrdSutPFile::WriteEntry().

+ Here is the caller graph for this function:

◆ operator=()

XrdSutPFEntry & XrdSutPFEntry::operator= ( const XrdSutPFEntry & pfe)

Definition at line 170 of file XrdSutPFEntry.cc.

171{
172 // Assign entry e to local entry.
173
174 SetName(name);
175 status = e.status;
176 cnt = e.cnt; // counter
177 mtime = e.mtime; // time of last modification / creation
178 buf1.SetBuf(e.buf1.buf);
179 buf2.SetBuf(e.buf2.buf);
180 buf3.SetBuf(e.buf3.buf);
181 buf4.SetBuf(e.buf4.buf);
182
183 return (*this);
184}
void SetBuf(const char *b=0, kXR_int32 l=0)
void SetName(const char *n=0)

References XrdSutPFBuf::buf, buf1, buf2, buf3, buf4, cnt, mtime, name, XrdSutPFBuf::SetBuf(), SetName(), and status.

+ Here is the call graph for this function:

◆ Reset()

void XrdSutPFEntry::Reset ( )

Definition at line 119 of file XrdSutPFEntry.cc.

120{
121 // Resetting entry
122
123 if (name)
124 delete[] name;
125 name = 0;
126 status = 0;
127 cnt = 0;
128 mtime = (kXR_int32)time(0);
129 buf1.SetBuf();
130 buf2.SetBuf();
131 buf3.SetBuf();
132 buf4.SetBuf();
133}

References buf1, buf2, buf3, buf4, cnt, mtime, name, XrdSutPFBuf::SetBuf(), and status.

Referenced by main(), and XrdSutPFile::ReadEntry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetName()

void XrdSutPFEntry::SetName ( const char * n = 0)

Definition at line 136 of file XrdSutPFEntry.cc.

137{
138 // Set the name
139
140 if (name) {
141 delete[] name;
142 name = 0;
143 }
144 if (n) {
145 name = new char[strlen(n)+1];
146 if (name)
147 strcpy(name,n);
148 }
149}

References name.

Referenced by GetEntry(), XrdSutPFCache::Load(), main(), operator=(), XrdSutPFile::ReadEntry(), and XrdSutPFile::ReadEntry().

+ Here is the caller graph for this function:

Member Data Documentation

◆ buf1

◆ buf2

◆ buf3

XrdSutPFBuf XrdSutPFEntry::buf3

◆ buf4

XrdSutPFBuf XrdSutPFEntry::buf4

◆ cnt

◆ mtime

◆ name

◆ pfeMutex

XrdSysMutex XrdSutPFEntry::pfeMutex

Definition at line 88 of file XrdSutPFEntry.hh.

Referenced by XrdSutPFCache::Get().

◆ status


The documentation for this class was generated from the following files: