Skip to content

Commit

Permalink
running clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-dixon committed Jan 26, 2024
1 parent 91529ce commit 49bcbf2
Show file tree
Hide file tree
Showing 32 changed files with 472 additions and 466 deletions.
20 changes: 11 additions & 9 deletions source/cache/memcache.hpp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#ifndef UDA_CACHE_MEMCACHE_H
#define UDA_CACHE_MEMCACHE_H

#include "udaStructs.h"
#include "genStructs.h"
#include "export.h"
#include "genStructs.h"
#include "udaStructs.h"

namespace uda {
namespace cache {
namespace uda
{
namespace cache
{

struct UdaCache;

Expand All @@ -15,15 +17,15 @@ UdaCache* open_cache();
void free_cache();

int cache_write(uda::cache::UdaCache* cache, const REQUEST_DATA* request_data, DATA_BLOCK* data_block,
LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist,
ENVIRONMENT environment, int protocolVersion, uint32_t flags,
LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source);
LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, ENVIRONMENT environment,
int protocolVersion, uint32_t flags, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags,
int malloc_source);

DATA_BLOCK* cache_read(uda::cache::UdaCache* cache, const REQUEST_DATA* request_data, LOGMALLOCLIST* logmalloclist,
USERDEFINEDTYPELIST* userdefinedtypelist, ENVIRONMENT environment, int protocolVersion,
uint32_t flags, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source);

}
}
} // namespace cache
} // namespace uda

#endif // UDA_CACHE_MEMCACHE_H
48 changes: 25 additions & 23 deletions source/client2/client.hpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
#pragma once

#ifndef UDA_SOURCE_CLIENT2_CLIENT_H
#define UDA_SOURCE_CLIENT2_CLIENT_H
# define UDA_SOURCE_CLIENT2_CLIENT_H

#include <exception>
#include <string_view>
#include <string>
#include <vector>
#include <rpc/rpc.h>
# include <exception>
# include <rpc/rpc.h>
# include <string>
# include <string_view>
# include <vector>

#include "udaStructs.h"
#include <cache/memcache.hpp>
# include "udaStructs.h"
# include <cache/memcache.hpp>

#include "connection.hpp"
#include "host_list.hpp"
#include "accAPI.h"
# include "accAPI.h"
# include "connection.hpp"
# include "host_list.hpp"

constexpr auto DefaultHost = "localhost";
constexpr auto DefaultPort = 56565;

