Path: blob/master/src/hotspot/share/jfr/writers/jfrPosition.hpp
41149 views
/*1* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_JFR_WRITERS_JFRPOSITION_HPP25#define SHARE_JFR_WRITERS_JFRPOSITION_HPP2627#include "utilities/debug.hpp"28#include "utilities/globalDefinitions.hpp"2930template <typename AP> // AllocationPolicy31class Position : public AP {32private:33const u1* _start_pos; // logical start34u1* _current_pos;35const u1* _end_pos;3637protected:38const u1* start_pos() const;39void set_start_pos(const u1* position);40u1* current_pos();41void set_current_pos(const u1* new_position);42void set_current_pos(size_t size);43const u1* end_pos() const;44void set_end_pos(const u1* position);45Position(const u1* start_pos, size_t size);46Position();4748public:49size_t available_size() const;50int64_t used_offset() const;51int64_t current_offset() const;52size_t used_size() const;53void reset();54};5556#endif // SHARE_JFR_WRITERS_JFRPOSITION_HPP575859