18#ifndef _DECAF_LANG_SYSTEM_H_
19#define _DECAF_LANG_SYSTEM_H_
44 static SystemData* sys;
74 static void arraycopy(
const char* src, std::size_t srcPos,
75 char* dest, std::size_t destPos, std::size_t length );
95 static void arraycopy(
const unsigned char* src, std::size_t srcPos,
96 unsigned char* dest, std::size_t destPos, std::size_t length );
116 static void arraycopy(
const short* src, std::size_t srcPos,
117 short* dest, std::size_t destPos, std::size_t length );
137 static void arraycopy(
const int* src, std::size_t srcPos,
138 int* dest, std::size_t destPos, std::size_t length );
158 static void arraycopy(
const long long* src, std::size_t srcPos,
159 long long* dest, std::size_t destPos, std::size_t length );
179 static void arraycopy(
const float* src, std::size_t srcPos,
180 float* dest, std::size_t destPos, std::size_t length );
200 static void arraycopy(
const double* src, std::size_t srcPos,
201 double* dest, std::size_t destPos, std::size_t length );
221 template<
typename E >
222 static void arraycopy(
const E* src, std::size_t srcPos,
223 E* dest, std::size_t destPos, std::size_t length ) {
227 __FILE__, __LINE__,
"Given Source Pointer was null." );
232 __FILE__, __LINE__,
"Given Source Pointer was null." );
235 for( std::size_t i = 0; i < length; ++i ) {
236 dest[destPos+i] = src[srcPos+i];
261 static std::string
getenv(
const std::string& name );
283 static void setenv(
const std::string& name,
const std::string& value );
375 static std::string
getProperty(
const std::string& key,
const std::string& defaultValue );
390 static std::string
setProperty(
const std::string& key,
const std::string& value );
414 static std::vector< std::string > getEnvArray();
427 static void initSystem(
int argc,
char **argv );
428 static void shutdownSystem();
Wraps an APR pool object so that classes in decaf can create a static member for use in static method...
Definition AprPool.h:33
static decaf::util::Properties & getProperties()
Gets the Properties object that holds the Properties accessed from calls to getProperty and setProper...
static const util::Map< std::string, std::string > & getenv()
Enumerates the system environment and returns a map of env variable names to the string values they h...
static void arraycopy(const E *src, std::size_t srcPos, E *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
Definition System.h:222
static void arraycopy(const long long *src, std::size_t srcPos, long long *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
static long long nanoTime()
Returns the current value of the most precise available system timer, in nanoseconds.
static std::string clearProperty(const std::string &key)
Clear any value associated with the system property specified.
static void arraycopy(const float *src, std::size_t srcPos, float *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
static void arraycopy(const double *src, std::size_t srcPos, double *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
static void arraycopy(const char *src, std::size_t srcPos, char *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
static void arraycopy(const unsigned char *src, std::size_t srcPos, unsigned char *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
static long long currentTimeMillis()
Returns the current time in milliseconds.
static std::string getProperty(const std::string &key)
Gets the specified System property if set, otherwise returns an empty string.
static void arraycopy(const short *src, std::size_t srcPos, short *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
virtual ~System()
Definition System.h:52
static void arraycopy(const int *src, std::size_t srcPos, int *dest, std::size_t destPos, std::size_t length)
Copies the number of elements specified by length from the source array starting at the given source ...
static int availableProcessors()
Returns the number of processors available for execution of Decaf Threads.
static void setenv(const std::string &name, const std::string &value)
Sets the specified system property to the value given.
static std::string getenv(const std::string &name)
Reads an environment value from the system and returns it as a string object.
static void unsetenv(const std::string &name)
Clears a set environment value if one is set.
static std::string setProperty(const std::string &key, const std::string &value)
Sets the System Property to the specified value.
static std::string getProperty(const std::string &key, const std::string &defaultValue)
Gets the specified System property if set, otherwise returns the specified default value.
Definition NullPointerException.h:32
An object that maps keys to values.
Definition Map.h:88
Java-like properties class for mapping string names to string values.
Definition Properties.h:53
#define NULL
Definition Config.h:33
#define DECAF_API
Definition Config.h:29
Definition ThreadingTypes.h:31
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25