Develop and Download Open Source Software

Browse CVS Repository

Annotation of /xoonips/AL/event.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download) (as text)
Wed Jun 29 00:10:18 2005 UTC (18 years, 9 months ago) by aga4096
Branch: MAIN
Changes since 1.1: +29 -29 lines
File MIME type: text/x-c++src
・login name -> additional info に修正.

1 aga4096 1.1 /*
2     * --------------------------------------------------------------------------
3     * XooNiPs Xoops modules for Neuroinformatics Platforms
4     * Copyright (C) 2005 RIKEN, Japan. All rights reserved.
5     * http://sourceforge.jp/projects/xoonips/
6     * --------------------------------------------------------------------------
7     * This program is free software; you can redistribute it and/or
8     * modify it under the terms of the GNU General Public License
9     * as published by the Free Software Foundation; either version 2
10     * of the License, or (at your option) any later version.
11     *
12     * This program is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with this program; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20     * --------------------------------------------------------------------------
21     *
22     *
23     * 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
24     *
25 aga4096 1.2 * $Revision: 1.1 $
26 aga4096 1.1 */
27    
28     #include <string.h>
29    
30     #include "common.h"
31     #include "event.h"
32    
33     const int event::validFields[][10] =
34     {
35 aga4096 1.2 // timestamp, exec_uid, remote_host, index_id, file_id, uid, gid, search_keyword, additional_info
36 aga4096 1.1 { 0,0,0,0,0,0,0,0,0,0}, //(dummy)
37     { 1,1,1,0,0,0,0,0,0,1}, //LOGIN_FAILURE
38     { 1,1,1,0,0,0,0,0,0,0}, //LOGIN_SUCCESS
39     { 1,1,1,0,0,0,0,0,0,0}, //LOGOUT
40     { 1,1,1,0,1,0,0,0,0,0}, //INSERT_ITEM
41     { 1,1,1,0,1,0,0,0,0,0}, //UPDATE_ITEM
42     { 1,1,1,0,1,0,0,0,0,0}, //DELETE_ITEM
43     { 1,1,1,0,1,0,0,0,0,0}, //VIEW_ITEM
44     { 1,1,1,0,1,1,0,0,0,0}, //DOWNLOAD_FILE
45     { 1,1,1,1,1,0,0,0,0,0}, //REQUEST_CERTIFY_ITEM
46     { 1,1,1,1,0,0,0,0,0,0}, //INSERT_INDEX
47     { 1,1,1,1,0,0,0,0,0,0}, //UPDATE_INDEX
48     { 1,1,1,1,0,0,0,0,0,0}, //DELETE_INDEX
49     { 1,1,1,1,1,0,0,0,0,0}, //CERTIFY_ITEM
50     { 1,1,1,1,1,0,0,0,0,0}, //REJECT_ITEM
51 aga4096 1.2 { 1,0,1,0,0,0,1,0,0,0}, //REQUEST_INSERT_ACCOUNT
52 aga4096 1.1 { 1,1,1,0,0,0,1,0,0,0}, //CERTIFY_ACCOUNT
53     { 1,1,1,0,0,0,0,1,0,0}, //INSERT_GROUP
54     { 1,1,1,0,0,0,0,1,0,0}, //UPDATE_GROUP
55     { 1,1,1,0,0,0,0,1,0,0}, //DELETE_GROUP
56     { 1,1,1,0,0,0,1,1,0,0}, //INSERT_GROUP_MEMBER
57     { 1,1,1,0,0,0,1,1,0,0}, //DELETE_GROUP_MEMBER
58     { 1,1,1,0,0,0,0,0,0,0}, //VIEW_TOP_PAGE
59     { 1,1,1,0,0,0,0,0,1,0}, //QUICK_SEARCH
60     { 1,1,1,0,0,0,0,0,1,0} //ADVANCED_SEARCH
61     };
62    
63     event::event()
64     {
65     eventID = 0;
66     eventTypeID = ETID_INVALID_ETID;
67     timestamp = 0;
68     execUID = 0;
69     indexID = 0;
70     itemID = 0;
71     fileID = 0;
72     uid = 0;
73     gid = 0;
74     remoteHost = 0; setValue( &this -> remoteHost , "" );
75     searchKeyword = 0; setValue( &this -> searchKeyword , "" );
76 aga4096 1.2 additionalInfo= 0; setValue( &this -> additionalInfo, "" );
77 aga4096 1.1 }
78    
79     event::~event(){
80     if ( remoteHost != 0 ) delete[] remoteHost ;
81     if ( searchKeyword != 0 ) delete[] searchKeyword ;
82 aga4096 1.2 if ( additionalInfo!= 0 ) delete[] additionalInfo;
83 aga4096 1.1
84     }
85    
86     eventid_t event::getEventID () const { return eventID ; }
87     eventtypeid_t event::getEventTypeID () const { return eventTypeID ; }
88     time_t event::getTimestamp () const { return timestamp ; }
89     userid_t event::getExecUID () const { return execUID ; }
90     indexid_t event::getIndexID () const { return indexID ; }
91     itemid_t event::getItemID () const { return itemID ; }
92     fileid_t event::getFileID () const { return fileID ; }
93     userid_t event::getUID () const { return uid ; }
94     groupid_t event::getGID () const { return gid ; }
95     const char* event::getRemoteHost () const { return remoteHost ; }
96     const char* event::getSearchKeyword () const { return searchKeyword ; }
97 aga4096 1.2 const char* event::getAdditionalInfo() const { return additionalInfo; }
98 aga4096 1.1
99 aga4096 1.2 void event::setEventID ( eventid_t x ) { if ( ETID_INVALID_ETID < x && x <= ETID_MAX ) eventID = x; }
100     void event::setEventTypeID ( eventtypeid_t x ) { eventTypeID = x; }
101     void event::setTimestamp ( time_t x ) { timestamp = x; }
102     void event::setExecUID ( userid_t x ) { execUID = x; }
103     void event::setIndexID ( indexid_t x ) { indexID = x; }
104     void event::setItemID ( itemid_t x ) { itemID = x; }
105     void event::setFileID ( fileid_t x ) { fileID = x; }
106     void event::setUID ( userid_t x ) { uid = x; }
107     void event::setGID ( groupid_t x ) { gid = x; }
108     void event::setRemoteHost ( const char* x ) { setValue( &this -> remoteHost , x ); }
109     void event::setSearchKeyword ( const char* x ) { setValue( &this -> searchKeyword , x ); }
110     void event::setAdditionalInfo( const char* x ) { setValue( &this -> additionalInfo, x ); }
111    
112     bool event::isValidTimestamp () const { return (bool)validFields[eventTypeID][0]; }
113     bool event::isValidExecUID () const { return (bool)validFields[eventTypeID][1]; }
114     bool event::isValidIndexID () const { return (bool)validFields[eventTypeID][3]; }
115     bool event::isValidItemID () const { return (bool)validFields[eventTypeID][4]; }
116     bool event::isValidFileID () const { return (bool)validFields[eventTypeID][5]; }
117     bool event::isValidUID () const { return (bool)validFields[eventTypeID][6]; }
118     bool event::isValidGID () const { return (bool)validFields[eventTypeID][7]; }
119     bool event::isValidRemoteHost () const { return (bool)validFields[eventTypeID][2]; }
120     bool event::isValidSearchKeyword () const { return (bool)validFields[eventTypeID][8]; }
121     bool event::isValidAdditionalInfo() const { return (bool)validFields[eventTypeID][9]; }
122 aga4096 1.1

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26