namespace uda {
namespace client {
namespace uda
{
namespace client
{

constexpr int ClientVersion = 8;

Expand All @@ -34,7 +36,7 @@ struct MetadataBlock {

class Client
{
public:
public:
Client();

int get(std::string_view data_signal, std::string_view data_source);
Expand All @@ -49,8 +51,8 @@ class Client
DATA_BLOCK* current_data_block();
DATA_BLOCK* data_block(int handle);
int new_handle();
void set_flag(unsigned int flag, bool private_flag=false);
void reset_flag(unsigned int flag, bool private_flag=false);
void set_flag(unsigned int flag, bool private_flag = false);
void reset_flag(unsigned int flag, bool private_flag = false);
void set_property(const char* property);
int get_property(const char* property);
void reset_property(const char* property);
Expand All @@ -66,7 +68,7 @@ class Client
Client(const Client&) = delete;
Client& operator=(const Client&) = delete;

private:
private:
int get_requests(RequestBlock& request_block, int* indices);
void concat_errors(UDA_ERROR_STACK* error_stack);
const char* get_server_error_stack_record_msg(int record);
Expand All @@ -78,7 +80,7 @@ class Client
int alt_rank_ = 0;
ENVIRONMENT environment_ = {};
ClientFlags client_flags_ = {};
uint32_t private_flags_= 0;
uint32_t private_flags_ = 0;
ClientBlock client_block_ = {};
ServerBlock server_block_ = {};
std::vector<DataBlock> data_blocks_ = {};
Expand All @@ -94,8 +96,8 @@ class Client
bool reopen_logs_ = false;
std::string client_username_ = "client";
int protocol_version_ = ClientVersion;
USERDEFINEDTYPELIST* userdefinedtypelist_ = nullptr; // List of all known User Defined Structure Types
LOGMALLOCLIST* logmalloclist_ = nullptr; // List of all Heap Allocations for Data
USERDEFINEDTYPELIST* userdefinedtypelist_ = nullptr; // List of all known User Defined Structure Types
LOGMALLOCLIST* logmalloclist_ = nullptr; // List of all Heap Allocations for Data
NTREE* full_ntree_ = nullptr;
LOGSTRUCTLIST log_struct_list_ = {};
int malloc_source_ = UDA_MALLOC_SOURCE_NONE;
Expand All @@ -112,7 +114,7 @@ class Client
int fetch_hierarchical_data(DATA_BLOCK* data_block);
};

}
}
} // namespace client
} // namespace uda

#endif //UDA_SOURCE_CLIENT2_CLIENT_H
#endif // UDA_SOURCE_CLIENT2_CLIENT_H
16 changes: 9 additions & 7 deletions source/client2/client_environment.hpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#pragma once

#ifndef UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H
#define UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H
# define UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H

#include "udaStructs.h"
# include "udaStructs.h"

namespace uda {
namespace client {
namespace uda
{
namespace client
{

Environment load_environment(bool* env_host, bool* env_port);
void print_client_environment(const Environment& environment);

}
}
} // namespace client
} // namespace uda

#endif //UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H
#endif // UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H
18 changes: 10 additions & 8 deletions source/client2/client_xdr_stream.hpp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#pragma once

#ifndef UDA_CLIENT_CLIENTXDRSTREAM_H
#define UDA_CLIENT_CLIENTXDRSTREAM_H
# define UDA_CLIENT_CLIENTXDRSTREAM_H

#include <utility>
#include <rpc/rpc.h>
# include <rpc/rpc.h>
# include <utility>

#include "export.h"
#include "connection.hpp"
# include "connection.hpp"
# include "export.h"

namespace uda {
namespace client {
namespace uda
{
namespace client
{

std::pair<XDR*, XDR*> createXDRStream(IoData* io_data);

}
}
} // namespace uda

#endif // UDA_CLIENT_CLIENTXDRSTREAM_H
21 changes: 11 additions & 10 deletions source/client2/closedown.hpp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#pragma once

#ifndef UDA_CLIENT_CLOSEDOWN_H
#define UDA_CLIENT_CLOSEDOWN_H
# define UDA_CLIENT_CLOSEDOWN_H

#include <clientserver/socketStructs.h>
#include "export.h"
# include "export.h"
# include <clientserver/socketStructs.h>

namespace uda {
namespace client {
namespace uda
{
namespace client
{

enum class ClosedownType {
CLOSE_SOCKETS = 0,
Expand All @@ -16,11 +18,10 @@ enum class ClosedownType {

class Connection;

int
closedown(ClosedownType type, Connection* connection, XDR* client_input, XDR* client_output, bool* reopen_logs,
bool* env_host, bool* env_port);
int closedown(ClosedownType type, Connection* connection, XDR* client_input, XDR* client_output, bool* reopen_logs,
bool* env_host, bool* env_port);

}
}
} // namespace client
} // namespace uda

#endif // UDA_CLIENT_CLOSEDOWN_H
40 changes: 19 additions & 21 deletions source/client2/connection.hpp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
#pragma once

#ifndef UDA_CLIENT_CONNECTION_H
#define UDA_CLIENT_CONNECTION_H
# define UDA_CLIENT_CONNECTION_H

#include <vector>
# include <vector>

#include <clientserver/socketStructs.h>
#include "udaStructs.h"
#include "export.h"
# include "export.h"
# include "udaStructs.h"
# include <clientserver/socketStructs.h>

#include "closedown.hpp"
# include "closedown.hpp"

namespace uda {
namespace client {
namespace uda
{
namespace client
{

class HostList;

struct IoData {
int* client_socket;
};

class Connection {
public:
explicit Connection(Environment& environment)
: environment(environment)
, socket_list()
{}
class Connection
{
public:
explicit Connection(Environment& environment) : environment(environment), socket_list() {}
int open();
int reconnect(XDR** client_input, XDR** client_output, time_t* tv_server_start, int* user_timeout);
int create(XDR* client_input, XDR* client_output, const HostList& host_list);
void close_down(ClosedownType type);
IoData io_data() {
return IoData{ &client_socket };
}
IoData io_data() { return IoData{&client_socket}; }

private:
private:
int client_socket = -1;
Environment& environment;
std::vector<Sockets> socket_list; // List of open sockets
std::vector<Sockets> socket_list; // List of open sockets

int find_socket(int fh);
void close_socket(int fh);
Expand All @@ -46,7 +44,7 @@ class Connection {
int writeout(void* iohandle, char* buf, int count);
int readin(void* iohandle, char* buf, int count);

}
}
} // namespace client
} // namespace uda

#endif // UDA_CLIENT_CONNECTION_H
Loading

0 comments on commit 49bcbf2

Please sign in to comment.