Main Page Alphabetical List Compound List File List Compound Members File Members
GATFileCPI.c File ReferenceMain file for the GATFileCPI class.
More...
#include <stdio.h>
#include <stdlib.h>
#include "GATFileCPI.h"
Include dependency graph for GATFileCPI.c:
Go to the source code of this file.
|
Compounds |
| struct | GATFileCPI_S |
Functions |
| GATBool | GATFileCPI_IsValidData_V1 (GATFileCPI_Data *data) |
| GATFileCPI | GATFileCPI_Create (unsigned long int version, GATFileCPI_Data *data) |
| | GATFileCPI_Create The GATFileCPI constructor.
|
| void | GATFileCPI_Destroy (GATFileCPI *cpi) |
| | GATFileCPI_Destroy The GATFileCPI destructor.
|
| GATResult | GATFileCPI_CreateInstance (GATFileCPI cpi, GATFileCPI_Instance *data) |
| | GATFileCPI_CreateInstance Create a new CPI object instance.
|
| void | GATFileCPI_DestroyInstance (GATFileCPI cpi, GATFileCPI_Instance *data) |
| | GATFileCPI_DestroyInstance Create a new CPI object instance.
|
| GATResult | GATFileCPI_EqualsInstance (GATFileCPI cpi, GATFileCPI_Instance const *lhs, GATFileCPI_Instance const *rhs, GATBool *isequal) |
| | GATFileCPI_EqualsInstance Compares two CPI object instances.
|
| GATResult | GATFileCPI_CloneInstance (GATFileCPI cpi, GATFileCPI_Instance const *data, GATFileCPI_Instance *new_data) |
| | GATFileCPI_CloneInstance Clones a CPI object instance.
|
| GATResult | GATFileCPI_Serialise (GATFileCPI cpi, GATFileCPI_Instance const *data, GATObject stream, GATBool clear_dirty) |
| | GATFileCPI_Serialise Serialise the instance data.
|
| GATResult | GATFileCPI_DeSerialise (GATFileCPI cpi, GATObject stream, GATFileCPI_Instance *data) |
| | GATFileCPI_DeSerialise De-serialise the instance data.
|
| GATResult | GATFileCPI_Copy (GATFileCPI cpi, GATFileCPI_Instance const *data, GATLocation_const targetLocation, GATFileMode mode) |
| | GATFileCPI_Copy Copy a file from one location to another.
|
| GATResult | GATFileCPI_Move (GATFileCPI cpi, GATFileCPI_Instance const *data, GATLocation_const targetLocation, GATFileMode mode) |
| | GATFileCPI_Move Move a file from one location to another.
|
| GATResult | GATFileCPI_Delete (GATFileCPI file, GATFileCPI_Instance const *data) |
| | GATFileCPI_Delete Delete a file.
|
| GATResult | GATFileCPI_IsReadable (GATFileCPI cpi, GATFileCPI_Instance const *data) |
| | GATFileCPI_IsReadable Check the file attributes for the readable flag.
|
| GATResult | GATFileCPI_IsWritable (GATFileCPI cpi, GATFileCPI_Instance const *data) |
| | GATFileCPI_IsWritable Check the file attributes for the writable flag.
|
| GATResult | GATFileCPI_GetLength (GATFileCPI cpi, GATFileCPI_Instance const *data, unsigned long *length) |
| | GATFileCPI_GetLength Returns the size of the given file.
|
| GATResult | GATFileCPI_LastWriteTime (GATFileCPI cpi, GATFileCPI_Instance const *data, GATTime *lw_time) |
| | GATFileCPI_LastWriteTime Returns the time of last modification of the given file.
|
| GATResult | GATFileCPI_GetMetrics (GATFileCPI cpi, GATFileCPI_Instance const *data, GATList_GATMetric *metrics) |
| | GATFileCPI_GetMetrics.
|
| GATResult | GATFileCPI_GetMetricEvent (GATFileCPI cpi, GATFileCPI_Instance const *data, GATMetric metric, GATMetricEvent *event) |
| | GATFileCPI_GetMetricEvent.
|
Variables |
| const char * | rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATFileCPI.c,v 1.25 2004/04/02 12:31:57 hartmutkaiser Exp $" |
Detailed Description
Main file for the GATFileCPI class.
A GATFileCPI encapsulates all the methods that a GATFile capability provider provides.
- Date:
-
Thu Sep 18 2003
- Version:
-
- Header:
-
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATFileCPI.c,v 1.25 2004/04/02 12:31:57 hartmutkaiser Exp
Copyright (C) Tom Goodale Copyright (C) Hartmut Kaiser This file is part of the GAT Engine. Contributed by Tom Goodale <goodale@aei.mpg.de> and Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.
Use, modification and distribution is subject to the Gridlab Software License. (See accompanying file GLlicense.txt or copy at http://www.gridlab.org/GLlicense.txt)
Definition in file GATFileCPI.c.
Function Documentation
|
|
Definition at line 434 of file GATFileCPI.c.
References GATFileCPI_Data::clone_instance, GATFileCPI_Data::copy, GATFileCPI_Data::create_instance, data, GATFileCPI_Data::deserialise, GATFileCPI_Data::destroy, GATFileCPI_Data::destroy_instance, GATFileCPI_Data::equals_instance, GATFalse, GATTrue, GATFileCPI_Data::get_metric_event, GATFileCPI_Data::get_metrics, GATFileCPI_Data::isreadable, GATFileCPI_Data::iswritable, GATFileCPI_Data::lastwritetime, GATFileCPI_Data::length, GATFileCPI_Data::move, GATFileCPI_Data::remove, and GATFileCPI_Data::serialise.
Referenced by GATFileCPI_Create(). |
|
|
GATFileCPI_Create The GATFileCPI constructor.
This is the constructor for GATFileCPI objects. - Parameters:
-
| version |
Version of the GATFileCPI_Data structure |
| data |
Pointer to adaptor CPI instance data structure. |
- Returns:
-
A new GATFileCPI
Definition at line 84 of file GATFileCPI.c.
References GATFileCPI_S::clone_instance, GATFileCPI_Data::clone_instance, GATFileCPI_S::copy, GATFileCPI_Data::copy, GATFileCPI_S::create_instance, GATFileCPI_Data::create_instance, data, GATFileCPI_S::data, GATFileCPI_Data::data, GATFileCPI_S::deserialise, GATFileCPI_Data::deserialise, GATFileCPI_S::destroy, GATFileCPI_Data::destroy, GATFileCPI_S::destroy_instance, GATFileCPI_Data::destroy_instance, GATFileCPI_S::equals_instance, GATFileCPI_Data::equals_instance, GATFileCPI_IsValidData_V1(), GATFILECPI_VERSION, GATTrue, GATFileCPI_S::get_metric_event, GATFileCPI_Data::get_metric_event, GATFileCPI_S::get_metrics, GATFileCPI_Data::get_metrics, GATFileCPI_S::isreadable, GATFileCPI_Data::isreadable, GATFileCPI_S::iswritable, GATFileCPI_Data::iswritable, GATFileCPI_S::lastwritetime, GATFileCPI_Data::lastwritetime, GATFileCPI_S::length, GATFileCPI_Data::length, GATFileCPI_S::move, GATFileCPI_Data::move, GATFileCPI_S::remove, GATFileCPI_Data::remove, GATFileCPI_S::serialise, GATFileCPI_Data::serialise, GATFileCPI_S::service_actions, and GATFileCPI_Data::service_actions.
Referenced by fileops_adaptor_register(). |
|
|
GATFileCPI_EqualsInstance Compares two CPI object instances.
Calls the adaptor to compare two CPI object instances. - Parameters:
-
| this |
The CPI object. |
| lhs |
The instance data of the left CPI object |
| rhs |
The instance data of the right CPI object |
| isequal |
The pointer to the variable, where the result is to be returned to. |
- Returns:
-
An error code.
Definition at line 201 of file GATFileCPI.c.
References cpi, GATFileCPI_S::data, GATFileCPI_S::equals_instance, and GATBool.
Referenced by GATFile_Equals(). |
|
|
GATFileCPI_CloneInstance Clones a CPI object instance.
Calls the adaptor to clone a CPI object instance. - Parameters:
-
| this |
The CPI object. |
| instance_data |
The instance data of the CPI object to clone. |
| rhs |
The new instance data is to be returned here. |
- Returns:
-
An error code.
Definition at line 219 of file GATFileCPI.c.
References GATFileCPI_S::clone_instance, cpi, data, and GATFileCPI_S::data.
Referenced by GATFile_Clone(). |
|
|
GATFileCPI_Serialise Serialise the instance data.
Calls the adaptor to serialise the instance data. - Parameters:
-
| this |
The CPI object. |
| instance_data |
The instance data of the attached CPI object |
| stream |
The stream to use be used for serialisation. |
| clear_dirty |
If the clear_dirty parameter is set to GATTrue, the internal dirty flag of this object is to be reset. |
- Returns:
-
An error code.
Definition at line 239 of file GATFileCPI.c.
References cpi, data, GATFileCPI_S::data, GATBool, and GATFileCPI_S::serialise.
Referenced by GATFileCPI_SerialiseCallback(). |
|
|
GATFileCPI_DeSerialise De-serialise the instance data.
Call the adaptor to de-serialise the instance data. - Parameters:
-
| context |
The GAT context to be used for object construction. |
| stream |
The stream interface to use for the serialisation. |
| instance_data |
The pointer to a variable, which contains the client data of the new object. The member instance data of this object may receive the pointer to the new instance data of the CPI object. |
- Returns:
-
An error code.
Definition at line 259 of file GATFileCPI.c.
References cpi, data, GATFileCPI_S::data, and GATFileCPI_S::deserialise.
Referenced by GATFile_DeSerialise_Create(). |
|
|
GATFileCPI_IsReadable Check the file attributes for the readable flag.
The function GATFile_IsReadable calls the adaptor which checks the file attributes of the given file and returns, whether it is readable. - Parameters:
-
| this |
The CPI object. |
| instance_data |
The instance data of the attached CPI object |
- Returns:
-
If the inspected file is readable, the function returns
#GAT_SUCCESS, if it is not readable, #GAT_FALSE is returned. Otherwise the function returns any of the possible errorcodes.
Definition at line 330 of file GATFileCPI.c.
References cpi, data, GATFileCPI_S::data, and GATFileCPI_S::isreadable.
Referenced by GATFile_IsReadable(). |
|
|
GATFileCPI_IsWritable Check the file attributes for the writable flag.
The function GATFileCPI_IsWritable calls the adaptor which checks the file attributes of the given file and returns, whether it is writable. - Parameters:
-
| this |
The CPI object. |
| instance_data |
The instance data of the attached CPI object |
- Returns:
-
If the inspected file is writable, the function returns
#GAT_SUCCESS, if it is not writable, #GAT_FALSE is returned. Otherwise the function returns any of the possible errorcodes.
Definition at line 349 of file GATFileCPI.c.
References cpi, data, GATFileCPI_S::data, and GATFileCPI_S::iswritable.
Referenced by GATFile_IsWritable(). |
|
|
GATFileCPI_GetLength Returns the size of the given file.
The function GATFile_GetLength returns the file size of the given size measured in bytes. - Parameters:
-
| this |
The CPI object. |
| instance_data |
The instance data of the attached CPI object |
- Returns:
-
The size of the given file measured in bytes. If an error occurs, the function returns (unsigned long)(-1).
Definition at line 367 of file GATFileCPI.c.
References cpi, data, GATFileCPI_S::data, and GATFileCPI_S::length.
Referenced by GATFile_GetLength(). |
|
|
GATFileCPI_LastWriteTime Returns the time of last modification of the given file.
The function GATFile_LastWriteTime returns the time of last modification of the inspected file. - Parameters:
-
| this |
The CPI object. |
| instance_data |
The instance data of the attached CPI object |
- Returns:
-
The time of the last modification of the file. If an error occurs, the function will return 0 (zero).
Definition at line 386 of file GATFileCPI.c.
References cpi, data, GATFileCPI_S::data, and GATFileCPI_S::lastwritetime.
Referenced by GATFile_LastWriteTime(). |
|
|
GATFileCPI_GetMetricEvent.
The function GATFileCPI_GetMetricEvent returns the metric event, which is associated with the given metric. - Parameters:
-
| this |
The CPI object. |
| instance_data |
The instance data of the attached CPI object |
| metric |
The continuous metric, for which the metric event is to be returned. |
| event |
The pointer to the variable, which receives the resulting metric event. |
- Returns:
-
An error code.
Definition at line 426 of file GATFileCPI.c.
References cpi, data, GATFileCPI_S::data, GATMetric, and GATFileCPI_S::get_metric_event.
Referenced by GATFile_RegisterPolling(). |
Variable Documentation
const char* rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATFileCPI.c,v 1.25 2004/04/02 12:31:57 hartmutkaiser Exp $" [static]
|
|
|