CoreLinux++  0.4.32
Environment.hpp
1 #if !defined(__ENVIRONMENT_HPP)
2 #define __ENVIRONMENT_HPP
3 
4 /*
5  CoreLinux++
6  Copyright (C) 1999,2000 CoreLinux Consortium
7 
8  The CoreLinux++ Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12 
13  The CoreLinux++ Library Library is distributed in the hope that it will
14  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public
19  License along with the GNU C Library; see the file COPYING.LIB. If not,
20  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA 02111-1307, USA.
22 */
23 
24 #if !defined IN_COMMON_HPP
25  #error Environment.hpp is included by Common.hpp only.
26 #endif
27 
28 
29 namespace corelinux
30 {
31  DECLARE_CLASS(Environment);
32 
38  {
39  public:
40 
42 
43  inline bool operator==( EnvironmentCref ) const
44  {
45  return true;
46  }
47 
48  //
49  // Accessors
50  //
52 
53  static UserIdentifier getUserId( void );
54 
56 
57  static UserIdentifier getEffectiveUserId( void );
58 
60 
61  static GroupIdentifier getGroupId( void );
62 
64 
65  static GroupIdentifier getEffectiveGroupId( void );
66 
74  static CharPtr getEnvironmentValue( CharCptr );
75 
76  //
77  // Mutators
78  //
79 
87  static Int setEnvironmentNameValue( CharPtr );
88 
89  //
90  // Functions for library
91  //
92 
101  static Int setupCommonAccess( CharCptr, const CreateDisposition & );
102 
109  static Int removeCommonAccess( CharCptr );
110 
112 
113  static ProcessIdentifier getProcessGroupId( void );
114 
116 
118 
120 
121  static void setThreadPriority( ProcessIdentifier, Int );
122 
124 
125  static Int getThreadPriority( ProcessIdentifier );
126 
127  protected:
128 
129  Environment( void ) throw (Assertion)
130  {
131  NEVER_GET_HERE;
132  }
133 
134  Environment( EnvironmentCref )
135  throw (Assertion)
136  {
137  NEVER_GET_HERE;
138  }
139 
140  EnvironmentRef operator=( EnvironmentCref )
141  throw (Assertion)
142  {
143  NEVER_GET_HERE;
144  return (*this);
145  }
146  private:
147 
148 
149  };
150 }
151 
152 #endif
153 
154 /*
155  Common rcs information do not modify
156  $Author: dulimart $
157  $Revision: 1.4 $
158  $Date: 2001/03/20 04:06:00 $
159  $Locker: $
160 */
161 
static void setThreadPriority(ProcessIdentifier, Int)
set priority for a specific process
Definition: Environment.cpp:206
static Int getThreadPriority(ProcessIdentifier)
get priority for a specific process
Definition: Environment.cpp:211
static ProcessIdentifier getProcessGroupId(void)
Retrieve the process group id for the current process.
Definition: Environment.cpp:72
static Int setEnvironmentNameValue(CharPtr)
Sets an environment name=value.
Definition: Environment.cpp:93
static Int removeCommonAccess(CharCptr)
The reverse of setupCommonAccess.
Definition: Environment.cpp:187
static UserIdentifier getEffectiveUserId(void)
Retreive the effective user id for the current process.
Definition: Environment.cpp:51
CreateDisposition
Creation dispositions for various system utilities.
Definition: AccessRights.hpp:63
ScalarIdentifier provides a templated interface for declaring CoreLinux Identifiers for simple scalar...
Definition: ScalarIdentifiers.hpp:37
Environment is a class utility which encapsulates.
Definition: Environment.hpp:37
static UserIdentifier getUserId(void)
Retreive the real user id for the current process.
Definition: Environment.cpp:44
static Int setupCommonAccess(CharCptr, const CreateDisposition &)
Basically, creates a filename for use by those Linux system api that require a key (IPC mainly)...
Definition: Environment.cpp:103
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
static CharPtr getEnvironmentValue(CharCptr)
Retrieve the environmental value variable from the (name=value) pair.
Definition: Environment.cpp:86
static GroupIdentifier getGroupId(void)
Retreive the real group id for the current process.
Definition: Environment.cpp:58
bool operator==(EnvironmentCref) const
Equality operator.
Definition: Environment.hpp:43
static GroupIdentifier getEffectiveGroupId(void)
Retreive the effective group id for the current process.
Definition: Environment.cpp:65

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium