mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-01-06 10:16:51 -05:00
删除文件 utils/ConfigBase/IConfigBase.h
This commit is contained in:
parent
bef62c3392
commit
7a9c8357ad
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Fancy Code.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef I_CONFIG_BASE_H
|
||||
#define I_CONFIG_BASE_H
|
||||
//Header file protection (preventing header files from being duplicated).
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
//Status Code. h (which may be a file that defines a status code enumeration or class to indicate the status of successful or failed operations) and<memory>(a part of the C++standard library that provides memory management features such as smart pointers).
|
||||
class IConfigBase// FHIR gBase interface
|
||||
{
|
||||
public:
|
||||
IConfigBase() = default;
|
||||
virtual ~IConfigBase() = default;
|
||||
virtual bool OpenConfigFile(void);
|
||||
virtual void CloseConfigFile(void);
|
||||
virtual StatusCode ConfigSaveFile(void);
|
||||
virtual StatusCode ConfigGetInt(const char *name, int *value);
|
||||
virtual StatusCode ConfigSetInt(const char *name, const int value);
|
||||
virtual StatusCode ConfigGetShort(const char *name, short *value);
|
||||
virtual StatusCode ConfigSetShort(const char *name, const short value);
|
||||
virtual StatusCode ConfigGetLong(const char *name, long *value);
|
||||
virtual StatusCode ConfigSetLong(const char *name, const long value);
|
||||
virtual StatusCode ConfigGetLLong(const char *name, long long *value);
|
||||
virtual StatusCode ConfigSetLLong(const char *name, const long long value);
|
||||
virtual StatusCode ConfigGetChar(const char *name, char *value);
|
||||
virtual StatusCode ConfigSetChar(const char *name, const char value);
|
||||
virtual StatusCode ConfigGetBool(const char *name, bool *value);
|
||||
virtual StatusCode ConfigSetBool(const char *name, const bool value);
|
||||
virtual StatusCode ConfigGetFloat(const char *name, float *value);
|
||||
virtual StatusCode ConfigSetFloat(const char *name, const float value);
|
||||
virtual StatusCode ConfigGetDouble(const char *name, double *value);
|
||||
virtual StatusCode ConfigSetDouble(const char *name, const double value);
|
||||
virtual StatusCode ConfigGetString(const char *name, const char **value);
|
||||
virtual StatusCode ConfigSetString(const char *name, const char *value);
|
||||
};
|
||||
//IKON Base is an abstract base class that defines interfaces related to configuration management. It includes default implementations of constructors and destructors (i.e. do not perform any operations), as well as a series of virtual functions for opening and closing configuration files, saving configurations, and obtaining and setting configuration values for various data types. The specific implementation of these virtual functions will be provided by derived classes.
|
||||
typedef struct i_config_base_header//Defined a struct i_config.base_header containing a pointer mCheckName to a character, which may be used for some form of validation or recognition.
|
||||
{
|
||||
const char *mCheckName;
|
||||
} IConfigBaseHeader;
|
||||
typedef struct config_base//Defined a struct config.base that contains a member mHeader of type iKON figBaseHeader and a smart pointer mIConfig Base pointing to iKON figBase. This structure may be used to store and manage configuration instances in applications.
|
||||
{
|
||||
IConfigBaseHeader mHeader;
|
||||
std::shared_ptr<IConfigBase> mIConfigBase;
|
||||
} ConfigBase;
|
||||
const char *GetConfigBaseModuleName(void);
|
||||
std::shared_ptr<IConfigBase> *NewConfigBase(const char *fileName);
|
||||
//Declared two functions: FHIR nfigBaseModulus Name (which may be used to obtain the name of a configuration module) and NewConfig Base (which takes a file name as a parameter and returns a pointer to the FHIR figBase smart pointer for creating and returning a new configuration instance).
|
||||
#endif
|
||||
//This code defines a C++interface and related data structures for configuration management, as well as function declarations related to it. It utilizes the abstract base classes, virtual functions, smart pointers, and other features of C++to achieve flexible configuration management functionality.
|
Loading…
Reference in New Issue
Block a user