<commit_before>#ifndef ICONNECTOR_H
#define ICONNECTOR_H

#include "Kernel_global.h"
#include <QExplicitlySharedDataPointer>

namespace Ilwis {

class IlwisObject;
class ConnectorFactory;
class Resource;
class Grid;
class OperationExpression;
class ExecutionContext;

/*!
 * \brief The ConnectorInterface class all connectors are derived from this interface
 *
 *The connector interface enumerates the methods that may be implemented by a derivative. It is unlikely that a derivative will implement all methods so a default implementation is provied.
 *Usualy the MetaData methods are implemented and depending on the nature of the source also one or more of the binary (Grid/table) ones is implemented.
 */
class KERNELSHARED_EXPORT ConnectorInterface {
public:
    virtual ~ConnectorInterface() {}
    /*!
     \brief loads the metadata and non binary information into the ilwisobject. After this method it should be a valid object

     \param data the ilwisobject to be initialized
     \return bool true when succesfull. If not succesful the reason can be found in the issuelogger
    */
    virtual bool loadMetaData(IlwisObject* ) { return false;}
    /*!
     * \brief storeMetaData stores the metadata and non binary information to the source of the connector
     * \return bool true when succesfull. If not succesful the reason can be found in the issuelogger
     */
    virtual bool storeMetaData(IlwisObject* )  { return false; }
    /*!
     * \brief loadGridData loads the 2D or 3D raster data from the source into memory
     *
     *Grid data can be of any size as the memory manager of Ilwis will swap any excess out to its disk cache.
     *Note that Ilwis doesnt make a difference between 2D and 3D griddata. If the local format has different storage methods for those they have to be resolved at connector level
     * \return returns the allocated grid
     */
    virtual Grid* loadGridData(IlwisObject*) { return 0;}
    /*!
     * \brief loadBinaryData loads bulk binary data into the ilwisobject.
     * \return true when succesfull. If not succesful the reason can be found in the issuelogger
     */
    virtual bool loadBinaryData(IlwisObject* ) { return false; }
    virtual bool storeBinaryData(IlwisObject* ) { return false; }

    virtual bool execute(const OperationExpression& , ExecutionContext *) { return false; }
    /*!
     * \brief isReadOnly returns if a connector can write to a source.
     *
     *This return is more of the physical possibility of writing data. There is also a readonly flag at ilwisobject level but describes usualy the logical readonly status (e.g. I dont want that this will be written)
     * \return
     */
    virtual bool isReadOnly() { return true; }

    /*!
     * \brief clone copies the connector for use with another object
     *
     *A connector is dedicated to one IlwisObject only. If one needs an identical connector for whatever reason one can clone it and reuse it
     * \return a new connector
     */
    virtual ConnectorInterface* clone() const { return 0; }
    /*!
     * \brief source returns the resource location were this connector is attached to
     * \return the url of the source
     */
    virtual QUrl source() const { return QUrl();}

};<commit_msg>source resturns the Resource instead of the Url<commit_after>#ifndef ICONNECTOR_H
#define ICONNECTOR_H

#include "Kernel_global.h"
#include <QExplicitlySharedDataPointer>

namespace Ilwis {

class IlwisObject;
class ConnectorFactory;
class Resource;
class Grid;
class OperationExpression;
class ExecutionContext;

/*!
 * \brief The ConnectorInterface class all connectors are derived from this interface
 *
 *The connector interface enumerates the methods that may be implemented by a derivative. It is unlikely that a derivative will implement all methods so a default implementation is provied.
 *Usualy the MetaData methods are implemented and depending on the nature of the source also one or more of the binary (Grid/table) ones is implemented.
 */
class KERNELSHARED_EXPORT ConnectorInterface {
public:
    virtual ~ConnectorInterface() {}
    /*!
     \brief loads the metadata and non binary information into the ilwisobject. After this method it should be a valid object

     \param data the ilwisobject to be initialized
     \return bool true when succesfull. If not succesful the reason can be found in the issuelogger
    */
    virtual bool loadMetaData(IlwisObject* ) { return false;}
    /*!
     * \brief storeMetaData stores the metadata and non binary information to the source of the connector
     * \return bool true when succesfull. If not succesful the reason can be found in the issuelogger
     */
    virtual bool storeMetaData(IlwisObject* )  { return false; }
    /*!
     * \brief loadGridData loads the 2D or 3D raster data from the source into memory
     *
     *Grid data can be of any size as the memory manager of Ilwis will swap any excess out to its disk cache.
     *Note that Ilwis doesnt make a difference between 2D and 3D griddata. If the local format has different storage methods for those they have to be resolved at connector level
     * \return returns the allocated grid
     */
    virtual Grid* loadGridData(IlwisObject*) { return 0;}
    /*!
     * \brief loadBinaryData loads bulk binary data into the ilwisobject.
     * \return true when succesfull. If not succesful the reason can be found in the issuelogger
     */
    virtual bool loadBinaryData(IlwisObject* ) { return false; }
    virtual bool storeBinaryData(IlwisObject* ) { return false; }

    virtual bool execute(const OperationExpression& , ExecutionContext *) { return false; }
    /*!
     * \brief isReadOnly returns if a connector can write to a source.
     *
     *This return is more of the physical possibility of writing data. There is also a readonly flag at ilwisobject level but describes usualy the logical readonly status (e.g. I dont want that this will be written)
     * \return
     */
    virtual bool isReadOnly() { return true; }

    /*!
     * \brief clone copies the connector for use with another object
     *
     *A connector is dedicated to one IlwisObject only. If one needs an identical connector for whatever reason one can clone it and reuse it
     * \return a new connector
     */
    virtual ConnectorInterface* clone() const { return 0; }
    /*!
     * \brief source returns the resource location were this connector is attached to
     * \return the url of the source
     */
    virtual Resource& source() = 0;

};
{'fraction_non_alphanumeric': 0.056049004594180704, 'fraction_numerical': 0.001990811638591118, 'mean_word_length': 3.354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '740293', 'n_tokens_mistral': 1694, 'n_tokens_neox': 1661, 'n_words': 835}