Code Monkey home page Code Monkey logo

hps's People

Contributors

alphaonex86 avatar jl2922 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hps's Issues

from_char_array bug?

I can deserialize int member of a structure from a char array, but not double member (equals to 0)

If I convert the char buffer to string and then use from_string, it works!

Bug for read

Hi,
I failed to debug my case:
1 __GI_raise raise.c 50 0x7f19d7c23ce1
2 __GI_abort abort.c 79 0x7f19d7c0d537
3 hps::StreamInputBuffer::load stream_input_buffer.h 82 0x56165194ebcd
4 hps::StreamInputBuffer::read stream_input_buffer.h 29 0x56165194e8f5
5 CatchChallenger::MapServer::parsehps::StreamInputBuffer MapServer.hpp 151 0x561651955195
6 hps::Serializer<CatchChallenger::MapServer, hps::StreamInputBuffer, void>::parse serializer.h 16 0x561651952a3b
7 hps::StreamInputBuffer::operator>>CatchChallenger::MapServer stream_input_buffer.h 47 0x561651950b1c
8 CatchChallenger::BaseServer::preload_the_data BaseServer.cpp 354 0x56165194bdd3
9 CatchChallenger::EpollServer::preload_the_data EpollServer.cpp 202 0x561651aabd9b
10 main main-epoll.cpp 729 0x561651ac3e94
Where oldpos: 524288, where file size is 589548
Linked source:
https://pastebin.com/k243ArLF
Cheers,

serialize a unordered_map<int, unordered_map<int, string> > to a file and deserialize it back.

hi, i have initialized a unordered_map<int, unordered_map<int, string> > and i have inserted values into it. now from the examples given i can write it to a file using 'to_stream()' like this...
std::ofstream out_file("data.log", std::ofstream::binary); //lets say data.log is the filename
hps::to_stream(data, out_file);
Now how can reconstruct the map from this file stream ????
I would be really great if you could help me with this one.
Thanks

How to access ancestor private/protected local variables ?

Hi again,
I'm searching how to implement class template Serializer for embed private/protected local variable from an ancestor class ?
If i have an abstract ancestor parent class of an other one who has private variables, i not find how to access these variable for serialize/parse.
Could you provide a little example of code for i can learn how to do that with hps please ?
(happy new year also)

object.h

From boost serialize example, i see it is possible to implement class objects (intrusive method) for archive private methods. So maybe there is a way in the same intrusive code methods with hps... but i actuallt failed by use friend class hps::Serializer then implement class inside other class...

Serialize struct with enum member.

hps::to_string() method fails to serialize a struct with enum class member as it complain no serialize method found inside enum class.

Is there a way to serialize/deserialize structs with enum fields ?

Source tag: 8d14036

error: no member named 'serialize'

We are trying to serialize a class with your great library but clang++ compiler outputs following error messages,

In file included from ./hps/src/hps.h:6:
In file included from ./hps/src/basic_type/basic_type.h:4:
In file included from ./hps/src/basic_type/float_serializer.h:6:
./hps/src/serializer.h:14:49: error: no member named 'serialize' in 'std::variant<std::vector<std::byte, std::allocator<std::byte> >, std::__cxx11::basic_string<char> >'
  static void serialize(const T& t, B& buf) { t.serialize(buf); }
                                              ~ ^
./hps/src/buffer/string_output_buffer.h:46:40: note: in instantiation of member function 'hps::Serializer<std::variant<std::vector<std::byte, std::allocator<std::byte> >, std::__cxx11::basic_string<char> >, hps::StringOutputBuffer, void>::serialize' requested here
    Serializer<T, StringOutputBuffer>::serialize(t, *this);
                                       ^

Here is the class,

class message
{
    public:
    
    std::string id;
    int status;
    std::variant<std::vector<std::byte>, std::string> body;

    template <class B>
    void serialize(B &buf) const
    {
        buf << id << status << body;
    }

    template <class B>
    void parse(B &buf)
    {
        buf >> id >> status >> body;
    }
};

Request for a more friendly license

Thanks for the hard work on building such a good library, but GPL3 makes it difficult to work with (in cases of me, I've been in a search for header only serialization libs in C++, for my own game engine specifically which I don't want to open source yet). Is it possible to provide another license such as Apache/BSD/ZLIB etc?

how to save data as textfile

I compile the example offered by this repo,and it runs right. But I found that the string/file is not readable, it is messy code, so I want to know if there is a way to as data in string/file readablely. thanks

language port

Do you know if there is a project which aim to port hps, with a common binary specification, to js, java, or other language?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.