hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
108
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
d49e38623b5d6e90c87c2688271bcf77c07f9954
557
cpp
C++
Userland/Libraries/LibC/sys/statvfs.cpp
r00ster91/serenity
f8387dea2689d564aff612bfd4ec5086393fac35
[ "BSD-2-Clause" ]
19,438
2019-05-20T15:11:11.000Z
2022-03-31T23:31:32.000Z
Userland/Libraries/LibC/sys/statvfs.cpp
r00ster91/serenity
f8387dea2689d564aff612bfd4ec5086393fac35
[ "BSD-2-Clause" ]
7,882
2019-05-20T01:03:52.000Z
2022-03-31T23:26:31.000Z
Userland/Libraries/LibC/sys/statvfs.cpp
r00ster91/serenity
f8387dea2689d564aff612bfd4ec5086393fac35
[ "BSD-2-Clause" ]
2,721
2019-05-23T00:44:57.000Z
2022-03-31T22:49:34.000Z
/* * Copyright (c) 2021, Justin Mietzner <sw1tchbl4d3@sw1tchbl4d3.com> * * SPDX-License-Identifier: BSD-2-Clause */ #include <errno.h> #include <string.h> #include <sys/statvfs.h> #include <syscall.h> extern "C" { int statvfs(const char* path, struct statvfs* buf) { Syscall::SC_statvfs_params params { { path, strlen(path) }, buf }; int rc = syscall(SC_statvfs, &params); __RETURN_WITH_ERRNO(rc, rc, -1); } int fstatvfs(int fd, struct statvfs* buf) { int rc = syscall(SC_fstatvfs, fd, buf); __RETURN_WITH_ERRNO(rc, rc, -1); } }
20.62963
70
0.669659
r00ster91
d49fd5316b7717073e4885c3b434b6ccb590196c
11,669
hpp
C++
control/zone.hpp
msbarth/phosphor-fan-presence
9f5330e691ae2baa4c26fff8c828dcfcb04d5be8
[ "Apache-2.0" ]
null
null
null
control/zone.hpp
msbarth/phosphor-fan-presence
9f5330e691ae2baa4c26fff8c828dcfcb04d5be8
[ "Apache-2.0" ]
null
null
null
control/zone.hpp
msbarth/phosphor-fan-presence
9f5330e691ae2baa4c26fff8c828dcfcb04d5be8
[ "Apache-2.0" ]
1
2017-02-14T01:46:05.000Z
2017-02-14T01:46:05.000Z
#pragma once #include <chrono> #include <vector> #include <algorithm> #include <sdbusplus/bus.hpp> #include "fan.hpp" #include "types.hpp" #include "timer.hpp" namespace phosphor { namespace fan { namespace control { /** * The mode fan control will run in: * - init - only do the initialization steps * - control - run normal control algorithms */ enum class Mode { init, control }; /** * @class Represents a fan control zone, which is a group of fans * that behave the same. */ class Zone { public: Zone() = delete; Zone(const Zone&) = delete; Zone(Zone&&) = default; Zone& operator=(const Zone&) = delete; Zone& operator=(Zone&&) = delete; ~Zone() = default; /** * Constructor * Creates the appropriate fan objects based on * the zone definition data passed in. * * @param[in] mode - mode of fan control * @param[in] bus - the dbus object * @param[in] events - sd_event pointer * @param[in] def - the fan zone definition data */ Zone(Mode mode, sdbusplus::bus::bus& bus, phosphor::fan::event::EventPtr& events, const ZoneDefinition& def); /** * Sets all fans in the zone to the speed * passed in when the zone is active * * @param[in] speed - the fan speed */ void setSpeed(uint64_t speed); /** * Sets the zone to full speed regardless of zone's active state */ void setFullSpeed(); /** * @brief Sets the automatic fan control allowed active state * * @param[in] group - A group that affects the active state * @param[in] isActiveAllow - Active state according to group */ void setActiveAllow(const Group* group, bool isActiveAllow); /** * @brief Sets a given object's property value * * @param[in] object - Name of the object containing the property * @param[in] interface - Interface name containing the property * @param[in] property - Property name * @param[in] value - Property value */ template <typename T> void setPropertyValue(const char* object, const char* interface, const char* property, T value) { _properties[object][interface][property] = value; }; /** * @brief Get the value of an object's property * * @param[in] object - Name of the object containing the property * @param[in] interface - Interface name containing the property * @param[in] property - Property name * * @return - The property value */ template <typename T> inline auto getPropertyValue(const std::string& object, const std::string& interface, const std::string& property) { return sdbusplus::message::variant_ns::get<T>( _properties.at(object).at(interface).at(property)); }; /** * @brief Get the object's property variant * * @param[in] object - Name of the object containing the property * @param[in] interface - Interface name containing the property * @param[in] property - Property name * * @return - The property variant */ inline auto getPropValueVariant(const std::string& object, const std::string& interface, const std::string& property) { return _properties.at(object).at(interface).at(property); }; /** * @brief Initialize a set speed event properties and actions * * @param[in] event - Set speed event */ void initEvent(const SetSpeedEvent& event); /** * @brief Removes all the set speed event properties and actions * * @param[in] event - Set speed event */ void removeEvent(const SetSpeedEvent& event); /** * @brief Get the default floor speed * * @return - The defined default floor speed */ inline auto getDefFloor() { return _defFloorSpeed; }; /** * @brief Get the ceiling speed * * @return - The current ceiling speed */ inline auto& getCeiling() const { return _ceilingSpeed; }; /** * @brief Set the ceiling speed to the given speed * * @param[in] speed - Speed to set the ceiling to */ inline void setCeiling(uint64_t speed) { _ceilingSpeed = speed; }; /** * @brief Swaps the ceiling key value with what's given and * returns the value that was swapped. * * @param[in] keyValue - New ceiling key value * * @return - Ceiling key value prior to swapping */ inline auto swapCeilingKeyValue(int64_t keyValue) { std::swap(_ceilingKeyValue, keyValue); return keyValue; }; /** * @brief Get the increase speed delta * * @return - The current increase speed delta */ inline auto getIncSpeedDelta() const { return _incSpeedDelta; }; /** * @brief Get the decrease speed delta * * @return - The current decrease speed delta */ inline auto getDecSpeedDelta() const { return _decSpeedDelta; }; /** * @brief Set the floor speed to the given speed and increase target * speed to the floor when target is below floor. * * @param[in] speed - Speed to set the floor to */ void setFloor(uint64_t speed); /** * @brief Calculate the requested target speed from the given delta * and increase the fan speeds, not going above the ceiling. * * @param[in] targetDelta - The delta to increase the target speed by */ void requestSpeedIncrease(uint64_t targetDelta); /** * @brief Calculate the requested target speed from the given delta * and increase the fan speeds, not going above the ceiling. * * @param[in] targetDelta - The delta to increase the target speed by */ void requestSpeedDecrease(uint64_t targetDelta); /** * @brief Callback function for the increase timer that delays * processing of requested speed increases while fans are increasing */ void incTimerExpired(); /** * @brief Callback function for the decrease timer that processes any * requested speed decreases if allowed */ void decTimerExpired(); /** * @brief Callback function for event timers that processes the given * action for a group * * @param[in] eventGroup - Group to process action on * @param[in] eventAction - Event action to run */ void timerExpired(Group eventGroup, std::vector<Action> eventActions); private: /** * The dbus object */ sdbusplus::bus::bus& _bus; /** * Full speed for the zone */ const uint64_t _fullSpeed; /** * The zone number */ const size_t _zoneNum; /** * The default floor speed for the zone */ const uint64_t _defFloorSpeed; /** * The default ceiling speed for the zone */ const uint64_t _defCeilingSpeed; /** * The floor speed to not go below */ uint64_t _floorSpeed = _defFloorSpeed; /** * The ceiling speed to not go above */ uint64_t _ceilingSpeed = _defCeilingSpeed; /** * The previous sensor value for calculating the ceiling */ int64_t _ceilingKeyValue = 0; /** * Automatic fan control active state */ bool _isActive = true; /** * Target speed for this zone */ uint64_t _targetSpeed = _fullSpeed; /** * Speed increase delta */ uint64_t _incSpeedDelta = 0; /** * Speed decrease delta */ uint64_t _decSpeedDelta = 0; /** * Speed increase delay in seconds */ std::chrono::seconds _incDelay; /** * Speed decrease interval in seconds */ std::chrono::seconds _decInterval; /** * The increase timer object */ phosphor::fan::util::Timer _incTimer; /** * The decrease timer object */ phosphor::fan::util::Timer _decTimer; /** * Dbus event used on set speed event timers */ phosphor::fan::event::EventPtr& _sdEvents; /** * The vector of fans in this zone */ std::vector<std::unique_ptr<Fan>> _fans; /** * @brief Map of object property values */ std::map<std::string, std::map<std::string, std::map<std::string, PropertyVariantType>>> _properties; /** * @brief Map of active fan control allowed by groups */ std::map<const Group, bool> _active; /** * @brief List of signal event arguments and Dbus matches for callbacks */ std::vector<SignalEvent> _signalEvents; /** * @brief List of timers for events */ std::vector<std::unique_ptr<phosphor::fan::util::Timer>> _timerEvents; /** * @brief Refresh the given property's cached value * * @param[in] bus - the bus to use * @param[in] path - the dbus path name * @param[in] iface - the dbus interface name * @param[in] prop - the property name */ void refreshProperty(sdbusplus::bus::bus& bus, const std::string& path, const std::string& iface, const std::string& prop); /** * @brief Get a property value from the path/interface given * * @param[in] bus - the bus to use * @param[in] path - the dbus path name * @param[in] iface - the dbus interface name * @param[in] prop - the property name * @param[out] value - the value of the property */ static void getProperty(sdbusplus::bus::bus& bus, const std::string& path, const std::string& iface, const std::string& prop, PropertyVariantType& value); /** * @brief Dbus signal change callback handler * * @param[in] msg - Expanded sdbusplus message data * @param[in] eventData - The single event's data */ void handleEvent(sdbusplus::message::message& msg, const EventData* eventData); }; } } }
28.530562
79
0.520439
msbarth
d4a03f8b56c7310ef0478d07df24158f6987d9f2
1,566
cpp
C++
src/Generic/edt/FullEntitySetCache.cpp
BBN-E/serif
1e2662d82fb1c377ec3c79355a5a9b0644606cb4
[ "Apache-2.0" ]
1
2022-03-24T19:57:00.000Z
2022-03-24T19:57:00.000Z
src/Generic/edt/FullEntitySetCache.cpp
BBN-E/serif
1e2662d82fb1c377ec3c79355a5a9b0644606cb4
[ "Apache-2.0" ]
null
null
null
src/Generic/edt/FullEntitySetCache.cpp
BBN-E/serif
1e2662d82fb1c377ec3c79355a5a9b0644606cb4
[ "Apache-2.0" ]
null
null
null
// Copyright 2008 by BBN Technologies Corp. // All Rights Reserved. #include "common/leak_detection.h" #include "edt/FullEntitySetCache.h" FullEntitySetCache::FullEntitySetCache(int cache_size) { _keys = _new EntitySetUID[cache_size]; _values = _new LexEntitySet*[cache_size]; _capacity = cache_size; _nValues = 0; } FullEntitySetCache::~FullEntitySetCache() { cleanup(); delete [] _keys; delete [] _values; } void FullEntitySetCache::loadPair(EntitySet *key, LexEntitySet *value) { setCapacity(_nValues+1); _values[_nValues] = value; _keys[_nValues] = (EntitySetUID) key; _nValues++; } LexEntitySet *FullEntitySetCache::retrieveData(const EntitySet *entitySet) { EntitySetUID uid = (EntitySetUID) entitySet; int i; LexEntitySet *found = NULL; for(i=0; i<_nValues; i++) { if(_keys[i] == uid) { found = _values[i]; _values[i] = NULL; break; } } // cleanup(); return found; } void FullEntitySetCache::setCapacity(int capacity) { if(capacity > _capacity) { int new_capacity = capacity*2; EntitySetUID *newKeys = _new EntitySetUID[new_capacity]; LexEntitySet **newValues = _new LexEntitySet*[new_capacity]; int i; for(i=0; i<_nValues; i++) { newKeys[i] = _keys[i]; newValues[i] = _values[i]; } delete [] _keys; delete [] _values; _keys = newKeys; _values = newValues; _capacity = new_capacity; } } void FullEntitySetCache::cleanup() { int i; for(i=0; i<_nValues; i++) { delete _values[i]; _keys[i] = 0; } _nValues = 0; }
22.056338
77
0.661558
BBN-E
d4a2bf5b3dfe99be6e11e4a728259477089dfd40
509
cpp
C++
image_projection/src/periodic_image_projection_node.cpp
dudasdavid/image_projection
53ec2dace3f2e3474fef7e6d5571b1f7bb289040
[ "MIT" ]
91
2021-02-24T11:47:02.000Z
2022-03-25T14:18:51.000Z
image_projection/src/periodic_image_projection_node.cpp
dudasdavid/image_projection
53ec2dace3f2e3474fef7e6d5571b1f7bb289040
[ "MIT" ]
8
2021-04-03T14:29:58.000Z
2022-03-24T10:07:13.000Z
image_projection/src/periodic_image_projection_node.cpp
dudasdavid/image_projection
53ec2dace3f2e3474fef7e6d5571b1f7bb289040
[ "MIT" ]
19
2021-02-24T14:59:07.000Z
2022-03-19T20:06:05.000Z
#include <nodelet/loader.h> #include <ros/ros.h> int main(int argc, char** argv) { ros::init(argc, argv, "periodic_image_projection_node"); nodelet::Loader nodelet; const nodelet::M_string& remap(ros::names::getRemappings()); nodelet::V_string nargv; const std::string& nodelet_name = ros::this_node::getName(); ROS_INFO_STREAM("Started " << nodelet_name << " nodelet."); nodelet.load(nodelet_name, "image_projection/PeriodicImageProjectionNodelet", remap, nargv); ros::spin(); return 0; }
33.933333
94
0.721022
dudasdavid
d4a3962642aa1fe238a3adba316f0ea1a6b559cd
1,513
cpp
C++
SPOJ/SPOJ Easy Longest Increasing Subsequence.cpp
akash246/Competitive-Programming-Solutions
68db69ba8a771a433e5338bc4e837a02d3f89823
[ "MIT" ]
28
2017-11-08T11:52:11.000Z
2021-07-16T06:30:02.000Z
SPOJ/SPOJ Easy Longest Increasing Subsequence.cpp
akash246/Competitive-Programming-Solutions
68db69ba8a771a433e5338bc4e837a02d3f89823
[ "MIT" ]
null
null
null
SPOJ/SPOJ Easy Longest Increasing Subsequence.cpp
akash246/Competitive-Programming-Solutions
68db69ba8a771a433e5338bc4e837a02d3f89823
[ "MIT" ]
30
2017-09-01T09:14:27.000Z
2021-04-12T12:08:56.000Z
//#Name: Sofen Hoque Anonta #Problm: #include <bits/stdc++.h> using namespace std; //FOLD ME namespace{ typedef long long LL; typedef vector<int> vint; typedef pair<int,int> pint; typedef unsigned long long ULL; //Macros int CC_; #define sf scanf #define pf printf #define PP cin.get(); #define NL cout<<endl; #define all(container) container.begin(),container.end() #define DC(x_) cout<<">>> "<<#x_<<"\n";DA(x_.begin(), x_.end()); #define DD(x_) cout<<">>>>( "<<++CC_<<" ) "<<#x_<<": "<<x_<<endl; #define SS printf(">_<LOOOOOK@MEEEEEEEEEEEEEEE<<( %d )>>\n",++CC_); #define EXT(st_) cout<<"\n>>>Exicution Time: "<<(double)(clock()-st_)/CLOCKS_PER_SEC<<endl; #define DM(MT,n_,m_)pf("Matrix %s:\n ", #MT);for(int i_= 0;i_<m_;i_++)pf("%4d ", i_);NL;NL;for(int r_=0;r_<n_;r_++){pf("%2d ", r_);for(int c_= 0;c_<m_;c_++)pf("%4d ", MT[r_][c_]);NL} #define mem(a_,b_)(a_, b_, sizeof(a_)); //constants const double EPS= 1E-9; const double PI= 2*acos(0.0); const long long MOD= 1000000007; } const int sss= 1E6; int a[21]; int N; int MX= 0; int lis(int x, int s, int prev){ if(x < 0) return s; int p= lis(x-1, s, prev); int q= 0; if(a[x] < prev) q= lis(x-1, s+1, a[x]); return max(p,q); } void solve(void){ int n; cin>>n; N= n; for(int i=0; i<n; i++)cin>>a[i]; cout<< lis(n-1, 0, INT_MAX) <<endl; } int main(void){ ios_base::sync_with_stdio(false); cin.tie(NULL); // freopen("D:/input.txt", "r", stdin); solve(); return 0; }
21.927536
184
0.582287
akash246
d4a4fa156c78981431c0bb01c00857633b2b5d12
5,718
cpp
C++
python/openvds/PyVolumeDataAxisDescriptor.cpp
wadesalazar/open-vds2
71b6a49f39f79c913b1a560be1869c8bd391de19
[ "Apache-2.0" ]
null
null
null
python/openvds/PyVolumeDataAxisDescriptor.cpp
wadesalazar/open-vds2
71b6a49f39f79c913b1a560be1869c8bd391de19
[ "Apache-2.0" ]
null
null
null
python/openvds/PyVolumeDataAxisDescriptor.cpp
wadesalazar/open-vds2
71b6a49f39f79c913b1a560be1869c8bd391de19
[ "Apache-2.0" ]
null
null
null
/**************************************************************************** ** Copyright 2019 The Open Group ** Copyright 2019 Bluware, Inc. ** ** 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. ****************************************************************************/ #include "PyVolumeDataAxisDescriptor.h" using namespace native; void PyVolumeDataAxisDescriptor::initModule(py::module& m) { //AUTOGEN-BEGIN // VolumeDataAxisDescriptor py::class_<VolumeDataAxisDescriptor> VolumeDataAxisDescriptor_(m,"VolumeDataAxisDescriptor", OPENVDS_DOCSTRING(VolumeDataAxisDescriptor)); VolumeDataAxisDescriptor_.def(py::init< >(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_VolumeDataAxisDescriptor)); VolumeDataAxisDescriptor_.def("getNumSamples" , static_cast<int(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetNumSamples), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetNumSamples)); VolumeDataAxisDescriptor_.def_property_readonly("numSamples", &VolumeDataAxisDescriptor::GetNumSamples, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetNumSamples)); VolumeDataAxisDescriptor_.def("getName" , static_cast<const char *(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetName), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetName)); VolumeDataAxisDescriptor_.def_property_readonly("name", &VolumeDataAxisDescriptor::GetName, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetName)); VolumeDataAxisDescriptor_.def("getUnit" , static_cast<const char *(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetUnit), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetUnit)); VolumeDataAxisDescriptor_.def_property_readonly("unit", &VolumeDataAxisDescriptor::GetUnit, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetUnit)); VolumeDataAxisDescriptor_.def("getCoordinateMin" , static_cast<float(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetCoordinateMin), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMin)); VolumeDataAxisDescriptor_.def_property_readonly("coordinateMin", &VolumeDataAxisDescriptor::GetCoordinateMin, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMin)); VolumeDataAxisDescriptor_.def("getCoordinateMax" , static_cast<float(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetCoordinateMax), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMax)); VolumeDataAxisDescriptor_.def_property_readonly("coordinateMax", &VolumeDataAxisDescriptor::GetCoordinateMax, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateMax)); VolumeDataAxisDescriptor_.def("getCoordinateStep" , static_cast<float(VolumeDataAxisDescriptor::*)() const>(&VolumeDataAxisDescriptor::GetCoordinateStep), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateStep)); VolumeDataAxisDescriptor_.def_property_readonly("coordinateStep", &VolumeDataAxisDescriptor::GetCoordinateStep, OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_GetCoordinateStep)); VolumeDataAxisDescriptor_.def("sampleIndexToCoordinate" , static_cast<float(VolumeDataAxisDescriptor::*)(int)>(&VolumeDataAxisDescriptor::SampleIndexToCoordinate), py::arg("sampleIndex").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_SampleIndexToCoordinate)); VolumeDataAxisDescriptor_.def("coordinateToSampleIndex" , static_cast<int(VolumeDataAxisDescriptor::*)(float)>(&VolumeDataAxisDescriptor::CoordinateToSampleIndex), py::arg("coordinate").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_CoordinateToSampleIndex)); VolumeDataAxisDescriptor_.def("coordinateToSamplePosition" , static_cast<float(VolumeDataAxisDescriptor::*)(float)>(&VolumeDataAxisDescriptor::CoordinateToSamplePosition), py::arg("coordinate").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_CoordinateToSamplePosition)); //AUTOGEN-END // IMPLEMENTED : VolumeDataAxisDescriptor_.def(py::init<int, const char *, const char *, float, float>(), py::arg("numSamples").none(false), py::arg("name").none(false), py::arg("unit").none(false), py::arg("coordinateMin").none(false), py::arg("coordinateMax").none(false), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_VolumeDataAxisDescriptor_2)); VolumeDataAxisDescriptor_.def(py::init([](int numSamples, std::string name, std::string unit, float coordinateMin, float coordinateMax) { return VolumeDataAxisDescriptor(numSamples, PyDescriptorStringContainer::Add(name), PyDescriptorStringContainer::Add(unit), coordinateMin, coordinateMax); }), py::arg("numSamples").none(false), py::arg("name").none(false), py::arg("unit").none(false), py::arg("coordinateMin").none(false), py::arg("coordinateMax").none(false), OPENVDS_DOCSTRING(VolumeDataAxisDescriptor_VolumeDataAxisDescriptor_2)); }
105.888889
349
0.779818
wadesalazar
d4a83cfa625f7e61eef55accc24ee6baeececf93
3,868
hxx
C++
src/cgi/Parser.hxx
CM4all/beng-proxy
ce5a81f7969bc5cb6c5985cdc98f61ef8b5c6159
[ "BSD-2-Clause" ]
35
2017-08-16T06:52:26.000Z
2022-03-27T21:49:01.000Z
src/cgi/Parser.hxx
nn6n/beng-proxy
2cf351da656de6fbace3048ee90a8a6a72f6165c
[ "BSD-2-Clause" ]
2
2017-12-22T15:34:23.000Z
2022-03-08T04:15:23.000Z
src/cgi/Parser.hxx
nn6n/beng-proxy
2cf351da656de6fbace3048ee90a8a6a72f6165c
[ "BSD-2-Clause" ]
8
2017-12-22T15:11:47.000Z
2022-03-15T22:54:04.000Z
/* * Copyright 2007-2021 CM4all GmbH * All rights reserved. * * author: Max Kellermann <mk@cm4all.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "strmap.hxx" #include "Completion.hxx" #include "http/Status.h" #include <assert.h> #include <stddef.h> #include <sys/types.h> #include <stdint.h> struct pool; template<typename T> class ForeignFifoBuffer; /** * A parser for the CGI response. * * - initialize with cgi_parser_init() * * - pass data received from the CGI program to * cgi_parser_feed_headers(), repeat with more data until it returns * C_ERROR or C_DONE * * - after C_DONE, call cgi_parser_get_headers() * * - use cgi_parser_available() and cgi_parser_consumed() while * transferring the response body */ struct CGIParser { http_status_t status = HTTP_STATUS_OK; /** * The remaining number of bytes in the response body, -1 if * unknown. */ off_t remaining = -1; StringMap headers; bool finished = false; /** * Did the parser finish reading the response headers? */ bool AreHeadersFinished() const { return finished; } /** * Run the CGI response header parser with data from the specified * buffer. * * Throws exception on error. * * @param buffer a buffer containing data received from the CGI * program; consumed data will automatically be removed * @return DONE when the headers are finished (the remaining * buffer contains the response body); PARTIAL or NONE when more * header data is expected */ Completion FeedHeaders(struct pool &pool, ForeignFifoBuffer<uint8_t> &buffer); http_status_t GetStatus() const { assert(finished); return status; } StringMap GetHeaders() && noexcept { assert(finished); return std::move(headers); } bool KnownLength() const { return remaining >= 0; } off_t GetAvailable() const { return remaining; } bool DoesRequireMore() const { return remaining > 0; } bool IsTooMuch(size_t length) const { return remaining != -1 && (off_t)length > remaining; } /** * The caller has consumed data from the response body. * * @return true if the response body is finished */ bool BodyConsumed(size_t nbytes) { assert(nbytes > 0); if (remaining < 0) return false; assert((off_t)nbytes <= remaining); remaining -= nbytes; return remaining == 0; } bool IsEOF() const { return remaining == 0; } private: /** * Evaluate the response headers after the headers have been finalized * by an empty line. * * Throws exception on error. */ Completion Finish(ForeignFifoBuffer<uint8_t> &buffer); };
25.116883
71
0.719235
CM4all
d4ac17c9e7fc0c91a40fff2d3328d669baa8a7f1
3,222
cpp
C++
src/main.cpp
ThorNielsen/loxint
a5456afad37f22973e2b1292aff0276ac2c6fcdd
[ "MIT" ]
7
2018-03-09T10:10:39.000Z
2021-12-23T07:19:39.000Z
src/main.cpp
ThorNielsen/loxint
a5456afad37f22973e2b1292aff0276ac2c6fcdd
[ "MIT" ]
1
2021-12-23T07:19:29.000Z
2021-12-23T07:19:29.000Z
src/main.cpp
ThorNielsen/loxint
a5456afad37f22973e2b1292aff0276ac2c6fcdd
[ "MIT" ]
1
2019-06-09T21:00:46.000Z
2019-06-09T21:00:46.000Z
#include <iostream> #include <fstream> #include <string> #include <stdexcept> #include "lexer.hpp" #include "resolver.hpp" #include "astprinter.hpp" #include "parser.hpp" #include "interpreter.hpp" int run(Interpreter& interpreter, std::string source, bool repl = false) { try { Parser p; Lexer lex; auto stmts = p.parse(lex.scanTokens(source), repl); if (p.hadError()) { if (p.continuable()) { return 1; } return 2; } /*ASTPrinter printer; for (auto& stmt : stmts) { printer.print(stmt.get()); }*/ Resolver r; if (!r.resolve(stmts, interpreter)) { return 4; } interpreter.interpret(std::move(stmts)); return 0; } catch (LoxError err) { if (repl) return 3; throw; } } bool isspace(std::string s) { for (auto& c : s) { switch(c) { case '\n': case '\r': case '\t': case ' ': break; default: return false; } } return true; } void runPrompt() { Interpreter interpreter; std::string prevCode = ""; while (std::cin.good()) { if (!isspace(prevCode)) std::cout << ". "; else std::cout << "> "; std::string line; std::getline(std::cin, line, '\n'); // If the user wants to stop appending code to previous code, they enter // a blank line (one consisting entirely of whitespace) in which case we // want to show them all errors in the previous code. if (isspace(line) && !isspace(prevCode)) { run(interpreter, prevCode, false); prevCode = ""; continue; } if (run(interpreter, prevCode+line, true) == 1) { prevCode += (prevCode.empty() ? "" : "\n") + line; } else { prevCode = ""; } } } bool runFile(std::string path) { std::ifstream in(path); if (!in.is_open()) { throw std::runtime_error("Couldn't open " + path); } std::string code; auto start = in.tellg(); in.seekg(std::ios::beg, std::ios::end); auto end = in.tellg(); in.seekg(std::ios::beg, std::ios::beg); code.resize(end - start); in.read(&code[0], end - start); Interpreter interpreter; return run(interpreter, code) == 0; } int main(int argc, char* argv[]) { if (argc > 2) { std::string execName = argv[0]; auto loc = execName.rfind('/'); if (loc == std::string::npos) { loc = execName.rfind('\\'); if (loc == std::string::npos) { loc = 0; } else { ++loc; } } else { ++loc; } std::cout << "Usage: " + execName.substr(loc) + " [file]" << std::endl; return 1; } else if (argc == 2) { return runFile(argv[1]) ? 0 : 'm'^'a'^'g'^'i'^'c'; } else { runPrompt(); return 0; } }
21.337748
80
0.463377
ThorNielsen
d4ac3de56e77ad26702e06f13ace16b23188a1d7
3,806
cpp
C++
Classes/AppDelegate.cpp
kystudio/LostRoutes
c4636b9ab59a89b76fc7a6cac63ee4c9859e9840
[ "MIT" ]
null
null
null
Classes/AppDelegate.cpp
kystudio/LostRoutes
c4636b9ab59a89b76fc7a6cac63ee4c9859e9840
[ "MIT" ]
null
null
null
Classes/AppDelegate.cpp
kystudio/LostRoutes
c4636b9ab59a89b76fc7a6cac63ee4c9859e9840
[ "MIT" ]
null
null
null
#include "AppDelegate.h" #include "HelloWorldScene.h" // #define USE_AUDIO_ENGINE 1 // #define USE_SIMPLE_AUDIO_ENGINE 1 #if USE_AUDIO_ENGINE && USE_SIMPLE_AUDIO_ENGINE #error "Don't use AudioEngine and SimpleAudioEngine at the same time. Please just select one in your game!" #endif #if USE_AUDIO_ENGINE #include "audio/include/AudioEngine.h" using namespace cocos2d::experimental; #elif USE_SIMPLE_AUDIO_ENGINE #include "audio/include/SimpleAudioEngine.h" using namespace CocosDenshion; #endif USING_NS_CC; static cocos2d::Size designResolutionSize = cocos2d::Size(320, 480); static cocos2d::Size smallResolutionSize = cocos2d::Size(320, 480); static cocos2d::Size mediumResolutionSize = cocos2d::Size(640, 960); static cocos2d::Size largeResolutionSize = cocos2d::Size(1536, 2048); AppDelegate::AppDelegate() { } AppDelegate::~AppDelegate() { #if USE_AUDIO_ENGINE AudioEngine::end(); #elif USE_SIMPLE_AUDIO_ENGINE SimpleAudioEngine::end(); #endif } // if you want a different context, modify the value of glContextAttrs // it will affect all platforms void AppDelegate::initGLContextAttrs() { // set OpenGL context attributes: red,green,blue,alpha,depth,stencil GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; GLView::setGLContextAttrs(glContextAttrs); } // if you want to use the package manager to install more packages, // don't modify or remove this function static int register_all_packages() { return 0; //flag for packages manager } bool AppDelegate::applicationDidFinishLaunching() { // initialize director auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if (!glview) { glview = GLViewImpl::create("My Game"); glview->setFrameSize(320, 480); director->setOpenGLView(glview); } // turn on display FPS director->setDisplayStats(false); // set FPS. the default value is 1.0/60 if you don't call this director->setAnimationInterval(1.0 / 60); //屏幕大小 auto screenSize = glview->getFrameSize(); //设计分辨率大小 auto designSize = Size(320, 480); //资源大小 auto resourceSize = Size(640, 960); //std::vector<std::string> searchPaths; director->setContentScaleFactor(resourceSize.width / designSize.width); //默认为1.0f //#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) // if (screenSize.height > 960) { //640x1136 // designSize = Size(320, 568); // searchPaths.push_back("hd"); // } // else { // searchPaths.push_back("hd"); // } // FileUtils::getInstance()->setSearchPaths(searchPaths); //#else // FileUtils::getInstance()->addSearchPath(FileUtils::getInstance()->getWritablePath()); // std::vector<std::string> searchpath; // searchpath.push_back(FileUtils::getInstance()->getWritablePath() + "hd"); // FileUtils::getInstance()->setSearchPaths(searchpath); //#endif glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::FIXED_WIDTH); // create a scene. it's an autorelease object auto scene = HelloWorld::createScene(); // run director->runWithScene(scene); return true; } // This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. void AppDelegate::applicationDidEnterBackground() { Director::getInstance()->stopAnimation(); #if USE_AUDIO_ENGINE AudioEngine::pauseAll(); #elif USE_SIMPLE_AUDIO_ENGINE SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); SimpleAudioEngine::getInstance()->pauseAllEffects(); #endif } // this function will be called when the app is active again void AppDelegate::applicationWillEnterForeground() { Director::getInstance()->startAnimation(); #if USE_AUDIO_ENGINE AudioEngine::resumeAll(); #elif USE_SIMPLE_AUDIO_ENGINE SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); SimpleAudioEngine::getInstance()->resumeAllEffects(); #endif }
28.402985
107
0.746978
kystudio
d4ad52af38f5bf079191e7d8d577356eae096a1a
6,267
cc
C++
chrome/browser/ui/task_manager/task_manager_columns.cc
google-ar/chromium
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
777
2017-08-29T15:15:32.000Z
2022-03-21T05:29:41.000Z
chrome/browser/ui/task_manager/task_manager_columns.cc
harrymarkovskiy/WebARonARCore
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
66
2017-08-30T18:31:18.000Z
2021-08-02T10:59:35.000Z
chrome/browser/ui/task_manager/task_manager_columns.cc
harrymarkovskiy/WebARonARCore
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
123
2017-08-30T01:19:34.000Z
2022-03-17T22:55:31.000Z
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/task_manager/task_manager_columns.h" #include "base/logging.h" #include "base/macros.h" #include "build/build_config.h" #include "chrome/grit/generated_resources.h" namespace task_manager { namespace { // On Mac: Width of "a" and most other letters/digits in "small" table views. const int kCharWidth = 6; } // namespace // IMPORTANT: Do NOT change the below list without changing the COLUMN_LIST // macro below. const TableColumnData kColumns[] = { { IDS_TASK_MANAGER_TASK_COLUMN, ui::TableColumn::LEFT, -1, 1, 120, 600, true, true, true }, { IDS_TASK_MANAGER_PROFILE_NAME_COLUMN, ui::TableColumn::LEFT, -1, 0, 60, 200, true, true, false }, { IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("800 MiB") * kCharWidth, -1, true, false, true }, { IDS_TASK_MANAGER_SHARED_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("800 MiB") * kCharWidth, -1, true, false, false }, { IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("800 MiB") * kCharWidth, -1, true, false, false }, #if defined(OS_CHROMEOS) { IDS_TASK_MANAGER_SWAPPED_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("800 MiB") * kCharWidth, -1, true, false, false }, #endif { IDS_TASK_MANAGER_CPU_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("99.9") * kCharWidth, -1, true, false, true }, #if defined(OS_WIN) { IDS_TASK_MANAGER_CPU_TIME_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("1234h 42m 30s") * kCharWidth, -1, true, false, false }, { IDS_TASK_MANAGER_START_TIME_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("12/13/14 11:44:30 PM") * kCharWidth, -1, true, true, false }, #endif { IDS_TASK_MANAGER_NET_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("150 kiB/s") * kCharWidth, -1, true, false, true }, { IDS_TASK_MANAGER_PROCESS_ID_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("73099 ") * kCharWidth, -1, true, true, true }, #if defined(OS_WIN) { IDS_TASK_MANAGER_GDI_HANDLES_COLUMN, ui::TableColumn::RIGHT, -1, 0, 0, 0, true, false, false }, { IDS_TASK_MANAGER_USER_HANDLES_COLUMN, ui::TableColumn::RIGHT, -1, 0, 0, 0, true, false, false }, #endif { IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false }, { IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false }, { IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false }, { IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("2000.0K") * kCharWidth, -1, true, false, false }, { IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("800 kB") * kCharWidth, -1, true, false, false }, #if !defined(DISABLE_NACL) { IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("32767") * kCharWidth, -1, true, true, false }, #endif // !defined(DISABLE_NACL) { IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false }, { IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("idlewakeups") * kCharWidth, -1, true, false, false }, #if defined(OS_LINUX) { IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN, ui::TableColumn::RIGHT, -1, 0, arraysize("999") * kCharWidth, -1, true, false, false }, #endif // defined(OS_LINUX) { IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN, ui::TableColumn::LEFT, -1, 0, arraysize("background") * kCharWidth, -1, true, true, false }, { IDS_TASK_MANAGER_MEMORY_STATE_COLUMN, ui::TableColumn::LEFT, -1, 0, arraysize("throttled") * kCharWidth, -1, true, false, false }, }; const size_t kColumnsSize = arraysize(kColumns); const char kSortColumnIdKey[] = "sort_column_id"; const char kSortIsAscendingKey[] = "sort_is_ascending"; // We can't use the integer IDs of the columns converted to strings as session // restore keys. These integer values can change from one build to another as // they are generated. Instead we use the literal string value of the column // ID symbol (i.e. for the ID IDS_TASK_MANAGER_TASK_COLUMN, we use the literal // string "IDS_TASK_MANAGER_TASK_COLUMN". The following macros help us // efficiently get the literal ID for the integer value. #define COLUMNS_LIST(def) \ def(IDS_TASK_MANAGER_TASK_COLUMN) \ def(IDS_TASK_MANAGER_PROFILE_NAME_COLUMN) \ def(IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN) \ def(IDS_TASK_MANAGER_SHARED_MEM_COLUMN) \ def(IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN) \ def(IDS_TASK_MANAGER_SWAPPED_MEM_COLUMN) \ def(IDS_TASK_MANAGER_CPU_COLUMN) \ def(IDS_TASK_MANAGER_START_TIME_COLUMN) \ def(IDS_TASK_MANAGER_CPU_TIME_COLUMN) \ def(IDS_TASK_MANAGER_NET_COLUMN) \ def(IDS_TASK_MANAGER_PROCESS_ID_COLUMN) \ def(IDS_TASK_MANAGER_GDI_HANDLES_COLUMN) \ def(IDS_TASK_MANAGER_USER_HANDLES_COLUMN) \ def(IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN) \ def(IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN) \ def(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN) \ def(IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN) \ def(IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN) \ def(IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN) \ def(IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN) \ def(IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN) \ def(IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN) \ def(IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN) \ def(IDS_TASK_MANAGER_MEMORY_STATE_COLUMN) // Add to the above list in the macro any new IDs added in the future. Also // remove the removed ones. #define COLUMN_ID_AS_STRING(col_id) case col_id: return std::string(#col_id); std::string GetColumnIdAsString(int column_id) { switch (column_id) { COLUMNS_LIST(COLUMN_ID_AS_STRING) default: NOTREACHED(); return std::string(); } } } // namespace task_manager
43.520833
80
0.738152
google-ar
d4b3ba2ae4316a10d30d66c346a077b9734a5768
6,428
cpp
C++
kernel/src/drivers/pci.cpp
ArdenyUser/ArdenWareOS
e09261093ba469d2291554c026037351bba28ab0
[ "MIT" ]
1,574
2015-01-15T16:35:30.000Z
2022-03-29T07:27:49.000Z
kernel/src/drivers/pci.cpp
bgwilf/thor-os
2dc0fef72595598aff7e5f950809042104f29b48
[ "MIT" ]
43
2016-08-23T16:22:29.000Z
2022-03-09T10:28:05.000Z
kernel/src/drivers/pci.cpp
bgwilf/thor-os
2dc0fef72595598aff7e5f950809042104f29b48
[ "MIT" ]
196
2016-02-17T10:52:24.000Z
2022-03-28T17:41:29.000Z
//======================================================================= // Copyright Baptiste Wicht 2013-2018. // Distributed under the terms of the MIT License. // (See accompanying file LICENSE or copy at // http://www.opensource.org/licenses/MIT) //======================================================================= #include "drivers/pci.hpp" #include "kernel_utils.hpp" #include "logging.hpp" #include "fs/sysfs.hpp" namespace { std::vector<pci::device_descriptor> devices; #define PCI_CONFIG_ADDRESS 0xCF8 #define PCI_CONFIG_DATA 0xCFC uint16_t get_vendor_id(uint8_t bus, uint8_t device, uint8_t function){ // read "device id | vendor id" auto large = pci::read_config_dword(bus, device, function, 0); // extract vendor id return large; } uint16_t get_device_id(uint8_t bus, uint8_t device, uint8_t function){ // read "device id | vendor id" auto large = pci::read_config_dword(bus, device, function, 0); // extract device id return large >> 16; } uint8_t get_class_code(uint8_t bus, uint8_t device, uint8_t function){ // read "class code | subclass | prog if | revision id" auto large = pci::read_config_dword(bus, device, function, 8); // extract class code only return large >> 24 & 0xFF; } uint8_t get_subclass(uint8_t bus, uint8_t device, uint8_t function){ // read "class code | subclass | prog if | revision id" auto large = pci::read_config_dword(bus, device, function, 8); // extract subclass only return large >> 16 & 0xFF; } uint8_t get_header_type(uint8_t bus, uint8_t device, uint8_t function){ // read "BIST | header type | latency timer | cache line size" auto large = pci::read_config_dword(bus, device, function, 12); // extract header type only return large >> 16 & 0xFF; } void check_function(uint8_t bus, uint8_t device, uint8_t function){ auto vendor_id = get_vendor_id(bus, device, function); if(vendor_id == 0xFFFF) { return; } auto device_id = get_device_id(bus, device, function); auto class_code = get_class_code(bus, device, function); auto sub_class = get_subclass(bus, device, function); logging::logf(logging::log_level::DEBUG, "Found device pci:%u:%u:%u (vendor:%u class:%u subclass:%u) \n", uint64_t(bus), uint64_t(device), uint64_t(function), uint64_t(vendor_id), uint64_t(class_code), uint64_t(sub_class)); auto& device_desc = devices.emplace_back(); device_desc.bus = bus; device_desc.device = device; device_desc.function = function; device_desc.vendor_id = vendor_id; device_desc.device_id = device_id; device_desc.class_code = class_code; device_desc.sub_class = sub_class; if (class_code < static_cast<uint8_t>(pci::device_class_type::RESERVED)) { device_desc.class_type = static_cast<pci::device_class_type>(class_code); } else if (class_code < static_cast<uint8_t>(pci::device_class_type::UNKNOWN)) { device_desc.class_type = pci::device_class_type::RESERVED; } else { device_desc.class_type = pci::device_class_type::UNKNOWN; } std::string pci_name = "pci:" + std::to_string(bus) + ':' + std::to_string(device) + ':' + std::to_string(function); auto p = path("/pci") / pci_name; sysfs::set_constant_value(sysfs::get_sys_path(), p / "vendor", std::to_string(vendor_id)); sysfs::set_constant_value(sysfs::get_sys_path(), p / "device", std::to_string(device_id)); sysfs::set_constant_value(sysfs::get_sys_path(), p / "class", std::to_string(class_code)); sysfs::set_constant_value(sysfs::get_sys_path(), p / "subclass", std::to_string(sub_class)); } void check_device(uint8_t bus, uint8_t device) { check_function(bus, device, 0); auto header_type = get_header_type(bus, device, 0); if((header_type & 0x80) != 0){ for(uint8_t function = 1; function < 8; ++function){ check_function(bus, device, function); } } } void brute_force_check_all_buses(){ for(uint16_t bus = 0; bus < 256; ++bus) { for(uint8_t device = 0; device < 32; ++device) { check_device(bus, device); } } } } //end of anonymous namespace void pci::detect_devices(){ brute_force_check_all_buses(); } size_t pci::number_of_devices(){ return devices.size(); } pci::device_descriptor& pci::device(size_t index){ return devices[index]; } uint8_t pci::read_config_byte(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset){ auto value = read_config_dword(bus, device, function, offset); return (value >> ((offset & 3) * 8)) & 0xff; } uint16_t pci::read_config_word(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset){ auto value = read_config_dword(bus, device, function, offset); return (value >> ((offset & 3) * 8)) & 0xffff; } uint32_t pci::read_config_dword(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset){ uint32_t address = static_cast<uint32_t>(1 << 31) //enabled | (uint32_t(bus) << 16) //bus number | (uint32_t(device) << 11) //device number | (uint32_t(function) << 8) //function number | ((uint32_t(offset) ) & 0xfc); //Register number out_dword(PCI_CONFIG_ADDRESS, address); return in_dword(PCI_CONFIG_DATA); } void pci::write_config_byte(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset, uint8_t value){ auto tmp = read_config_dword(bus, device, function, offset); tmp &= ~(0xff << ((offset & 3) * 8)); tmp |= (value << ((offset & 3) * 8)); write_config_dword(bus, device, function, offset, tmp); } void pci::write_config_word(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset, uint16_t value){ auto tmp = read_config_dword(bus, device, function, offset); tmp &= ~(0xffff << ((offset & 3) * 8)); tmp |= (value << ((offset & 3) * 8)); write_config_dword(bus, device, function, offset, tmp); } void pci::write_config_dword (uint8_t bus, uint8_t device, uint8_t function, uint8_t offset, uint32_t value){ uint32_t address = static_cast<uint32_t>(1 << 31) //enabled | (uint32_t(bus) << 16) //bus number | (uint32_t(device) << 11) //device number | (uint32_t(function) << 8) //function number | ((uint32_t(offset) ) & 0xfc); //Register number out_dword(PCI_CONFIG_ADDRESS, address); out_dword(PCI_CONFIG_DATA, value); }
34.934783
125
0.660236
ArdenyUser
d4b5859fea4e48898f3bd6681f93826c6904cc49
3,333
cpp
C++
solutions/serialize_and_deserialize_binary_tree.cpp
kmykoh97/My-Leetcode
0ffdea16c3025805873aafb6feffacaf3411a258
[ "Apache-2.0" ]
null
null
null
solutions/serialize_and_deserialize_binary_tree.cpp
kmykoh97/My-Leetcode
0ffdea16c3025805873aafb6feffacaf3411a258
[ "Apache-2.0" ]
null
null
null
solutions/serialize_and_deserialize_binary_tree.cpp
kmykoh97/My-Leetcode
0ffdea16c3025805873aafb6feffacaf3411a258
[ "Apache-2.0" ]
null
null
null
// Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment. // Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure. // Example: // You may serialize the following tree: // 1 // / \ // 2 3 // / \ // 4 5 // as "[1,2,3,null,null,4,5]" // Clarification: The above format is the same as how LeetCode serializes a binary tree. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself. // Note: Do not use class member/global/static variables to store states. Your serialize and deserialize algorithms should be stateless. // solution: bfs /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Codec { public: // Encodes a tree to a single string. string serialize(TreeNode* root) { string ser_tree = ""; queue<TreeNode*> q; q.push(root); while (!q.empty()) { root = q.front(); q.pop(); if (!root) { ser_tree += "null."; continue; } ser_tree += to_string(root->val) + "."; q.push(root->left); q.push(root->right); } cout << ser_tree << endl; return ser_tree; } // Decodes your encoded data to tree. TreeNode* deserialize(string data) { queue<string> q; string temp = ""; for (char x : data) { if (x != '.') { temp += x; } else { q.push(temp); temp = ""; } } queue<TreeNode*> q1; TreeNode* root = nullptr; if (q.front() != "null") { cout << q.front() << endl; root = new TreeNode(stoi(q.front())); q.pop(); q1.push(root); } else { cout << q.front(); return nullptr; } while (!q1.empty()) { TreeNode* temp = q1.front(); q1.pop(); if (q.front() != "null") { temp->left = new TreeNode(stoi(q.front())); q.pop(); q1.push(temp->left); } else { temp->left = nullptr; q.pop(); } if (q.front() != "null") { temp->right = new TreeNode(stoi(q.front())); q.pop(); q1.push(temp->right); } else { temp->right = nullptr; q.pop(); } } return root; } }; // Your Codec object will be instantiated and called as such: // Codec codec; // codec.deserialize(codec.serialize(root));
29.236842
296
0.510651
kmykoh97
d4b76f6baa88122184ca23e080f5b9b950891286
10,904
cpp
C++
src/bitset.cpp
isabella232/stdcxx
b0b0cab391b7b1f2d17ef4342aeee6b792bde63c
[ "Apache-2.0" ]
53
2015-01-13T05:46:43.000Z
2022-02-24T23:46:04.000Z
src/bitset.cpp
mann-patel/stdcxx
a22c5192f4b2a8b0b27d3588ea8f6d1faf8b037a
[ "Apache-2.0" ]
1
2021-11-04T12:35:39.000Z
2021-11-04T12:35:39.000Z
src/bitset.cpp
isabella232/stdcxx
b0b0cab391b7b1f2d17ef4342aeee6b792bde63c
[ "Apache-2.0" ]
33
2015-07-09T13:31:00.000Z
2021-11-04T12:12:20.000Z
/*************************************************************************** * * bitset.cpp - definitions of bitset operations * * $Id$ * *************************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you 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. * * Copyright 1994-2006 Rogue Wave Software. * **************************************************************************/ #define _RWSTD_LIB_SRC #include <bitset> #include <string.h> // for memmove(), memset(), strlen() #include <rw/_traits.h> // for char_traits<wchar_t> #include <rw/_defs.h> #include <stdio.h> _RWSTD_NAMESPACE (__rw) { #if 2 == _RWSTD_LONG_SIZE static const int __rw_wbasebits = 1; static const _RWSTD_SIZE_T __rw_wbasemask = 15; #elif 4 == _RWSTD_LONG_SIZE static const int __rw_wbasebits = 2; static const _RWSTD_SIZE_T __rw_wbasemask = 31; #elif 8 == _RWSTD_LONG_SIZE static const int __rw_wbasebits = 3; static const _RWSTD_SIZE_T __rw_wbasemask = 63; #else // assume 16 == sizeof (long) static const int __rw_wbasebits = 4; static const _RWSTD_SIZE_T __rw_wbasemask = 127; #endif // _RWSTD_LONG_SIZE // overloads of __rw_bitset() implement: // // 23.3.5.1 bitset constructors [lib.bitset.cons] // // bitset<N>:: // bitset(basic_string<charT, Traits, Allocator>& str, // typename basic_string<charT, Traits, Allocator>::size_type pos, // typename basic_string<charT, Traits, Allocator>::size_type n); // // -5- Effects: Determines the effective length rlen of the initializing // string as the smaller of n and str.size() - pos. // The function then throws invalid_argument if any of the rlen // characters in str beginning at position pos is other than 0 or 1. // Otherwise, the function constructs an object of class bitset<N>, // initializing the first M bit positions to values determined from // the corresponding characters in the string str. M is the smaller // of N and rlen. // -6- An element of the constructed string has value zero if // the corresponding character in str, beginning at position pos, // is 0. Otherwise, the element has the value one. Character // position pos + M - 1 corresponds to bit position zero. // Subsequent decreasing character positions correspond to // increasing bit positions. // -7- If M < N, remaining bit positions are initialized to zero. _RWSTD_SPECIALIZED_FUNCTION _RWSTD_EXPORT void __rw_bitset (unsigned long *bits, _RWSTD_SIZE_T maxbits, const char *str, _RWSTD_SIZE_T slen, const _STD::char_traits<char>*, char b0, char b1, _RWSTD_SIZE_T pos, _RWSTD_SIZE_T n, const char *file, const char *fun) { if (_RWSTD_SIZE_MAX == slen) slen = strlen (str); // verify that `pos' is a valid offset into `str' _RWSTD_REQUIRES (pos <= slen, (_RWSTD_ERROR_OUT_OF_RANGE, file, fun, pos, slen)); // compute the number of characters in `str' past the offset `pos' const _RWSTD_SIZE_T nchars = n < (slen - pos) ? n : slen - pos; // compute the number of bits to initialize from `str' const _RWSTD_SIZE_T nbits = nchars < maxbits ? nchars : maxbits; str += pos; // compute the number of non-zero bytes occupied by `bits' _RWSTD_SIZE_T nbytes = ((maxbits | 1) >> 3) + (0 != (maxbits & 7)); // round the number up to a multiple of sizeof(long) nbytes = ( (nbytes >> __rw_wbasebits) + (0 != (nbytes & (__rw_wbasemask >> 3)))) << __rw_wbasebits; memset (bits, 0, nbytes); // set all bits but also check any extra characters as required for (_RWSTD_SIZE_T i = 0; i != nchars; ++i) { if (b1 == str [i]) { if (i < nbits) { const _RWSTD_SIZE_T bitno = nbits - i - 1; // efficiently compute the value of the expression below // (i.e., without relying on slow division and modulo) // bits [bitno / wordbits] |= 1UL << bitno % wordbits; bits [bitno >> (3 + __rw_wbasebits)] |= 1UL << (bitno & __rw_wbasemask); } } else { // verify that the character is valid _RWSTD_REQUIRES (b0 == str [i], (_RWSTD_ERROR_INVALID_ARGUMENT, file, fun)); } } } #ifndef _RWSTD_NO_WCHAR_T _RWSTD_SPECIALIZED_FUNCTION _RWSTD_EXPORT void __rw_bitset (unsigned long *bits, _RWSTD_SIZE_T maxbits, const wchar_t *str, _RWSTD_SIZE_T slen, const _STD::char_traits<wchar_t>*, wchar_t b0, wchar_t b1, _RWSTD_SIZE_T pos, _RWSTD_SIZE_T n, const char *file, const char *fun) { if (_RWSTD_SIZE_MAX == slen) slen = _STD::char_traits<wchar_t>::length (str); // verify that `pos' is a valid offset into `str' _RWSTD_REQUIRES (pos <= slen, (_RWSTD_ERROR_OUT_OF_RANGE, file, fun, pos, slen)); // compute the number of characters in `str' past the offset `pos' const _RWSTD_SIZE_T nchars = n < (slen - pos) ? n : slen - pos; // compute the number of bits to initialize from `str' const _RWSTD_SIZE_T nbits = nchars < maxbits ? nchars : maxbits; str += pos; // compute the number of non-zero bytes occupied by `bits' _RWSTD_SIZE_T nbytes = ((maxbits | 1) >> 3) + (0 != (maxbits & 7)); // round the number up to a multiple of sizeof(long) nbytes = ( (nbytes >> __rw_wbasebits) + (0 != (nbytes & (__rw_wbasemask >> 3)))) << __rw_wbasebits; memset (bits, 0, nbytes); // set all bits but also check any extra characters as required for (_RWSTD_SIZE_T i = 0; i != nchars; ++i) { if (b1 == str [i]) { if (i < nbits) { const _RWSTD_SIZE_T bitno = nbits - i - 1; bits [bitno >> (3 + __rw_wbasebits)] |= 1UL << (bitno & __rw_wbasemask); } } else { // verify that the character is valid _RWSTD_REQUIRES (b0 == str [i], (_RWSTD_ERROR_INVALID_ARGUMENT, file, fun)); } } } #endif // _RWSTD_NO_WCHAR_T // table of bitcounts in each of the 256 values // a byte can take on for efficient counting of bits static const unsigned char __rw_bitcounts [256] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }; // count the number of 1 bits in bitset `bits' of `size' elements _RWSTD_EXPORT _RWSTD_SIZE_T __rw_bit_count (const unsigned long *bits, _RWSTD_SIZE_T size) _THROWS (()) { _RWSTD_ASSERT (0 != bits); _RWSTD_SIZE_T sum = 0; typedef unsigned char UChar; const UChar* pbyte = _RWSTD_REINTERPRET_CAST (const UChar*, bits); const UChar* const pend = pbyte + size * sizeof (unsigned long); for ( ; pbyte != pend; ++pbyte) sum += __rw_bitcounts [*pbyte]; return sum; } // shift bitset `bits' of `size' elements left by `n' positions _RWSTD_EXPORT void __rw_shl (unsigned long *bits, _RWSTD_SIZE_T size, _RWSTD_SIZE_T n) _THROWS (()) { const _RWSTD_SIZE_T wordbits = sizeof *bits * _RWSTD_CHAR_BIT; if (n >= size * wordbits) { memset (bits, 0, size * sizeof *bits); return; } if (!n) return; const _RWSTD_SIZE_T shlw = n / wordbits; // word shift left const _RWSTD_SIZE_T shlb = n % wordbits; // bit shift left if (shlb) { const _RWSTD_SIZE_T shrb = wordbits - shlb; // bit shift right // shift one word at a time, spanning word boundaries for (_RWSTD_SIZE_T i = size - 1; i > shlw; --i) bits [i] = bits [i - shlw] << shlb | bits [i - shlw - 1] >> shrb; // shift the last word bits [shlw] = bits [0] << shlb; } else { // no shifting necessary, just copy memmove (bits + shlw, bits, (size - shlw) * sizeof *bits); } // fill remainder with zeros memset (bits, 0, shlw * sizeof *bits); } // shift bitset `bits' of `size' elements right by `n' positions _RWSTD_EXPORT void __rw_shr (unsigned long *bits, _RWSTD_SIZE_T size, _RWSTD_SIZE_T n) _THROWS (()) { const _RWSTD_SIZE_T wordbits = sizeof *bits * _RWSTD_CHAR_BIT; if (n >= size * wordbits) { memset (bits, 0, size * sizeof *bits); return; } if (!n) return; const _RWSTD_SIZE_T shrw = n / wordbits; // word shift right const _RWSTD_SIZE_T shrb = n % wordbits; // bit shift right // max word index const _RWSTD_SIZE_T maxw = size - shrw - 1; if (shrb) { const _RWSTD_SIZE_T shlb = wordbits - shrb; // bit shift left // shift one word at a time, spanning word boundaries for (_RWSTD_SIZE_T i = 0; i < maxw; ++i) bits [i] = bits [i + shrw] >> shrb | bits [i + shrw + 1] << shlb; // shift the last word bits [maxw] = bits [size - 1] >> shrb; } else { // no shifting necessary, just copy memmove (bits, bits + shrw, (maxw + 1) * sizeof *bits); } // fill remainder with zeros memset (bits + (maxw + 1), 0, (size - (maxw + 1)) * sizeof *bits); } } // namespace __rw
34.726115
76
0.575293
isabella232
d4badf36606ec1a05672471e45ae87227b3955c5
2,114
hpp
C++
R2017b/extern/include/coder/target_services/crc8.hpp
catou93/pelican_test
23de9722c431fa0caa3c68d038de9423cfcdda80
[ "BSD-2-Clause" ]
5
2018-11-21T11:52:49.000Z
2021-04-14T03:13:31.000Z
R2017b/extern/include/coder/target_services/crc8.hpp
catou93/pelican_test
23de9722c431fa0caa3c68d038de9423cfcdda80
[ "BSD-2-Clause" ]
3
2018-08-24T03:12:36.000Z
2019-09-29T06:21:32.000Z
R2017b/extern/include/coder/target_services/crc8.hpp
catou93/pelican_test
23de9722c431fa0caa3c68d038de9423cfcdda80
[ "BSD-2-Clause" ]
4
2018-08-10T07:02:30.000Z
2022-03-09T07:20:16.000Z
/* Copyright 2015 The MathWorks, Inc. */ #ifndef crc8_hpp__ #define crc8_hpp__ #include <stdint.h> const uint8_t crc8_table[] = { 0x00, 0x3e, 0x7c, 0x42, 0xf8, 0xc6, 0x84, 0xba, 0x95, 0xab, 0xe9, 0xd7, 0x6d, 0x53, 0x11, 0x2f, 0x4f, 0x71, 0x33, 0x0d, 0xb7, 0x89, 0xcb, 0xf5, 0xda, 0xe4, 0xa6, 0x98, 0x22, 0x1c, 0x5e, 0x60, 0x9e, 0xa0, 0xe2, 0xdc, 0x66, 0x58, 0x1a, 0x24, 0x0b, 0x35, 0x77, 0x49, 0xf3, 0xcd, 0x8f, 0xb1, 0xd1, 0xef, 0xad, 0x93, 0x29, 0x17, 0x55, 0x6b, 0x44, 0x7a, 0x38, 0x06, 0xbc, 0x82, 0xc0, 0xfe, 0x59, 0x67, 0x25, 0x1b, 0xa1, 0x9f, 0xdd, 0xe3, 0xcc, 0xf2, 0xb0, 0x8e, 0x34, 0x0a, 0x48, 0x76, 0x16, 0x28, 0x6a, 0x54, 0xee, 0xd0, 0x92, 0xac, 0x83, 0xbd, 0xff, 0xc1, 0x7b, 0x45, 0x07, 0x39, 0xc7, 0xf9, 0xbb, 0x85, 0x3f, 0x01, 0x43, 0x7d, 0x52, 0x6c, 0x2e, 0x10, 0xaa, 0x94, 0xd6, 0xe8, 0x88, 0xb6, 0xf4, 0xca, 0x70, 0x4e, 0x0c, 0x32, 0x1d, 0x23, 0x61, 0x5f, 0xe5, 0xdb, 0x99, 0xa7, 0xb2, 0x8c, 0xce, 0xf0, 0x4a, 0x74, 0x36, 0x08, 0x27, 0x19, 0x5b, 0x65, 0xdf, 0xe1, 0xa3, 0x9d, 0xfd, 0xc3, 0x81, 0xbf, 0x05, 0x3b, 0x79, 0x47, 0x68, 0x56, 0x14, 0x2a, 0x90, 0xae, 0xec, 0xd2, 0x2c, 0x12, 0x50, 0x6e, 0xd4, 0xea, 0xa8, 0x96, 0xb9, 0x87, 0xc5, 0xfb, 0x41, 0x7f, 0x3d, 0x03, 0x63, 0x5d, 0x1f, 0x21, 0x9b, 0xa5, 0xe7, 0xd9, 0xf6, 0xc8, 0x8a, 0xb4, 0x0e, 0x30, 0x72, 0x4c, 0xeb, 0xd5, 0x97, 0xa9, 0x13, 0x2d, 0x6f, 0x51, 0x7e, 0x40, 0x02, 0x3c, 0x86, 0xb8, 0xfa, 0xc4, 0xa4, 0x9a, 0xd8, 0xe6, 0x5c, 0x62, 0x20, 0x1e, 0x31, 0x0f, 0x4d, 0x73, 0xc9, 0xf7, 0xb5, 0x8b, 0x75, 0x4b, 0x09, 0x37, 0x8d, 0xb3, 0xf1, 0xcf, 0xe0, 0xde, 0x9c, 0xa2, 0x18, 0x26, 0x64, 0x5a, 0x3a, 0x04, 0x46, 0x78, 0xc2, 0xfc, 0xbe, 0x80, 0xaf, 0x91, 0xd3, 0xed, 0x57, 0x69, 0x2b, 0x15 }; static const uint8_t DEFAULT_CRC8_SEED = 0x6c; template <typename Iterator> uint8_t crc8(Iterator it, Iterator end, uint8_t seed = DEFAULT_CRC8_SEED) { if (it == end) return seed; unsigned crc = seed ^ 0xff; do { crc = crc8_table[crc ^ *it]; ++it; } while (it != end); return (uint8_t)(crc ^ 0xff); } #endif
43.142857
75
0.631977
catou93
d4bb437d4afacb50c2d72be62d816fb1d414f8dc
1,505
cpp
C++
src/sim/RandomSeedWidget.cpp
wuyx/mms
2959ef76405b069aaeb4c1574f52ab776dfaff77
[ "MIT" ]
null
null
null
src/sim/RandomSeedWidget.cpp
wuyx/mms
2959ef76405b069aaeb4c1574f52ab776dfaff77
[ "MIT" ]
null
null
null
src/sim/RandomSeedWidget.cpp
wuyx/mms
2959ef76405b069aaeb4c1574f52ab776dfaff77
[ "MIT" ]
null
null
null
#include "RandomSeedWidget.h" #include <QGroupBox> #include <QHBoxLayout> #include <QLabel> #include "SimUtilities.h" namespace mms { RandomSeedWidget::RandomSeedWidget(int max) : m_max(max), m_lockSeed(new QCheckBox("Lock")), m_nextSeedBox(new QSpinBox()), m_prevSeedBox(new QSpinBox()) { m_nextSeedBox->setRange(0, m_max); m_nextSeedBox->setValue(getNext()); m_prevSeedBox->setReadOnly(true); m_prevSeedBox->setButtonSymbols(QAbstractSpinBox::NoButtons); m_prevSeedBox->setSpecialValueText("N/A"); m_prevSeedBox->setRange(0, m_max); QHBoxLayout* layout = new QHBoxLayout(); QGroupBox* groupBox = new QGroupBox("Random Seed"); QHBoxLayout* groupBoxLayout = new QHBoxLayout(); groupBoxLayout->addWidget(m_lockSeed); groupBoxLayout->addWidget(new QLabel("Next")); groupBoxLayout->addWidget(m_nextSeedBox); groupBoxLayout->addWidget(new QLabel("Previous")); groupBoxLayout->addWidget(m_prevSeedBox); groupBox->setLayout(groupBoxLayout); layout->addWidget(groupBox); layout->setContentsMargins(0, 0, 0, 0); setLayout(layout); } int RandomSeedWidget::next() { int seed = m_nextSeedBox->value(); m_prevSeedBox->setValue(seed); m_prevSeedBox->setSpecialValueText(""); if (!m_lockSeed->isChecked()) { m_nextSeedBox->setValue(getNext()); } return seed; } int RandomSeedWidget::getNext() { return SimUtilities::randomNonNegativeInt(m_max + 1); } } // namespace mms
28.396226
65
0.700332
wuyx
d4c3dbab17b1b2910e09dcf219a350f2da2855c3
13,001
cpp
C++
g2opy/contrib/vertigo/examples/robustISAM2/robustISAM2.cpp
alecone/ROS_project
f058fb0bc5c4c9b1a590b7536f75b83af35b7785
[ "MIT" ]
5
2022-03-28T04:41:35.000Z
2022-03-30T12:34:41.000Z
thirdparty/g2opy/contrib/vertigo/examples/robustISAM2/robustISAM2.cpp
rpng/suo_slam
5de01433d177fde5cac4423f05fd554e3c00794e
[ "MIT" ]
null
null
null
thirdparty/g2opy/contrib/vertigo/examples/robustISAM2/robustISAM2.cpp
rpng/suo_slam
5de01433d177fde5cac4423f05fd554e3c00794e
[ "MIT" ]
null
null
null
/* * robustISAM2.cpp * * Created on: Jul 13, 2012 * Author: niko */ #include <gtsam/slam/planarSLAM.h> #include <gtsam/nonlinear/ISAM2.h> #include <gtsam/nonlinear/NonlinearFactorGraph.h> #include <gtsam/nonlinear/Marginals.h> using namespace gtsam; // additional boost features #include "boost/program_options.hpp" namespace po = boost::program_options; #include "boost/foreach.hpp" #define foreach BOOST_FOREACH #include <boost/progress.hpp> #include <boost/lexical_cast.hpp> #include "betweenFactorSwitchable.h" #include "switchVariableLinear.h" #include "switchVariableSigmoid.h" #include "betweenFactorMaxMix.h" #include "timer.h" using namespace vertigo; // =================================================================== struct Pose { int id; double x,y,th; }; struct Edge { int i, j; double x, y, th; bool switchable; bool maxMix; Matrix covariance; double weight; }; void writeResults(Values &results, string outputFile) { ofstream resultFile(outputFile.c_str()); Values::ConstFiltered<Pose2> result_poses = results.filter<Pose2>(); foreach (const Values::ConstFiltered<Pose2>::KeyValuePair& key_value, result_poses) { Pose2 p = key_value.value; resultFile << "VERTEX_SE2 " << p.x() << " " << p.y() << " " << p.theta() << endl; } { Values::ConstFiltered<SwitchVariableLinear> result_switches = results.filter<SwitchVariableLinear>(); foreach (const Values::ConstFiltered<SwitchVariableLinear>::KeyValuePair& key_value, result_switches) { resultFile << "VERTEX_SWITCH " << key_value.value.value() << endl; } } { Values::ConstFiltered<SwitchVariableSigmoid> result_switches = results.filter<SwitchVariableSigmoid>(); foreach (const Values::ConstFiltered<SwitchVariableSigmoid>::KeyValuePair& key_value, result_switches) { resultFile << "VERTEX_SWITCH " << key_value.value.value() << endl; } } } // =================================================================== bool parseDataset(string inputFile, vector<Pose>&poses, vector<Edge>&edges,multimap<int, int> &poseToEdges) { cout << endl << "Parsing dataset " << inputFile << " ... " << endl; // open the file ifstream inFile(inputFile.c_str()); if (!inFile) { cerr << "Error opening dataset file " << inputFile << endl; return false; } // go through the dataset file while (!inFile.eof()) { // depending on the type of vertex or edge, read the data string type; inFile >> type; if (type == "VERTEX_SE2") { Pose p; inFile >> p.id >> p.x >> p.y >> p.th; poses.push_back(p); } else if (type == "EDGE_SE2_SWITCHABLE" || type == "EDGE_SE2" || type == "EDGE_SE2_MAXMIX") { double dummy; Edge e; // read pose IDs inFile >> e.i >> e.j; if (e.i>e.j) { swap(e.i,e.j); } // read the switch variable ID (only needed in g2o, we dont need it here in the gtsam world) if (type == "EDGE_SE2_SWITCHABLE") inFile >> dummy; if (type == "EDGE_SE2_MAXMIX") inFile >> e.weight; // read odometry measurement inFile >> e.x >> e.y >> e.th; // read information matrix double info[6]; inFile >> info[0] >> info[1] >> info[2] >> info[3] >> info[4] >> info[5]; Matrix informationMatrix = Matrix_(3,3, info[0], info[1], info[2], info[1], info[3], info[4], info[2], info[4], info[5]); e.covariance = inverse(informationMatrix); if (type == "EDGE_SE2_SWITCHABLE") { e.switchable=true; e.maxMix=false; } else if (type == "EDGE_SE2_MAXMIX") { e.switchable=false; e.maxMix=true; } else { e.switchable=false; e.maxMix=false; } edges.push_back(e); int id = edges.size()-1; poseToEdges.insert(pair<int, int>(e.j, id)); } // else just read the next item at next iteration until one of the if clauses is true } return true; } // =================================================================== int main(int argc, char *argv[]) { // === handle command line arguments === string inputFile, outputFile; string method; int stop; double relinThresh; ISAM2Params isam2Params; po::options_description desc("Allowed options"); desc.add_options() ("help", "Show this help message.") ("input,i", po::value<string>(&inputFile)->default_value("dataset.g2o"),"Load dataset from this file.") ("output,o", po::value<string>(&outputFile)->default_value("results.isam"),"Save results in this file.") ("stop", po::value<int>(&stop)->default_value(-1), "Stop after this many poses.") ("verbose,v", "verbose mode") ("sigmoid", "Use the sigmoid as the switch function Psi instead of a linear function.") ("dogleg", "Use Powell's dogleg method instead of Gauss-Newton.") ("qr", "Use QR factorization instead of Cholesky.") ("relinSkip", po::value<int>(&isam2Params.relinearizeSkip)->default_value(10), "Only relinearize any variables every relinearizeSkip calls to ISAM2::update (default: 10)") ("relinThresh", po::value<double>(&relinThresh)->default_value(0.1),"Only relinearize variables whose linear delta magnitude is greater than this threshold." ) ("odoOnly", "Only use odometry edges, discard all other edges in the graph.") ; po::variables_map vm; po::store(po::command_line_parser(argc, argv).options(desc).allow_unregistered().run(),vm); po::notify(vm); if (vm.count("help")) { cout << desc << "\n"; return 1; } bool verbose; if (vm.count("verbose")) verbose=true; else verbose=false; bool useSigmoid; if (vm.count("sigmoid")) useSigmoid=true; else useSigmoid = false; // === read and parse input file === vector<Pose> poses; vector<Edge> edges; multimap<int, int> poseToEdges; if (!parseDataset(inputFile, poses, edges, poseToEdges)) { cerr << "Error parsing the dataset."<< endl; return 0; } cout << "Read " << poses.size() << " poses and " << edges.size() << " edges." << endl; // === set up iSAM2 === //ISAM2Params isam2Params; already defined on top ISAM2DoglegParams doglegParams; ISAM2GaussNewtonParams gaussParams; if (vm.count("dogleg")) isam2Params.optimizationParams = doglegParams; else isam2Params.optimizationParams = gaussParams; if (vm.count("qr")) isam2Params.factorization = ISAM2Params::QR; if (vm.count("verbose")) { // isam2Params.enableDetailedResults = true; isam2Params.evaluateNonlinearError = true; } isam2Params.relinearizeThreshold = relinThresh; ISAM2 isam2(isam2Params); // === go through the data and incrementally fee1d it into iSAM2 === cout << "Running iSAM2 ..." << endl; // set up progress bar int progressLength = poses.size(); if (stop>0 && stop<=poses.size()) progressLength=stop; boost::progress_display show_progress(progressLength); int counter=0; int switchCounter=-1; planarSLAM::Values globalInitialEstimate; Timer timer; // iterate through the poses and incrementally build and solve the graph, using iSAM2 foreach (Pose p, poses) { planarSLAM::Graph graph; planarSLAM::Values initialEstimate; // find all the edges that involve this pose timer.tic("findEdges"); pair<multimap<int, int>::iterator, multimap<int, int>::iterator > ret = poseToEdges.equal_range(p.id); timer.toc("findEdges"); for (multimap<int, int>::iterator it=ret.first; it!=ret.second; it++) { // look at the edge and see if it is switchable or not Edge e = edges[it->second]; // see if this is an odometry edge, if yes, use it to initialize the current pose if (e.j==e.i+1) { timer.tic("initialize"); Pose2 predecessorPose = isam2.calculateEstimate<Pose2>(planarSLAM::PoseKey(p.id-1)); if (isnan(predecessorPose.x()) || isnan(predecessorPose.y()) || isnan(predecessorPose.theta())) { cout << "! Degenerated solution (NaN) detected. Solver failed." << endl; writeResults(globalInitialEstimate, outputFile); timer.print(cout); return 0; } initialEstimate.insertPose(p.id, predecessorPose * Pose2(e.x, e.y, e.th)); globalInitialEstimate.insertPose(p.id, predecessorPose * Pose2(e.x, e.y, e.th) ); timer.toc("initialize"); } timer.tic("addEdges"); if (!e.switchable && !e.maxMix) { if (!vm.count("odoOnly") || (e.j == e.i+1) ) { // this is easy, use the convenience functions of gtsam SharedNoiseModel odom_model = noiseModel::Gaussian::Covariance(e.covariance); graph.addOdometry(e.i, e.j, Pose2(e.x, e.y, e.th), odom_model); } } else if (e.switchable && !vm.count("odoOnly")) { if (!useSigmoid) { // create new switch variable initialEstimate.insert(Symbol('s',++switchCounter),SwitchVariableLinear(1.0)); // create switch prior factor SharedNoiseModel switchPriorModel = noiseModel::Diagonal::Sigmas(Vector_(1, 1.0)); boost::shared_ptr<PriorFactor<SwitchVariableLinear> > switchPriorFactor (new PriorFactor<SwitchVariableLinear> (Symbol('s',switchCounter), SwitchVariableLinear(1.0), switchPriorModel)); graph.push_back(switchPriorFactor); // create switchable odometry factor SharedNoiseModel odom_model = noiseModel::Gaussian::Covariance(e.covariance); boost::shared_ptr<NonlinearFactor> switchableFactor(new BetweenFactorSwitchableLinear<Pose2>(planarSLAM::PoseKey(e.i), planarSLAM::PoseKey(e.j), Symbol('s', switchCounter), Pose2(e.x, e.y, e.th), odom_model)); graph.push_back(switchableFactor); } else { // create new switch variable initialEstimate.insert(Symbol('s',++switchCounter),SwitchVariableSigmoid(10.0)); // create switch prior factor SharedNoiseModel switchPriorModel = noiseModel::Diagonal::Sigmas(Vector_(1, 20.0)); boost::shared_ptr<PriorFactor<SwitchVariableSigmoid> > switchPriorFactor (new PriorFactor<SwitchVariableSigmoid> (Symbol('s',switchCounter), SwitchVariableSigmoid(10.0), switchPriorModel)); graph.push_back(switchPriorFactor); // create switchable odometry factor SharedNoiseModel odom_model = noiseModel::Gaussian::Covariance(e.covariance); boost::shared_ptr<NonlinearFactor> switchableFactor(new BetweenFactorSwitchableSigmoid<Pose2>(planarSLAM::PoseKey(e.i), planarSLAM::PoseKey(e.j), Symbol('s', switchCounter), Pose2(e.x, e.y, e.th), odom_model)); graph.push_back(switchableFactor); } } else if (e.maxMix && !vm.count("odoOnly")) { // create mixture odometry factor SharedNoiseModel odom_model = noiseModel::Gaussian::Covariance(e.covariance); SharedNoiseModel null_model = noiseModel::Gaussian::Covariance(e.covariance / e.weight); boost::shared_ptr<NonlinearFactor> maxMixFactor(new BetweenFactorMaxMix<Pose2>(planarSLAM::PoseKey(e.i), planarSLAM::PoseKey(e.j), Pose2(e.x, e.y, e.th), odom_model, null_model, e.weight)); graph.push_back(maxMixFactor); } timer.toc("addEdges"); } if (p.id==0) { // add prior for first pose SharedDiagonal prior_model = noiseModel::Diagonal::Sigmas(Vector_(3, 0.01, 0.01, 0.01)); graph.addPrior(p.id, Pose2(p.x, p.y, p.th), prior_model); // initial value for first pose initialEstimate.insertPose(p.id, Pose2(p.x, p.y, p.th)); } if (verbose) { timer.tic("update"); ISAM2Result result = isam2.update(graph, initialEstimate); timer.toc("update"); cout << "cliques: " << result.cliques << "\terr_before: " << *(result.errorBefore) << "\terr_after: " << *(result.errorAfter) << "\trelinearized: " << result.variablesRelinearized << endl; } else { timer.tic("update"); isam2.update(graph, initialEstimate); timer.toc("update"); } if (!verbose) ++show_progress; if ( (counter++ >= stop) && (stop>0)) break; if (false) { timer.tic("marginals"); gtsam::Marginals marginals(isam2.getFactorsUnsafe(), isam2.getLinearizationPoint()); gtsam::Matrix cov = marginals.marginalCovariance(gtsam::Symbol('x', p.id)); timer.toc("marginals"); cout << cov << endl << endl; } /* if (counter % 100 == 0) { Values results = isam2.calculateEstimate(); char fileName[1024]; sprintf(fileName, "results/results_%05d.isam", counter); writeResults(results, string(fileName)); } */ } // === do final estimation === //cout << endl; Values results = isam2.calculateBestEstimate(); //results.print(); timer.print(cout); // === write results === cout << endl << endl << "Writing results." << endl; writeResults(results, outputFile); }
33.507732
221
0.634105
alecone
d4c3ffeff719fbfd380b7c0a3694f645100a1e7a
508
cpp
C++
Data_structures/Bit Manipulation/splitting_numbers.cpp
satvik007/uva
72a763f7ed46a34abfcf23891300d68581adeb44
[ "MIT" ]
3
2017-08-12T06:09:39.000Z
2018-09-16T02:31:27.000Z
Data_structures/Bit Manipulation/splitting_numbers.cpp
satvik007/uva
72a763f7ed46a34abfcf23891300d68581adeb44
[ "MIT" ]
null
null
null
Data_structures/Bit Manipulation/splitting_numbers.cpp
satvik007/uva
72a763f7ed46a34abfcf23891300d68581adeb44
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector <int> vi; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); //ifstream cin("in.txt"); //ofstream cout("out.txt"); ll n; while(cin >> n, n){ bitset <32> a(n); int flag = 0; ll b=0, c=0; for(int i=0; i<32; i++){ if(a[i] == 1){ if(flag == 0){ b ^= (1<<i); flag = 1; } else { c ^= (1 << i); flag = 0; } } } cout << b << " " << c << "\n"; } return 0; }
15.393939
34
0.476378
satvik007
d4c5da0c305d13cd514283378584234bcacd26bf
18,902
cpp
C++
src/parser/expr.cpp
RauliL/snek
ad530c0485addaf71fd01469860b83a16d16bf9d
[ "BSD-2-Clause" ]
null
null
null
src/parser/expr.cpp
RauliL/snek
ad530c0485addaf71fd01469860b83a16d16bf9d
[ "BSD-2-Clause" ]
null
null
null
src/parser/expr.cpp
RauliL/snek
ad530c0485addaf71fd01469860b83a16d16bf9d
[ "BSD-2-Clause" ]
null
null
null
/* * Copyright (c) 2020, Rauli Laine * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <snek/ast/expr/binary.hpp> #include <snek/ast/expr/bool.hpp> #include <snek/ast/expr/call.hpp> #include <snek/ast/expr/field.hpp> #include <snek/ast/expr/float.hpp> #include <snek/ast/expr/func.hpp> #include <snek/ast/expr/id.hpp> #include <snek/ast/expr/int.hpp> #include <snek/ast/expr/list.hpp> #include <snek/ast/expr/null.hpp> #include <snek/ast/expr/record.hpp> #include <snek/ast/expr/str.hpp> #include <snek/ast/expr/subscript.hpp> #include <snek/ast/expr/unary.hpp> #include <snek/ast/parameter.hpp> #include <snek/ast/record.hpp> #include <snek/ast/stmt/block.hpp> #include <snek/ast/stmt/return.hpp> #include <snek/parser.hpp> namespace snek::parser::expr { using expr_list_result_type = peelo::result< std::vector<std::shared_ptr<ast::expr::RValue>>, Error >; static expr_list_result_type parse_expr_list( State& state, const ast::Position& position, cst::Kind separator, const std::u32string& what ) { std::vector<std::shared_ptr<ast::expr::RValue>> list; for (;;) { if (state.eof()) { return expr_list_result_type::error({ position, U"Unterminated " + what + U"; Missing " + cst::to_string(separator) + U"." }); } else if (state.peek_read(separator)) { break; } else { const auto expr = parse(state); if (expr) { list.push_back(expr.value()); if (!state.peek(cst::Kind::Comma) && !state.peek(separator)) { return expr_list_result_type::error({ expr.value()->position(), U"Unterminated " + what + + U"; Missing " + cst::to_string(separator) + U"." }); } state.peek_read(cst::Kind::Comma); } else { return expr_list_result_type::error(expr.error()); } } } return expr_list_result_type::ok(list); } static result_type parse_list_expr(State& state) { const auto position = state.current++->position(); const auto elements = parse_expr_list( state, position, cst::Kind::RightBracket, U"list literal" ); if (!elements) { return result_type::error(elements.error()); } return result_type::ok(std::make_shared<ast::expr::List>( position, elements.value() )); } static result_type parse_record_expr(State& state) { const auto position = state.current++->position(); ast::expr::Record::container_type fields; for (;;) { if (state.eof()) { return result_type::error({ position, U"Unterminated record; Missing `}'." }); } else if (state.peek_read(cst::Kind::RightBrace)) { break; } else { const auto field = record::parse(state, position); if (!field) { return result_type::error(field.error()); } fields.push_back(field.value()); if (!state.peek(cst::Kind::Comma) && !state.peek(cst::Kind::RightBrace)) { return result_type::error({ field.value()->position(), U"Unterminated record; Missing `}'." }); } state.peek_read(cst::Kind::Comma); } } return result_type::ok(std::make_shared<ast::expr::Record>( position, fields )); } result_type parse_func(State& state) { const auto position = state.current->position(); std::vector<std::shared_ptr<ast::Parameter>> parameters; std::shared_ptr<ast::stmt::Base> body; std::optional<std::shared_ptr<ast::type::Base>> return_type; if (const auto error = parse_parameter_list(state, parameters, position)) { return result_type::error(*error); } if (state.peek_read(cst::Kind::Arrow)) { const auto result = type::parse(state, position); if (!result) { return result_type::error(result.error()); } return_type = result.value(); } if (state.peek_read(cst::Kind::FatArrow)) { const auto expr = parse(state, position); if (!expr) { return result_type::error(expr.error()); } // Possibly not the greatest idea. It's really context specific whether // new line should be followed by the expression. state.peek_read(cst::Kind::NewLine); body = std::make_shared<ast::stmt::Return>( expr.value()->position(), expr.value() ); } else if (state.peek_read(cst::Kind::Colon)) { const auto block = stmt::parse_block(state, position); if (!block) { return result_type::error(block.error()); } body = block.value(); } else { return result_type::error({ position, U"Missing `:' after function declaration." }); } return result_type::ok(std::make_shared<ast::expr::Func>( position, parameters, body, return_type )); } static result_type parse_parenthesized_expr(State& state) { const auto position = state.current++->position(); const auto expression = parse(state, position); if (!expression) { return expression; } else if (!state.peek_read(cst::Kind::RightParen)) { return result_type::error({ position, U"Unterminated parenthesized expression; Missing `)'." }); } return expression; } static result_type parse_primary_expr( State& state, const std::optional<ast::Position>& position ) { std::shared_ptr<ast::expr::RValue> expr; if (state.eof()) { return result_type::error({ position, U"Unexpected end of input; Missing expression." }); } switch (state.current->kind()) { case cst::Kind::Float: // TODO: Deal with thrown exceptions. expr = std::make_shared<ast::expr::Float>( state.current->position(), std::strtod( peelo::unicode::encoding::utf8::encode( *state.current->text() ).c_str(), nullptr ) ); break; case cst::Kind::Int: // TODO: Deal with thrown exceptions. expr = std::make_shared<ast::expr::Int>( state.current->position(), std::strtoll( peelo::unicode::encoding::utf8::encode( *state.current->text() ).c_str(), nullptr, 10 ) ); break; case cst::Kind::Str: expr = std::make_shared<ast::expr::Str>( state.current->position(), *state.current->text() ); break; case cst::Kind::Id: expr = std::make_shared<ast::expr::Id>( state.current->position(), *state.current->text() ); break; case cst::Kind::LeftBracket: return parse_list_expr(state); case cst::Kind::LeftBrace: return parse_record_expr(state); case cst::Kind::LeftParen: return state.peek_func() ? parse_func(state) : parse_parenthesized_expr(state); case cst::Kind::KeywordNull: expr = std::make_shared<ast::expr::Null>(state.current->position()); break; case cst::Kind::KeywordFalse: expr = std::make_shared<ast::expr::Bool>( state.current->position(), false ); break; case cst::Kind::KeywordTrue: expr = std::make_shared<ast::expr::Bool>( state.current->position(), true ); break; default: return result_type::error({ state.current->position(), U"Unexpected " + cst::to_string(state.current->kind()) + U"; Missing expression." }); } ++state.current; return result_type::ok(expr); } static result_type parse_call_expr( State& state, const ast::Position& position, const std::shared_ptr<ast::expr::RValue>& callee, bool optional ) { const auto arguments = parse_expr_list( state, position, cst::Kind::RightParen, U"argument list" ); if (!arguments) { return result_type::error(arguments.error()); } return result_type::ok(std::make_shared<ast::expr::Call>( position, callee, arguments.value(), optional )); } static result_type parse_field_expr( State& state, const ast::Position& position, const std::shared_ptr<ast::expr::RValue>& record, bool optional ) { if (state.eof() || state.current->kind() != cst::Kind::Id) { return result_type::error({ position, U"Missing identifier after `.'." }); } return result_type::ok(std::make_shared<ast::expr::Field>( position, record, *(state.current++)->text(), optional )); } static result_type parse_subscript_expr( State& state, const ast::Position& position, const std::shared_ptr<ast::expr::RValue>& record, bool optional ) { const auto field_result = parse(state, position); if (!field_result) { return field_result; } else if (!state.peek_read(cst::Kind::RightBracket)) { return result_type::error({ position, U"Missing `]' after the expression.", }); } return result_type::ok(std::make_shared<ast::expr::Subscript>( position, record, field_result.value(), optional )); } static result_type parse_conditional_selector( State& state, const std::shared_ptr<ast::expr::RValue>& target ) { const auto position = state.current++->position(); if (state.eof()) { return result_type::error({ position, U"Unexpected end of input after `?.'." }); } switch (state.current->kind()) { case cst::Kind::Id: return parse_field_expr( state, state.current->position(), target, true ); case cst::Kind::LeftBracket: return parse_subscript_expr( state, state.current++->position(), target, true ); case cst::Kind::LeftParen: return parse_call_expr( state, state.current++->position(), target, true ); default: return result_type::error({ position, U"Unexpected " + cst::to_string(state.current->kind()) + U" after `?.'." }); } } static result_type parse_selector( State& state, const std::shared_ptr<ast::expr::RValue>& target ) { const auto& selector = *state.current++; if (selector.kind() == cst::Kind::LeftParen) { return parse_call_expr(state, selector.position(), target, false); } else if (selector.kind() == cst::Kind::Dot) { return parse_field_expr(state, selector.position(), target, false); } else { return parse_subscript_expr(state, selector.position(), target, false); } } static result_type parse_unary_expr( State& state, const std::optional<ast::Position>& position ) { if (state.peek(cst::Kind::Not) || state.peek(cst::Kind::Add) || state.peek(cst::Kind::Sub) || state.peek(cst::Kind::BitwiseNot)) { const auto kind = state.current->kind(); const auto new_position = state.current++->position(); const auto expression = parse_unary_expr(state, new_position); if (!expression) { return expression; } return result_type::ok(std::make_shared<ast::expr::Unary>( new_position, kind == cst::Kind::Not ? ast::expr::UnaryOperator::Not : kind == cst::Kind::Add ? ast::expr::UnaryOperator::Add : kind == cst::Kind::Sub ? ast::expr::UnaryOperator::Sub : ast::expr::UnaryOperator::BitwiseNot, expression.value() )); } else { auto result = parse_primary_expr(state, position); if (!result) { return result; } while (state.peek(cst::Kind::Dot) || state.peek(cst::Kind::LeftParen) || state.peek(cst::Kind::LeftBracket) || state.peek(cst::Kind::ConditionalDot)) { if (state.peek(cst::Kind::ConditionalDot)) { if (!(result = parse_conditional_selector(state, result.value()))) { return result; } } else if (!(result = parse_selector(state, result.value()))) { return result; } } return result; } } static result_type parse_multiplicative_expr( State& state, const std::optional<ast::Position>& position ) { auto expression = parse_unary_expr(state, position); if (!expression) { return expression; } while (state.peek(cst::Kind::Mul) || state.peek(cst::Kind::Div) || state.peek(cst::Kind::Mod) || state.peek(cst::Kind::BitwiseXor) || state.peek(cst::Kind::LeftShift) || state.peek(cst::Kind::RightShift) || state.peek(cst::Kind::LogicalAnd) || state.peek(cst::Kind::LogicalOr)) { const auto new_position = state.current->position(); const auto kind = state.current++->kind(); const auto operand = parse_unary_expr(state, new_position); if (!operand) { return operand; } expression = result_type::ok(std::make_shared<ast::expr::Binary>( new_position, expression.value(), kind == cst::Kind::Mul ? ast::expr::BinaryOperator::Mul : kind == cst::Kind::Div ? ast::expr::BinaryOperator::Div : kind == cst::Kind::Mod ? ast::expr::BinaryOperator::Mod : kind == cst::Kind::BitwiseXor ? ast::expr::BinaryOperator::BitwiseXor : kind == cst::Kind::LeftShift ? ast::expr::BinaryOperator::LeftShift : kind == cst::Kind::RightShift ? ast::expr::BinaryOperator::RightShift : kind == cst::Kind::LogicalAnd ? ast::expr::BinaryOperator::LogicalAnd : ast::expr::BinaryOperator::LogicalOr, operand.value() )); } return expression; } static result_type parse_additive_expression( State& state, const std::optional<ast::Position>& position ) { auto expression = parse_multiplicative_expr(state, position); if (!expression) { return expression; } while (state.peek(cst::Kind::Add) || state.peek(cst::Kind::Sub)) { const auto new_position = state.current->position(); const auto kind = state.current++->kind(); const auto operand = parse_multiplicative_expr(state, new_position); if (!operand) { return operand; } expression = result_type::ok(std::make_shared<ast::expr::Binary>( new_position, expression.value(), kind == cst::Kind::Add ? ast::expr::BinaryOperator::Add : ast::expr::BinaryOperator::Sub, operand.value() )); } return expression; } static result_type parse_relational_expr( State& state, const std::optional<ast::Position>& position ) { auto expression = parse_additive_expression(state, position); if (!expression) { return expression; } while (state.peek(cst::Kind::Lt) || state.peek(cst::Kind::Gt) || state.peek(cst::Kind::Lte) || state.peek(cst::Kind::Gte)) { const auto new_position = state.current->position(); const auto kind = state.current++->kind(); const auto operand = parse_additive_expression(state, new_position); if (!operand) { return operand; } expression = result_type::ok(std::make_shared<ast::expr::Binary>( new_position, expression.value(), kind == cst::Kind::Lt ? ast::expr::BinaryOperator::Lt : kind == cst::Kind::Gt ? ast::expr::BinaryOperator::Gt : kind == cst::Kind::Lte ? ast::expr::BinaryOperator::Lte : ast::expr::BinaryOperator::Gte, operand.value() )); } return expression; } static result_type parse_equality_expr( State& state, const std::optional<ast::Position>& position ) { auto expression = parse_relational_expr(state, position); if (!expression) { return expression; } while (state.peek(cst::Kind::Eq) || state.peek(cst::Kind::Ne)) { const auto new_position = state.current->position(); const auto kind = state.current++->kind(); const auto operand = parse_relational_expr(state, new_position); if (!operand) { return operand; } expression = result_type::ok(std::make_shared<ast::expr::Binary>( new_position, expression.value(), kind == cst::Kind::Eq ? ast::expr::BinaryOperator::Eq : ast::expr::BinaryOperator::Ne, operand.value() )); } return expression; } result_type parse(State& state, const std::optional<ast::Position>& position) { return parse_equality_expr(state, position); } }
25.543243
79
0.577082
RauliL
d4c5ddd1faf81ce27d6095efed0d55742209d34e
364
cpp
C++
Tek2/PSU/Zappy/client/src/main.cpp
PhilippeDeSousa/EpitechBundle
5981d424c7dd25a5fbae79172e6a14db27ba985d
[ "MIT" ]
1
2019-03-14T19:05:58.000Z
2019-03-14T19:05:58.000Z
Tek2/PSU/Zappy/client/src/main.cpp
PhilippeDeSousa/EpitechBundle
5981d424c7dd25a5fbae79172e6a14db27ba985d
[ "MIT" ]
null
null
null
Tek2/PSU/Zappy/client/src/main.cpp
PhilippeDeSousa/EpitechBundle
5981d424c7dd25a5fbae79172e6a14db27ba985d
[ "MIT" ]
null
null
null
/* ** EPITECH PROJECT, 2018 ** zappy ** File description: ** main */ #include <exception> #include <iostream> #include <cstdlib> #include <ctime> #include "Errors.hpp" #include "Client.hpp" int main(int ac, char **av) { std::srand(std::time(nullptr)); try { zappy::Client Cl(ac, av); } catch (std::exception &e) { std::cerr << e.what() << std::endl; } }
15.166667
37
0.626374
PhilippeDeSousa
d4c65ed64bf7348080b11a9e4a280d06404a084c
912
hpp
C++
concepts/ComponentEntity/GeneratedEntity_TestEntity.hpp
hyfloac/TauEngine
1559b2a6e6d1887b8ee02932fe0aa6e5b9d5652c
[ "MIT" ]
1
2020-04-22T04:07:01.000Z
2020-04-22T04:07:01.000Z
concepts/ComponentEntity/GeneratedEntity_TestEntity.hpp
hyfloac/TauEngine
1559b2a6e6d1887b8ee02932fe0aa6e5b9d5652c
[ "MIT" ]
null
null
null
concepts/ComponentEntity/GeneratedEntity_TestEntity.hpp
hyfloac/TauEngine
1559b2a6e6d1887b8ee02932fe0aa6e5b9d5652c
[ "MIT" ]
null
null
null
#pragma once #include "Entity.hpp" #include <cstdint> #include "./ForwardComponent.hpp" #include "./FloatComponent.hpp" class TestEntity : public Entity { public: ForwardComponent* _comp0; FloatComponent* _comp1; TestEntity() { std::uint8_t* rawBuf = new std::uint8_t[8]; _comp0 = new(rawBuf + 0) ForwardComponent; _comp1 = new(rawBuf + 4) FloatComponent; } ~TestEntity() { _comp0->~ForwardComponent(); _comp1->~FloatComponent(); delete _comp0; } void onEvent(Event& event) override { _comp0->onEvent(event, this); _comp1->onEvent(event, this); } void onUpdate(float fixedDelta) override { _comp0->onUpdate(fixedDelta, this); _comp1->onUpdate(fixedDelta, this); } void onRender(float delta) override { _comp0->onRender(delta, this); _comp1->onRender(delta, this); } };
28.5
51
0.626096
hyfloac
d4c7113d488d4ed7caaf366990672537dd03ca9e
2,755
cpp
C++
src/App.cpp
nirustim/openGLproject
51cdd160694be055dcca2ec97d1f74963c9e0796
[ "MIT" ]
null
null
null
src/App.cpp
nirustim/openGLproject
51cdd160694be055dcca2ec97d1f74963c9e0796
[ "MIT" ]
null
null
null
src/App.cpp
nirustim/openGLproject
51cdd160694be055dcca2ec97d1f74963c9e0796
[ "MIT" ]
null
null
null
#include "App.hpp" App::App() { Engine::Log("Object Made"); } App::~App() { Engine::Log("Object Destroyed"); } void App::Run() { if (appState == AppState::ON) Engine::FatalError("App already running."); Engine::Init(); unsigned int windowFlags = 0; // windowFlags |= Engine::WindowFlags::FULLSCREEN; // windowFlags |= Engine::WindowFlags::BORDERLESS; window.Create("Engine", 800, 600, windowFlags); Load(); appState = AppState::ON; Loop(); } void App::Load() { // build and compile shader program shader.Compile("assets/shaders/3.1.shader.vs", "assets/shaders/3.1.shader.fs"); shader.Link(); float vertices[] = { // first triangle -0.5f, -0.5f, 0.0f, // left 0.5f, -0.5f, 0.0f, // right 0.0f, 0.5f, 0.0f, // top -0.25f, 0.f, 0.0f, // left middle 0.0f, -0.5f, 0.0f, // center bottom 0.25f, 0.0f, 0.0f, // right middle }; // VBO VAO glGenVertexArrays(1, &VAO); glGenBuffers(1, &VBO); // binding vertex array object glBindVertexArray(VAO); // copying vertices array to a buffer glBindBuffer(GL_ARRAY_BUFFER, VBO); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); // setting vertex attribute pointers glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void *)0); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); // unbind vertex glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); } void App::Loop() { while (appState == AppState::ON) { Update(); Draw(); // Get SDL to swap our buffer window.SwapBuffer(); LateUpdate(); FixedUpdate(0.0f); InputUpdate(); } } void App::Update() {} void App::Draw() { glClearColor(0.2f, 0.3f, 0.3f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); // take care to activate shader program before calling to uniforms shader.Use(); // update shader uniform double timeValue = SDL_GetTicks() / 1000; float greenValue = static_cast<float>(sin(timeValue) / 2.0 + 0.5); // int vertexColorLocation = glGetUniformLocation(shaderProgram, "ourColor"); // glUniform4f(vertexColorLocation, 0.0f, greenValue, 0.0f, 1.0f); shader.SetVec4("ourColor", glm::vec4(0.0f, greenValue, 0.0f, 1.0f)); // rendering triangle to window glBindVertexArray(VAO); glDrawArrays(GL_TRIANGLES, 0, 6); glBindVertexArray(0); shader.UnUse(); } void App::LateUpdate() {} void App::FixedUpdate(float _delta_time) {} void App::InputUpdate() { SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: appState = AppState::OFF; break; case SDL_MOUSEMOTION: break; case SDL_KEYUP: break; case SDL_KEYDOWN: break; } } }
22.04
81
0.645735
nirustim
d4c90981421e399bd426d12275f0b0585b59a7c4
27,740
cc
C++
dg/src/DgClient.cc
aliyun/aliyun-openapi-cpp-sdk
0cf5861ece17dfb0bb251f13bf3fbdb39c0c6e36
[ "Apache-2.0" ]
89
2018-02-02T03:54:39.000Z
2021-12-13T01:32:55.000Z
dg/src/DgClient.cc
aliyun/aliyun-openapi-cpp-sdk
0cf5861ece17dfb0bb251f13bf3fbdb39c0c6e36
[ "Apache-2.0" ]
89
2018-03-14T07:44:54.000Z
2021-11-26T07:43:25.000Z
dg/src/DgClient.cc
aliyun/aliyun-openapi-cpp-sdk
0cf5861ece17dfb0bb251f13bf3fbdb39c0c6e36
[ "Apache-2.0" ]
69
2018-01-22T09:45:52.000Z
2022-03-28T07:58:38.000Z
/* * Copyright 2009-2017 Alibaba Cloud All rights reserved. * * 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. */ #include <alibabacloud/dg/DgClient.h> #include <alibabacloud/core/SimpleCredentialsProvider.h> using namespace AlibabaCloud; using namespace AlibabaCloud::Location; using namespace AlibabaCloud::Dg; using namespace AlibabaCloud::Dg::Model; namespace { const std::string SERVICE_NAME = "dg"; } DgClient::DgClient(const Credentials &credentials, const ClientConfiguration &configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration) { auto locationClient = std::make_shared<LocationClient>(credentials, configuration); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dg"); } DgClient::DgClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dg"); } DgClient::DgClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dg"); } DgClient::~DgClient() {} DgClient::AddDatabaseOutcome DgClient::addDatabase(const AddDatabaseRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return AddDatabaseOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return AddDatabaseOutcome(AddDatabaseResult(outcome.result())); else return AddDatabaseOutcome(outcome.error()); } void DgClient::addDatabaseAsync(const AddDatabaseRequest& request, const AddDatabaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, addDatabase(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::AddDatabaseOutcomeCallable DgClient::addDatabaseCallable(const AddDatabaseRequest &request) const { auto task = std::make_shared<std::packaged_task<AddDatabaseOutcome()>>( [this, request]() { return this->addDatabase(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::AddDatabaseListOutcome DgClient::addDatabaseList(const AddDatabaseListRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return AddDatabaseListOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return AddDatabaseListOutcome(AddDatabaseListResult(outcome.result())); else return AddDatabaseListOutcome(outcome.error()); } void DgClient::addDatabaseListAsync(const AddDatabaseListRequest& request, const AddDatabaseListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, addDatabaseList(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::AddDatabaseListOutcomeCallable DgClient::addDatabaseListCallable(const AddDatabaseListRequest &request) const { auto task = std::make_shared<std::packaged_task<AddDatabaseListOutcome()>>( [this, request]() { return this->addDatabaseList(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::ConnectDatabaseOutcome DgClient::connectDatabase(const ConnectDatabaseRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return ConnectDatabaseOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return ConnectDatabaseOutcome(ConnectDatabaseResult(outcome.result())); else return ConnectDatabaseOutcome(outcome.error()); } void DgClient::connectDatabaseAsync(const ConnectDatabaseRequest& request, const ConnectDatabaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, connectDatabase(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::ConnectDatabaseOutcomeCallable DgClient::connectDatabaseCallable(const ConnectDatabaseRequest &request) const { auto task = std::make_shared<std::packaged_task<ConnectDatabaseOutcome()>>( [this, request]() { return this->connectDatabase(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::CreateDatabaseAccessPointOutcome DgClient::createDatabaseAccessPoint(const CreateDatabaseAccessPointRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return CreateDatabaseAccessPointOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return CreateDatabaseAccessPointOutcome(CreateDatabaseAccessPointResult(outcome.result())); else return CreateDatabaseAccessPointOutcome(outcome.error()); } void DgClient::createDatabaseAccessPointAsync(const CreateDatabaseAccessPointRequest& request, const CreateDatabaseAccessPointAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, createDatabaseAccessPoint(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::CreateDatabaseAccessPointOutcomeCallable DgClient::createDatabaseAccessPointCallable(const CreateDatabaseAccessPointRequest &request) const { auto task = std::make_shared<std::packaged_task<CreateDatabaseAccessPointOutcome()>>( [this, request]() { return this->createDatabaseAccessPoint(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::CreateGatewayOutcome DgClient::createGateway(const CreateGatewayRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return CreateGatewayOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return CreateGatewayOutcome(CreateGatewayResult(outcome.result())); else return CreateGatewayOutcome(outcome.error()); } void DgClient::createGatewayAsync(const CreateGatewayRequest& request, const CreateGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, createGateway(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::CreateGatewayOutcomeCallable DgClient::createGatewayCallable(const CreateGatewayRequest &request) const { auto task = std::make_shared<std::packaged_task<CreateGatewayOutcome()>>( [this, request]() { return this->createGateway(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::CreateGatewayVerifyCodeOutcome DgClient::createGatewayVerifyCode(const CreateGatewayVerifyCodeRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return CreateGatewayVerifyCodeOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return CreateGatewayVerifyCodeOutcome(CreateGatewayVerifyCodeResult(outcome.result())); else return CreateGatewayVerifyCodeOutcome(outcome.error()); } void DgClient::createGatewayVerifyCodeAsync(const CreateGatewayVerifyCodeRequest& request, const CreateGatewayVerifyCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, createGatewayVerifyCode(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::CreateGatewayVerifyCodeOutcomeCallable DgClient::createGatewayVerifyCodeCallable(const CreateGatewayVerifyCodeRequest &request) const { auto task = std::make_shared<std::packaged_task<CreateGatewayVerifyCodeOutcome()>>( [this, request]() { return this->createGatewayVerifyCode(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::DeleteDatabaseOutcome DgClient::deleteDatabase(const DeleteDatabaseRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return DeleteDatabaseOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return DeleteDatabaseOutcome(DeleteDatabaseResult(outcome.result())); else return DeleteDatabaseOutcome(outcome.error()); } void DgClient::deleteDatabaseAsync(const DeleteDatabaseRequest& request, const DeleteDatabaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, deleteDatabase(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::DeleteDatabaseOutcomeCallable DgClient::deleteDatabaseCallable(const DeleteDatabaseRequest &request) const { auto task = std::make_shared<std::packaged_task<DeleteDatabaseOutcome()>>( [this, request]() { return this->deleteDatabase(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::DeleteDatabaseAccessPointOutcome DgClient::deleteDatabaseAccessPoint(const DeleteDatabaseAccessPointRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return DeleteDatabaseAccessPointOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return DeleteDatabaseAccessPointOutcome(DeleteDatabaseAccessPointResult(outcome.result())); else return DeleteDatabaseAccessPointOutcome(outcome.error()); } void DgClient::deleteDatabaseAccessPointAsync(const DeleteDatabaseAccessPointRequest& request, const DeleteDatabaseAccessPointAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, deleteDatabaseAccessPoint(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::DeleteDatabaseAccessPointOutcomeCallable DgClient::deleteDatabaseAccessPointCallable(const DeleteDatabaseAccessPointRequest &request) const { auto task = std::make_shared<std::packaged_task<DeleteDatabaseAccessPointOutcome()>>( [this, request]() { return this->deleteDatabaseAccessPoint(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::DeleteGatewayOutcome DgClient::deleteGateway(const DeleteGatewayRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return DeleteGatewayOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return DeleteGatewayOutcome(DeleteGatewayResult(outcome.result())); else return DeleteGatewayOutcome(outcome.error()); } void DgClient::deleteGatewayAsync(const DeleteGatewayRequest& request, const DeleteGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, deleteGateway(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::DeleteGatewayOutcomeCallable DgClient::deleteGatewayCallable(const DeleteGatewayRequest &request) const { auto task = std::make_shared<std::packaged_task<DeleteGatewayOutcome()>>( [this, request]() { return this->deleteGateway(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::DeleteGatewayInstanceOutcome DgClient::deleteGatewayInstance(const DeleteGatewayInstanceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return DeleteGatewayInstanceOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return DeleteGatewayInstanceOutcome(DeleteGatewayInstanceResult(outcome.result())); else return DeleteGatewayInstanceOutcome(outcome.error()); } void DgClient::deleteGatewayInstanceAsync(const DeleteGatewayInstanceRequest& request, const DeleteGatewayInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, deleteGatewayInstance(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::DeleteGatewayInstanceOutcomeCallable DgClient::deleteGatewayInstanceCallable(const DeleteGatewayInstanceRequest &request) const { auto task = std::make_shared<std::packaged_task<DeleteGatewayInstanceOutcome()>>( [this, request]() { return this->deleteGatewayInstance(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::DescribeRegionsOutcome DgClient::describeRegions(const DescribeRegionsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return DescribeRegionsOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return DescribeRegionsOutcome(DescribeRegionsResult(outcome.result())); else return DescribeRegionsOutcome(outcome.error()); } void DgClient::describeRegionsAsync(const DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, describeRegions(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::DescribeRegionsOutcomeCallable DgClient::describeRegionsCallable(const DescribeRegionsRequest &request) const { auto task = std::make_shared<std::packaged_task<DescribeRegionsOutcome()>>( [this, request]() { return this->describeRegions(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::DownloadGatewayProgramOutcome DgClient::downloadGatewayProgram(const DownloadGatewayProgramRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return DownloadGatewayProgramOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return DownloadGatewayProgramOutcome(DownloadGatewayProgramResult(outcome.result())); else return DownloadGatewayProgramOutcome(outcome.error()); } void DgClient::downloadGatewayProgramAsync(const DownloadGatewayProgramRequest& request, const DownloadGatewayProgramAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, downloadGatewayProgram(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::DownloadGatewayProgramOutcomeCallable DgClient::downloadGatewayProgramCallable(const DownloadGatewayProgramRequest &request) const { auto task = std::make_shared<std::packaged_task<DownloadGatewayProgramOutcome()>>( [this, request]() { return this->downloadGatewayProgram(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::FindUserGatewayByIdOutcome DgClient::findUserGatewayById(const FindUserGatewayByIdRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return FindUserGatewayByIdOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return FindUserGatewayByIdOutcome(FindUserGatewayByIdResult(outcome.result())); else return FindUserGatewayByIdOutcome(outcome.error()); } void DgClient::findUserGatewayByIdAsync(const FindUserGatewayByIdRequest& request, const FindUserGatewayByIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, findUserGatewayById(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::FindUserGatewayByIdOutcomeCallable DgClient::findUserGatewayByIdCallable(const FindUserGatewayByIdRequest &request) const { auto task = std::make_shared<std::packaged_task<FindUserGatewayByIdOutcome()>>( [this, request]() { return this->findUserGatewayById(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::GetUserDatabasesOutcome DgClient::getUserDatabases(const GetUserDatabasesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return GetUserDatabasesOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return GetUserDatabasesOutcome(GetUserDatabasesResult(outcome.result())); else return GetUserDatabasesOutcome(outcome.error()); } void DgClient::getUserDatabasesAsync(const GetUserDatabasesRequest& request, const GetUserDatabasesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, getUserDatabases(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::GetUserDatabasesOutcomeCallable DgClient::getUserDatabasesCallable(const GetUserDatabasesRequest &request) const { auto task = std::make_shared<std::packaged_task<GetUserDatabasesOutcome()>>( [this, request]() { return this->getUserDatabases(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::GetUserGatewayInstancesOutcome DgClient::getUserGatewayInstances(const GetUserGatewayInstancesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return GetUserGatewayInstancesOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return GetUserGatewayInstancesOutcome(GetUserGatewayInstancesResult(outcome.result())); else return GetUserGatewayInstancesOutcome(outcome.error()); } void DgClient::getUserGatewayInstancesAsync(const GetUserGatewayInstancesRequest& request, const GetUserGatewayInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, getUserGatewayInstances(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::GetUserGatewayInstancesOutcomeCallable DgClient::getUserGatewayInstancesCallable(const GetUserGatewayInstancesRequest &request) const { auto task = std::make_shared<std::packaged_task<GetUserGatewayInstancesOutcome()>>( [this, request]() { return this->getUserGatewayInstances(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::GetUserGatewaysOutcome DgClient::getUserGateways(const GetUserGatewaysRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return GetUserGatewaysOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return GetUserGatewaysOutcome(GetUserGatewaysResult(outcome.result())); else return GetUserGatewaysOutcome(outcome.error()); } void DgClient::getUserGatewaysAsync(const GetUserGatewaysRequest& request, const GetUserGatewaysAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, getUserGateways(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::GetUserGatewaysOutcomeCallable DgClient::getUserGatewaysCallable(const GetUserGatewaysRequest &request) const { auto task = std::make_shared<std::packaged_task<GetUserGatewaysOutcome()>>( [this, request]() { return this->getUserGateways(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::ListDatabaseAccessPointOutcome DgClient::listDatabaseAccessPoint(const ListDatabaseAccessPointRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return ListDatabaseAccessPointOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return ListDatabaseAccessPointOutcome(ListDatabaseAccessPointResult(outcome.result())); else return ListDatabaseAccessPointOutcome(outcome.error()); } void DgClient::listDatabaseAccessPointAsync(const ListDatabaseAccessPointRequest& request, const ListDatabaseAccessPointAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, listDatabaseAccessPoint(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::ListDatabaseAccessPointOutcomeCallable DgClient::listDatabaseAccessPointCallable(const ListDatabaseAccessPointRequest &request) const { auto task = std::make_shared<std::packaged_task<ListDatabaseAccessPointOutcome()>>( [this, request]() { return this->listDatabaseAccessPoint(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::ModifyDatabaseOutcome DgClient::modifyDatabase(const ModifyDatabaseRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return ModifyDatabaseOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return ModifyDatabaseOutcome(ModifyDatabaseResult(outcome.result())); else return ModifyDatabaseOutcome(outcome.error()); } void DgClient::modifyDatabaseAsync(const ModifyDatabaseRequest& request, const ModifyDatabaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, modifyDatabase(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::ModifyDatabaseOutcomeCallable DgClient::modifyDatabaseCallable(const ModifyDatabaseRequest &request) const { auto task = std::make_shared<std::packaged_task<ModifyDatabaseOutcome()>>( [this, request]() { return this->modifyDatabase(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::ModifyGatewayOutcome DgClient::modifyGateway(const ModifyGatewayRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return ModifyGatewayOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return ModifyGatewayOutcome(ModifyGatewayResult(outcome.result())); else return ModifyGatewayOutcome(outcome.error()); } void DgClient::modifyGatewayAsync(const ModifyGatewayRequest& request, const ModifyGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, modifyGateway(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::ModifyGatewayOutcomeCallable DgClient::modifyGatewayCallable(const ModifyGatewayRequest &request) const { auto task = std::make_shared<std::packaged_task<ModifyGatewayOutcome()>>( [this, request]() { return this->modifyGateway(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::RetryDatabaseOutcome DgClient::retryDatabase(const RetryDatabaseRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return RetryDatabaseOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return RetryDatabaseOutcome(RetryDatabaseResult(outcome.result())); else return RetryDatabaseOutcome(outcome.error()); } void DgClient::retryDatabaseAsync(const RetryDatabaseRequest& request, const RetryDatabaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, retryDatabase(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::RetryDatabaseOutcomeCallable DgClient::retryDatabaseCallable(const RetryDatabaseRequest &request) const { auto task = std::make_shared<std::packaged_task<RetryDatabaseOutcome()>>( [this, request]() { return this->retryDatabase(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); } DgClient::StopGatewayOutcome DgClient::stopGateway(const StopGatewayRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) return StopGatewayOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) return StopGatewayOutcome(StopGatewayResult(outcome.result())); else return StopGatewayOutcome(outcome.error()); } void DgClient::stopGatewayAsync(const StopGatewayRequest& request, const StopGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const { auto fn = [this, request, handler, context]() { handler(this, request, stopGateway(request), context); }; asyncExecute(new Runnable(fn)); } DgClient::StopGatewayOutcomeCallable DgClient::stopGatewayCallable(const StopGatewayRequest &request) const { auto task = std::make_shared<std::packaged_task<StopGatewayOutcome()>>( [this, request]() { return this->stopGateway(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); return task->get_future(); }
34.246914
212
0.778767
aliyun
d4cd8498727cc0992fb635801b77c94cbe85b855
11,384
cpp
C++
Source/src/Modules/ModuleRender.cpp
Erick9Thor/Engine3D
32d78f79723fb7c319f79d5e26cdc26481d5cb35
[ "MIT" ]
1
2021-11-17T19:20:07.000Z
2021-11-17T19:20:07.000Z
Source/src/Modules/ModuleRender.cpp
Erick9Thor/Engine3D
32d78f79723fb7c319f79d5e26cdc26481d5cb35
[ "MIT" ]
null
null
null
Source/src/Modules/ModuleRender.cpp
Erick9Thor/Engine3D
32d78f79723fb7c319f79d5e26cdc26481d5cb35
[ "MIT" ]
null
null
null
#include "../Globals.h" #include "../Application.h" #include "../Utils/Logger.h" #include "ModuleRender.h" #include "ModuleWindow.h" #include "ModuleProgram.h" #include "ModuleCamera.h" #include "ModuleDebugDraw.h" #include "ModuleSceneManager.h" #include "ModuleEditor.h" #include "../Scene.h" #include "../Skybox.h" #include "../Quadtree.h" #include "../GameObject.h" #include "../Components/ComponentCamera.h" #include "SDL.h" #include "glew.h" #include "MathGeoLib.h" #include "il.h" #include "ilu.h" #include "imgui.h" #include "imgui_impl_sdl.h" #include "imgui_impl_opengl3.h" ModuleRender::ModuleRender() { } ModuleRender::~ModuleRender() { } void __stdcall OurOpenGLErrorFunction(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); bool ModuleRender::Init() { LOG("Init Module render"); CreateContext(); RetrieveGpuInfo(); RetrieveLibVersions(); SetGLOptions(); GenerateFrameBuffer(); #ifdef _DEBUG glEnable(GL_DEBUG_OUTPUT); // Enable output callback glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); glDebugMessageCallback(&OurOpenGLErrorFunction, nullptr); // Set the callback glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true); // Filter notifications #endif fps_log = std::vector<float>(n_bins); ms_log = std::vector<float>(n_bins); return true; } void ModuleRender::GenerateFrameBuffer() { glGenFramebuffers(1, &frame_buffer); glBindFramebuffer(GL_FRAMEBUFFER, frame_buffer); glGenTextures(1, &fb_texture); glBindTexture(GL_TEXTURE_2D, fb_texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 800, 600, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_2D, 0); //Depth and stencil buffer glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fb_texture, 0); glGenRenderbuffers(1, &depth_stencil_buffer); glBindRenderbuffer(GL_RENDERBUFFER, depth_stencil_buffer); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 800, 600); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depth_stencil_buffer); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { LOG("Error creating frame buffer"); } glBindRenderbuffer(GL_RENDERBUFFER, 0); glBindFramebuffer(GL_FRAMEBUFFER, 0); } void ModuleRender::ResizeFrameBuffer(int heigth, int width) { glBindTexture(GL_TEXTURE_2D, fb_texture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, heigth, width, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); glBindTexture(GL_TEXTURE_2D, 0); glBindRenderbuffer(GL_RENDERBUFFER, depth_stencil_buffer); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, heigth, width); glBindRenderbuffer(GL_RENDERBUFFER, 0); } void ModuleRender::ManageResolution(ComponentCamera* camera) { unsigned res_x, res_y; camera->GetResolution(res_x, res_y); if (res_x != fb_height || res_y != fb_width) { ResizeFrameBuffer(res_x, res_y); glViewport(0, 0, res_x, res_y); fb_height = res_x; fb_width = res_y; } } void ModuleRender::CreateContext() { LOG("Creating Renderer context"); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); // desired version SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 6); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); // we want a double buffer SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); // we want to have a depth buffer with 24 bits SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); // we want to have a stencil buffer with 8 bits SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG); // enable context debug context = SDL_GL_CreateContext(App->window->GetWindow()); GLenum err = glewInit(); clear_color = float4(0.1f, 0.1f, 0.1f, 1.0f); } void ModuleRender::SetGLOptions() { glEnable(GL_DEPTH_TEST); // Enable depth test glEnable(GL_CULL_FACE); // Enable cull backward faces glFrontFace(GL_CCW); // Front faces will be counter clockwise glEnable(GL_STENCIL_TEST); // Enable stencil test glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); // Only replace stencil value if stencil and depth tests pass } update_status ModuleRender::Update(const float delta) { ComponentCamera* camera = App->camera->GetMainCamera(); // Using debug camera to test culling App->program->UpdateCamera(camera); Scene* active_scene = App->scene_manager->GetActiveScene(); ComponentCamera* culling = active_scene->GetCullingCamera(); ComponentDirLight* dir_light = nullptr; if (active_scene->dir_lights.size() > 0) dir_light = active_scene->dir_lights[0]; App->program->UpdateLights(dir_light, active_scene->point_lights, active_scene->spot_lights); Draw(App->scene_manager->GetActiveScene(), camera, culling); return UPDATE_CONTINUE; } void ModuleRender::Draw(Scene* scene, ComponentCamera* camera, ComponentCamera* culling) { glBindFramebuffer(GL_FRAMEBUFFER, frame_buffer); ManageResolution(camera); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glStencilFunc(GL_ALWAYS, 1, 0XFF); glStencilMask(0x00); // Prevent background from filling stencil if (draw_skybox) scene->GetSkybox()->Draw(camera); else glClearColor(clear_color[0], clear_color[1], clear_color[2], clear_color[3]); float4x4 view = camera->GetViewMatrix(); float4x4 proj = camera->GetProjectionMatrix(); glStencilMask(0XFF); App->debug_draw->Draw(view, proj, fb_height, fb_width); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //Draw alternatives 0 optiomization, no quadtree // GameObject* root = scene->GetRoot(); //root->DrawAll(camera); //render_list.Update(culling, root); render_list.Update(culling, scene->GetQuadtree()->GetRoot()); Program* program = App->program->GetMainProgram(); program->Activate(); GameObject* selected_go = App->editor->GetSelectedGO(); RenderTarget* outline_target = nullptr; for (RenderTarget& target : render_list.GetNodes()) { target.game_object->Draw(camera, program); if (selected_go && target.game_object == selected_go) { outline_target = &target; } } program->Deactivate(); if (outline_selection && outline_target) { glStencilFunc(GL_NOTEQUAL, 1, 0XFF); glStencilMask(0X00); glDisable(GL_DEPTH_TEST); Program* outline_program = App->program->GetStencilProgram(); outline_program->Activate(); outline_target->game_object->DrawStencil(camera, outline_program); outline_program->Deactivate(); glStencilMask(0XFF); glStencilFunc(GL_ALWAYS, 0, 0xFF); glEnable(GL_DEPTH_TEST); } glBindFramebuffer(GL_FRAMEBUFFER, 0); } update_status ModuleRender::PostUpdate(const float delta) { SDL_GL_SwapWindow(App->window->GetWindow()); AddFrame(delta); return UPDATE_CONTINUE; } void GLOptionCheck(GLenum option, bool enable) { if (enable) glEnable(option); else glDisable(option); } void ModuleRender::OptionsMenu() { ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "Draw Options"); ImGui::Checkbox("Debug Draw", &App->debug_draw->debug_draw); ImGui::Checkbox("Quadtree", &App->debug_draw->draw_quadtree); ImGui::Checkbox("Skybox", &draw_skybox); if (!draw_skybox) ImGuiUtils::CompactColorPicker("Background Color", &clear_color[0]); } void ModuleRender::PerformanceMenu() { glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &vram_free); float vram_free_mb = vram_free / 1024.0f; float vram_usage_mb = gpu.vram_budget_mb - vram_free_mb; ImGui::Text("VRAM Budget: %.1f Mb", gpu.vram_budget_mb); ImGui::Text("Vram Usage: %.1f Mb", vram_usage_mb); ImGui::Text("Vram Avaliable: %.1f Mb", vram_free_mb); ImGui::Separator(); FpsGraph(); } void ModuleRender::FpsGraph() { ImGui::Text("Fps: %.1f", current_fps); char title[25]; sprintf_s(title, 25, "Framerate %.1f", current_fps); ImGui::PlotHistogram("##framerate", &fps_log[0], (int) fps_log.size(), 0, title, 0.0f, 1000.f, ImVec2(310, 100)); sprintf_s(title, 25, "Milliseconds %0.1f", current_ms); ImGui::PlotHistogram("##milliseconds", &ms_log[0], (int) ms_log.size(), 0, title, 0.0f, 20.0f, ImVec2(310, 100)); } void ModuleRender::AddFrame(const float delta) { static const float update_frequency_seconds = 0.5f; static int filled_bins = 0; static int frames = 0; static float time = 0; ++frames; time += delta; if (time >= update_frequency_seconds) { if (filled_bins == n_bins) { for (int i = 0; i < n_bins - 1; ++i) { fps_log[i] = fps_log[i + 1]; ms_log[i] = ms_log[i + 1]; } } else { ++filled_bins; } fps_log[filled_bins - 1] = float(frames) / time; current_fps = fps_log[filled_bins - 1]; ms_log[filled_bins - 1] = time * 1000.0f / float(frames); current_ms = ms_log[filled_bins - 1]; time = 0; frames = 0; } } void ModuleRender::RetrieveLibVersions() { gl.glew = (unsigned char*) glewGetString(GLEW_VERSION); gl.opengl = (unsigned char*) glGetString(GL_VERSION); gl.glsl = (unsigned char*) glGetString(GL_SHADING_LANGUAGE_VERSION); LOG("Using Glew %s", gl.glew); LOG("OpenGL version supported %s", gl.opengl); LOG("GLSL: %s", gl.glsl); } void ModuleRender::RetrieveGpuInfo() { gpu.name = (unsigned char*) glGetString(GL_RENDERER); gpu.brand = (unsigned char*) glGetString(GL_VENDOR); int vram_budget; glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &vram_budget); gpu.vram_budget_mb = (float) vram_budget / 1024.0f; } bool ModuleRender::CleanUp() { //LOG("Destroying renderer"); SDL_GL_DeleteContext(context); return true; } void __stdcall OurOpenGLErrorFunction(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) { const char *tmp_source = "", *tmp_type = "", *tmp_severity = ""; switch (source) { case GL_DEBUG_SOURCE_API: tmp_source = "API"; break; case GL_DEBUG_SOURCE_WINDOW_SYSTEM: tmp_source = "Window System"; break; case GL_DEBUG_SOURCE_SHADER_COMPILER: tmp_source = "Shader Compiler"; break; case GL_DEBUG_SOURCE_THIRD_PARTY: tmp_source = "Third Party"; break; case GL_DEBUG_SOURCE_APPLICATION: tmp_source = "Application"; break; case GL_DEBUG_SOURCE_OTHER: tmp_source = "Other"; break; }; switch (type) { case GL_DEBUG_TYPE_ERROR: tmp_type = "Error"; break; case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: tmp_type = "Deprecated Behaviour"; break; case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: tmp_type = "Undefined Behaviour"; break; case GL_DEBUG_TYPE_PORTABILITY: tmp_type = "Portability"; break; case GL_DEBUG_TYPE_PERFORMANCE: tmp_type = "Performance"; break; case GL_DEBUG_TYPE_MARKER: tmp_type = "Marker"; break; case GL_DEBUG_TYPE_PUSH_GROUP: tmp_type = "Push Group"; break; case GL_DEBUG_TYPE_POP_GROUP: tmp_type = "Pop Group"; break; case GL_DEBUG_TYPE_OTHER: tmp_type = "Other"; break; }; switch (severity) { case GL_DEBUG_SEVERITY_HIGH: tmp_severity = "high"; break; case GL_DEBUG_SEVERITY_MEDIUM: tmp_severity = "medium"; break; case GL_DEBUG_SEVERITY_LOW: return; // case GL_DEBUG_SEVERITY_NOTIFICATION: tmp_severity = "notification"; break; default: return; }; LOG("<Source:%s> <Type:%s> <Severity:%s> <ID:%d> <Message:%s>\n", tmp_source, tmp_type, tmp_severity, id, message); }
27.765854
156
0.746486
Erick9Thor
d4cd98a098614e5987d76a0215bd91020a0a5e6a
974,238
cpp
C++
cisco-ios-xr/ydk/models/cisco_ios_xr/fragmented/Cisco_IOS_XR_ipv4_bgp_oper_6.cpp
CiscoDevNet/ydk-cpp
ef7d75970f2ef1154100e0f7b0a2ee823609b481
[ "ECL-2.0", "Apache-2.0" ]
17
2016-12-02T05:45:49.000Z
2022-02-10T19:32:54.000Z
cisco-ios-xr/ydk/models/cisco_ios_xr/fragmented/Cisco_IOS_XR_ipv4_bgp_oper_6.cpp
CiscoDevNet/ydk-cpp
ef7d75970f2ef1154100e0f7b0a2ee823609b481
[ "ECL-2.0", "Apache-2.0" ]
2
2017-03-27T15:22:38.000Z
2019-11-05T08:30:16.000Z
cisco-ios-xr/ydk/models/cisco_ios_xr/fragmented/Cisco_IOS_XR_ipv4_bgp_oper_6.cpp
CiscoDevNet/ydk-cpp
ef7d75970f2ef1154100e0f7b0a2ee823609b481
[ "ECL-2.0", "Apache-2.0" ]
11
2016-12-02T05:45:52.000Z
2019-11-07T08:28:17.000Z
#include <sstream> #include <iostream> #include <ydk/entity_util.hpp> #include "bundle_info.hpp" #include "generated_entity_lookup.hpp" #include "Cisco_IOS_XR_ipv4_bgp_oper_6.hpp" #include "Cisco_IOS_XR_ipv4_bgp_oper_7.hpp" using namespace ydk; namespace cisco_ios_xr { namespace Cisco_IOS_XR_ipv4_bgp_oper { Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::RemoteAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::SpeakerIdInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "speaker-id-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::~SpeakerIdInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "speaker-id-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "speaker-id-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SpeakerIdInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::MinAdvertisementInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "min-advertisement-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::~MinAdvertisementInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "min-advertisement-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "min-advertisement-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MinAdvertisementInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::DescriptionInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "description-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::~DescriptionInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "description-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "description-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DescriptionInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::EbgpHopCountInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "ebgp-hop-count-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::~EbgpHopCountInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ebgp-hop-count-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "ebgp-hop-count-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpHopCountInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::TcpmssInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "tcpmss-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::~TcpmssInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "tcpmss-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "tcpmss-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TcpmssInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::BmpServersInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "bmp-servers-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::~BmpServersInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bmp-servers-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "bmp-servers-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::BmpServersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::KeychainInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "keychain-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::~KeychainInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "keychain-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "keychain-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::KeychainInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::LocalAsInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "local-as-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::~LocalAsInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "local-as-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "local-as-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAsInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::PasswordInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "password-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::~PasswordInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "password-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "password-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::PasswordInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::ReceiveBufferInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "receive-buffer-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::~ReceiveBufferInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "receive-buffer-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "receive-buffer-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ReceiveBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::SendBufferInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "send-buffer-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::~SendBufferInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "send-buffer-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "send-buffer-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::SendBufferInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::ShutdownInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "shutdown-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::~ShutdownInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "shutdown-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "shutdown-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::ShutdownInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::TimersInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "timers-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::~TimersInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "timers-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "timers-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::TimersInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::LocalAddressInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "local-address-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::~LocalAddressInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "local-address-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "local-address-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::LocalAddressInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::MsgLogInInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "msg-log-in-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::~MsgLogInInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "msg-log-in-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "msg-log-in-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogInInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::MsgLogOutInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "msg-log-out-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::~MsgLogOutInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "msg-log-out-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "msg-log-out-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::MsgLogOutInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::UpdateSourceInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "update-source-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::~UpdateSourceInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "update-source-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "update-source-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::UpdateSourceInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::DmzLinkBandwidthInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "dmz-link-bandwidth-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::~DmzLinkBandwidthInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "dmz-link-bandwidth-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "dmz-link-bandwidth-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::BgpConfigEntid() : address_family_identifier{YType::uint8, "address-family-identifier"}, configuration_type{YType::enumeration, "configuration-type"}, group_name{YType::str, "group-name"} , neighbor_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>()) { neighbor_address->parent = this; yang_name = "bgp-config-entid"; yang_parent_name = "inheritance-chain"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::~BgpConfigEntid() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::has_data() const { if (is_presence_container) return true; return address_family_identifier.is_set || configuration_type.is_set || group_name.is_set || (neighbor_address != nullptr && neighbor_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::has_operation() const { return is_set(yfilter) || ydk::is_set(address_family_identifier.yfilter) || ydk::is_set(configuration_type.yfilter) || ydk::is_set(group_name.yfilter) || (neighbor_address != nullptr && neighbor_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "bgp-config-entid"; path_buffer << "[" << get_ylist_key() << "]"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (address_family_identifier.is_set || is_set(address_family_identifier.yfilter)) leaf_name_data.push_back(address_family_identifier.get_name_leafdata()); if (configuration_type.is_set || is_set(configuration_type.yfilter)) leaf_name_data.push_back(configuration_type.get_name_leafdata()); if (group_name.is_set || is_set(group_name.yfilter)) leaf_name_data.push_back(group_name.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "neighbor-address") { if(neighbor_address == nullptr) { neighbor_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress>(); } return neighbor_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(neighbor_address != nullptr) { _children["neighbor-address"] = neighbor_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "address-family-identifier") { address_family_identifier = value; address_family_identifier.value_namespace = name_space; address_family_identifier.value_namespace_prefix = name_space_prefix; } if(value_path == "configuration-type") { configuration_type = value; configuration_type.value_namespace = name_space; configuration_type.value_namespace_prefix = name_space_prefix; } if(value_path == "group-name") { group_name = value; group_name.value_namespace = name_space; group_name.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "address-family-identifier") { address_family_identifier.yfilter = yfilter; } if(value_path == "configuration-type") { configuration_type.yfilter = yfilter; } if(value_path == "group-name") { group_name.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::has_leaf_or_child_of_name(const std::string & name) const { if(name == "neighbor-address" || name == "address-family-identifier" || name == "configuration-type" || name == "group-name") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::NeighborAddress() : afi{YType::enumeration, "afi"}, ipv4_address{YType::str, "ipv4-address"}, ipv4_mcast_address{YType::str, "ipv4-mcast-address"}, ipv4_label_address{YType::str, "ipv4-label-address"}, ipv4_tunnel_address{YType::str, "ipv4-tunnel-address"}, ipv4_mdt_address{YType::str, "ipv4-mdt-address"}, ipv4vpn_address{YType::str, "ipv4vpn-address"}, ipv4vpna_mcastddress{YType::str, "ipv4vpna-mcastddress"}, ipv6_address{YType::str, "ipv6-address"}, ipv6_mcast_address{YType::str, "ipv6-mcast-address"}, ipv6_label_address{YType::str, "ipv6-label-address"}, ipv6vpn_address{YType::str, "ipv6vpn-address"}, ipv6vpn_mcast_address{YType::str, "ipv6vpn-mcast-address"}, rt_constraint_address{YType::str, "rt-constraint-address"}, ipv6mvpn_address{YType::str, "ipv6mvpn-address"}, ipv4mvpn_address{YType::str, "ipv4mvpn-address"}, l2vpn_evpn_address{YType::str, "l2vpn-evpn-address"}, ls_ls_address{YType::str, "ls-ls-address"}, ipv4_flowspec_address{YType::str, "ipv4-flowspec-address"}, ipv6_flowspec_address{YType::str, "ipv6-flowspec-address"}, ipv4vpn_flowspec_address{YType::str, "ipv4vpn-flowspec-address"}, ipv6vpn_flowspec_address{YType::str, "ipv6vpn-flowspec-address"} , l2vpn_vpls_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>()) , l2vpn_mspw_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>()) , ipv4_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>()) , ipv6_sr_policy_address(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>()) { l2vpn_vpls_address->parent = this; l2vpn_mspw_address->parent = this; ipv4_sr_policy_address->parent = this; ipv6_sr_policy_address->parent = this; yang_name = "neighbor-address"; yang_parent_name = "bgp-config-entid"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::~NeighborAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_data() const { if (is_presence_container) return true; return afi.is_set || ipv4_address.is_set || ipv4_mcast_address.is_set || ipv4_label_address.is_set || ipv4_tunnel_address.is_set || ipv4_mdt_address.is_set || ipv4vpn_address.is_set || ipv4vpna_mcastddress.is_set || ipv6_address.is_set || ipv6_mcast_address.is_set || ipv6_label_address.is_set || ipv6vpn_address.is_set || ipv6vpn_mcast_address.is_set || rt_constraint_address.is_set || ipv6mvpn_address.is_set || ipv4mvpn_address.is_set || l2vpn_evpn_address.is_set || ls_ls_address.is_set || ipv4_flowspec_address.is_set || ipv6_flowspec_address.is_set || ipv4vpn_flowspec_address.is_set || ipv6vpn_flowspec_address.is_set || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_data()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_data()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_data()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(afi.yfilter) || ydk::is_set(ipv4_address.yfilter) || ydk::is_set(ipv4_mcast_address.yfilter) || ydk::is_set(ipv4_label_address.yfilter) || ydk::is_set(ipv4_tunnel_address.yfilter) || ydk::is_set(ipv4_mdt_address.yfilter) || ydk::is_set(ipv4vpn_address.yfilter) || ydk::is_set(ipv4vpna_mcastddress.yfilter) || ydk::is_set(ipv6_address.yfilter) || ydk::is_set(ipv6_mcast_address.yfilter) || ydk::is_set(ipv6_label_address.yfilter) || ydk::is_set(ipv6vpn_address.yfilter) || ydk::is_set(ipv6vpn_mcast_address.yfilter) || ydk::is_set(rt_constraint_address.yfilter) || ydk::is_set(ipv6mvpn_address.yfilter) || ydk::is_set(ipv4mvpn_address.yfilter) || ydk::is_set(l2vpn_evpn_address.yfilter) || ydk::is_set(ls_ls_address.yfilter) || ydk::is_set(ipv4_flowspec_address.yfilter) || ydk::is_set(ipv6_flowspec_address.yfilter) || ydk::is_set(ipv4vpn_flowspec_address.yfilter) || ydk::is_set(ipv6vpn_flowspec_address.yfilter) || (l2vpn_vpls_address != nullptr && l2vpn_vpls_address->has_operation()) || (l2vpn_mspw_address != nullptr && l2vpn_mspw_address->has_operation()) || (ipv4_sr_policy_address != nullptr && ipv4_sr_policy_address->has_operation()) || (ipv6_sr_policy_address != nullptr && ipv6_sr_policy_address->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "neighbor-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (afi.is_set || is_set(afi.yfilter)) leaf_name_data.push_back(afi.get_name_leafdata()); if (ipv4_address.is_set || is_set(ipv4_address.yfilter)) leaf_name_data.push_back(ipv4_address.get_name_leafdata()); if (ipv4_mcast_address.is_set || is_set(ipv4_mcast_address.yfilter)) leaf_name_data.push_back(ipv4_mcast_address.get_name_leafdata()); if (ipv4_label_address.is_set || is_set(ipv4_label_address.yfilter)) leaf_name_data.push_back(ipv4_label_address.get_name_leafdata()); if (ipv4_tunnel_address.is_set || is_set(ipv4_tunnel_address.yfilter)) leaf_name_data.push_back(ipv4_tunnel_address.get_name_leafdata()); if (ipv4_mdt_address.is_set || is_set(ipv4_mdt_address.yfilter)) leaf_name_data.push_back(ipv4_mdt_address.get_name_leafdata()); if (ipv4vpn_address.is_set || is_set(ipv4vpn_address.yfilter)) leaf_name_data.push_back(ipv4vpn_address.get_name_leafdata()); if (ipv4vpna_mcastddress.is_set || is_set(ipv4vpna_mcastddress.yfilter)) leaf_name_data.push_back(ipv4vpna_mcastddress.get_name_leafdata()); if (ipv6_address.is_set || is_set(ipv6_address.yfilter)) leaf_name_data.push_back(ipv6_address.get_name_leafdata()); if (ipv6_mcast_address.is_set || is_set(ipv6_mcast_address.yfilter)) leaf_name_data.push_back(ipv6_mcast_address.get_name_leafdata()); if (ipv6_label_address.is_set || is_set(ipv6_label_address.yfilter)) leaf_name_data.push_back(ipv6_label_address.get_name_leafdata()); if (ipv6vpn_address.is_set || is_set(ipv6vpn_address.yfilter)) leaf_name_data.push_back(ipv6vpn_address.get_name_leafdata()); if (ipv6vpn_mcast_address.is_set || is_set(ipv6vpn_mcast_address.yfilter)) leaf_name_data.push_back(ipv6vpn_mcast_address.get_name_leafdata()); if (rt_constraint_address.is_set || is_set(rt_constraint_address.yfilter)) leaf_name_data.push_back(rt_constraint_address.get_name_leafdata()); if (ipv6mvpn_address.is_set || is_set(ipv6mvpn_address.yfilter)) leaf_name_data.push_back(ipv6mvpn_address.get_name_leafdata()); if (ipv4mvpn_address.is_set || is_set(ipv4mvpn_address.yfilter)) leaf_name_data.push_back(ipv4mvpn_address.get_name_leafdata()); if (l2vpn_evpn_address.is_set || is_set(l2vpn_evpn_address.yfilter)) leaf_name_data.push_back(l2vpn_evpn_address.get_name_leafdata()); if (ls_ls_address.is_set || is_set(ls_ls_address.yfilter)) leaf_name_data.push_back(ls_ls_address.get_name_leafdata()); if (ipv4_flowspec_address.is_set || is_set(ipv4_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4_flowspec_address.get_name_leafdata()); if (ipv6_flowspec_address.is_set || is_set(ipv6_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6_flowspec_address.get_name_leafdata()); if (ipv4vpn_flowspec_address.is_set || is_set(ipv4vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv4vpn_flowspec_address.get_name_leafdata()); if (ipv6vpn_flowspec_address.is_set || is_set(ipv6vpn_flowspec_address.yfilter)) leaf_name_data.push_back(ipv6vpn_flowspec_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "l2vpn-vpls-address") { if(l2vpn_vpls_address == nullptr) { l2vpn_vpls_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress>(); } return l2vpn_vpls_address; } if(child_yang_name == "l2vpn-mspw-address") { if(l2vpn_mspw_address == nullptr) { l2vpn_mspw_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress>(); } return l2vpn_mspw_address; } if(child_yang_name == "ipv4-sr-policy-address") { if(ipv4_sr_policy_address == nullptr) { ipv4_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress>(); } return ipv4_sr_policy_address; } if(child_yang_name == "ipv6-sr-policy-address") { if(ipv6_sr_policy_address == nullptr) { ipv6_sr_policy_address = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress>(); } return ipv6_sr_policy_address; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(l2vpn_vpls_address != nullptr) { _children["l2vpn-vpls-address"] = l2vpn_vpls_address; } if(l2vpn_mspw_address != nullptr) { _children["l2vpn-mspw-address"] = l2vpn_mspw_address; } if(ipv4_sr_policy_address != nullptr) { _children["ipv4-sr-policy-address"] = ipv4_sr_policy_address; } if(ipv6_sr_policy_address != nullptr) { _children["ipv6-sr-policy-address"] = ipv6_sr_policy_address; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "afi") { afi = value; afi.value_namespace = name_space; afi.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-address") { ipv4_address = value; ipv4_address.value_namespace = name_space; ipv4_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address = value; ipv4_mcast_address.value_namespace = name_space; ipv4_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-label-address") { ipv4_label_address = value; ipv4_label_address.value_namespace = name_space; ipv4_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address = value; ipv4_tunnel_address.value_namespace = name_space; ipv4_tunnel_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address = value; ipv4_mdt_address.value_namespace = name_space; ipv4_mdt_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-address") { ipv4vpn_address = value; ipv4vpn_address.value_namespace = name_space; ipv4vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress = value; ipv4vpna_mcastddress.value_namespace = name_space; ipv4vpna_mcastddress.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-address") { ipv6_address = value; ipv6_address.value_namespace = name_space; ipv6_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address = value; ipv6_mcast_address.value_namespace = name_space; ipv6_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-label-address") { ipv6_label_address = value; ipv6_label_address.value_namespace = name_space; ipv6_label_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-address") { ipv6vpn_address = value; ipv6vpn_address.value_namespace = name_space; ipv6vpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address = value; ipv6vpn_mcast_address.value_namespace = name_space; ipv6vpn_mcast_address.value_namespace_prefix = name_space_prefix; } if(value_path == "rt-constraint-address") { rt_constraint_address = value; rt_constraint_address.value_namespace = name_space; rt_constraint_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address = value; ipv6mvpn_address.value_namespace = name_space; ipv6mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address = value; ipv4mvpn_address.value_namespace = name_space; ipv4mvpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address = value; l2vpn_evpn_address.value_namespace = name_space; l2vpn_evpn_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ls-ls-address") { ls_ls_address = value; ls_ls_address.value_namespace = name_space; ls_ls_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address = value; ipv4_flowspec_address.value_namespace = name_space; ipv4_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address = value; ipv6_flowspec_address.value_namespace = name_space; ipv6_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address = value; ipv4vpn_flowspec_address.value_namespace = name_space; ipv4vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address = value; ipv6vpn_flowspec_address.value_namespace = name_space; ipv6vpn_flowspec_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "afi") { afi.yfilter = yfilter; } if(value_path == "ipv4-address") { ipv4_address.yfilter = yfilter; } if(value_path == "ipv4-mcast-address") { ipv4_mcast_address.yfilter = yfilter; } if(value_path == "ipv4-label-address") { ipv4_label_address.yfilter = yfilter; } if(value_path == "ipv4-tunnel-address") { ipv4_tunnel_address.yfilter = yfilter; } if(value_path == "ipv4-mdt-address") { ipv4_mdt_address.yfilter = yfilter; } if(value_path == "ipv4vpn-address") { ipv4vpn_address.yfilter = yfilter; } if(value_path == "ipv4vpna-mcastddress") { ipv4vpna_mcastddress.yfilter = yfilter; } if(value_path == "ipv6-address") { ipv6_address.yfilter = yfilter; } if(value_path == "ipv6-mcast-address") { ipv6_mcast_address.yfilter = yfilter; } if(value_path == "ipv6-label-address") { ipv6_label_address.yfilter = yfilter; } if(value_path == "ipv6vpn-address") { ipv6vpn_address.yfilter = yfilter; } if(value_path == "ipv6vpn-mcast-address") { ipv6vpn_mcast_address.yfilter = yfilter; } if(value_path == "rt-constraint-address") { rt_constraint_address.yfilter = yfilter; } if(value_path == "ipv6mvpn-address") { ipv6mvpn_address.yfilter = yfilter; } if(value_path == "ipv4mvpn-address") { ipv4mvpn_address.yfilter = yfilter; } if(value_path == "l2vpn-evpn-address") { l2vpn_evpn_address.yfilter = yfilter; } if(value_path == "ls-ls-address") { ls_ls_address.yfilter = yfilter; } if(value_path == "ipv4-flowspec-address") { ipv4_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6-flowspec-address") { ipv6_flowspec_address.yfilter = yfilter; } if(value_path == "ipv4vpn-flowspec-address") { ipv4vpn_flowspec_address.yfilter = yfilter; } if(value_path == "ipv6vpn-flowspec-address") { ipv6vpn_flowspec_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-vpls-address" || name == "l2vpn-mspw-address" || name == "ipv4-sr-policy-address" || name == "ipv6-sr-policy-address" || name == "afi" || name == "ipv4-address" || name == "ipv4-mcast-address" || name == "ipv4-label-address" || name == "ipv4-tunnel-address" || name == "ipv4-mdt-address" || name == "ipv4vpn-address" || name == "ipv4vpna-mcastddress" || name == "ipv6-address" || name == "ipv6-mcast-address" || name == "ipv6-label-address" || name == "ipv6vpn-address" || name == "ipv6vpn-mcast-address" || name == "rt-constraint-address" || name == "ipv6mvpn-address" || name == "ipv4mvpn-address" || name == "l2vpn-evpn-address" || name == "ls-ls-address" || name == "ipv4-flowspec-address" || name == "ipv6-flowspec-address" || name == "ipv4vpn-flowspec-address" || name == "ipv6vpn-flowspec-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::L2vpnVplsAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-vpls-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::~L2vpnVplsAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-vpls-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnVplsAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::L2vpnMspwAddress() : l2vpn_address{YType::str, "l2vpn-address"} { yang_name = "l2vpn-mspw-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::~L2vpnMspwAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_data() const { if (is_presence_container) return true; return l2vpn_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(l2vpn_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "l2vpn-mspw-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (l2vpn_address.is_set || is_set(l2vpn_address.yfilter)) leaf_name_data.push_back(l2vpn_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "l2vpn-address") { l2vpn_address = value; l2vpn_address.value_namespace = name_space; l2vpn_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "l2vpn-address") { l2vpn_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::L2vpnMspwAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "l2vpn-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::Ipv4SrPolicyAddress() : ipv4_srpolicy_address{YType::str, "ipv4-srpolicy-address"} { yang_name = "ipv4-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::~Ipv4SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv4_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv4_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv4-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv4_srpolicy_address.is_set || is_set(ipv4_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv4_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address = value; ipv4_srpolicy_address.value_namespace = name_space; ipv4_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv4-srpolicy-address") { ipv4_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv4SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv4-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::Ipv6SrPolicyAddress() : ipv6_srpolicy_address{YType::str, "ipv6-srpolicy-address"} { yang_name = "ipv6-sr-policy-address"; yang_parent_name = "neighbor-address"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::~Ipv6SrPolicyAddress() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_data() const { if (is_presence_container) return true; return ipv6_srpolicy_address.is_set; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_operation() const { return is_set(yfilter) || ydk::is_set(ipv6_srpolicy_address.yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ipv6-sr-policy-address"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (ipv6_srpolicy_address.is_set || is_set(ipv6_srpolicy_address.yfilter)) leaf_name_data.push_back(ipv6_srpolicy_address.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address = value; ipv6_srpolicy_address.value_namespace = name_space; ipv6_srpolicy_address.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "ipv6-srpolicy-address") { ipv6_srpolicy_address.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::DmzLinkBandwidthInfo::InheritanceChain::BgpConfigEntid::NeighborAddress::Ipv6SrPolicyAddress::has_leaf_or_child_of_name(const std::string & name) const { if(name == "ipv6-srpolicy-address") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::EbgpRecvDmzInfo() : is_item_configured{YType::boolean, "is-item-configured"} , inheritance_chain(std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain>()) { inheritance_chain->parent = this; yang_name = "ebgp-recv-dmz-info"; yang_parent_name = "af-independent-config"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::~EbgpRecvDmzInfo() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::has_data() const { if (is_presence_container) return true; return is_item_configured.is_set || (inheritance_chain != nullptr && inheritance_chain->has_data()); } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::has_operation() const { return is_set(yfilter) || ydk::is_set(is_item_configured.yfilter) || (inheritance_chain != nullptr && inheritance_chain->has_operation()); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "ebgp-recv-dmz-info"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (is_item_configured.is_set || is_set(is_item_configured.yfilter)) leaf_name_data.push_back(is_item_configured.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "inheritance-chain") { if(inheritance_chain == nullptr) { inheritance_chain = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain>(); } return inheritance_chain; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(inheritance_chain != nullptr) { _children["inheritance-chain"] = inheritance_chain; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "is-item-configured") { is_item_configured = value; is_item_configured.value_namespace = name_space; is_item_configured.value_namespace_prefix = name_space_prefix; } } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "is-item-configured") { is_item_configured.yfilter = yfilter; } } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::has_leaf_or_child_of_name(const std::string & name) const { if(name == "inheritance-chain" || name == "is-item-configured") return true; return false; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::InheritanceChain() : bgp_config_entid(this, {}) { yang_name = "inheritance-chain"; yang_parent_name = "ebgp-recv-dmz-info"; is_top_level_class = false; has_list_ancestor = true; } Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::~InheritanceChain() { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_data()) return true; } return false; } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::has_operation() const { for (std::size_t index=0; index<bgp_config_entid.len(); index++) { if(bgp_config_entid[index]->has_operation()) return true; } return is_set(yfilter); } std::string Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "inheritance-chain"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "bgp-config-entid") { auto ent_ = std::make_shared<Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::BgpConfigEntid>(); ent_->parent = this; bgp_config_entid.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : bgp_config_entid.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::set_filter(const std::string & value_path, YFilter yfilter) { } bool Bgp::ConfigInstances::ConfigInstance::ConfigVrfs::ConfigVrf::EntityConfigurations::EntityConfiguration::AfIndependentConfig::EbgpRecvDmzInfo::InheritanceChain::has_leaf_or_child_of_name(const std::string & name) const { if(name == "bgp-config-entid") return true; return false; } } }
49.117116
827
0.764025
CiscoDevNet
d4d2c41eff69c1dbdbe887fcad382b18419494ec
5,159
cpp
C++
msame/src/main.cpp
Huawei-Ascend/tools
e42cacee256e84131742e281853675da2562e430
[ "Apache-2.0" ]
3
2020-09-26T05:28:10.000Z
2020-12-21T07:39:02.000Z
msame/src/main.cpp
Huawei-Ascend/tools
e42cacee256e84131742e281853675da2562e430
[ "Apache-2.0" ]
10
2020-09-26T01:31:49.000Z
2022-03-12T00:51:16.000Z
msame/src/main.cpp
Huawei-Ascend/tools
e42cacee256e84131742e281853675da2562e430
[ "Apache-2.0" ]
15
2020-09-02T16:24:33.000Z
2021-11-28T09:11:23.000Z
/** * Copyright 2020 Huawei Technologies Co., Ltd * * 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. */ #include "sample_process.h" #include "utils.h" #include <getopt.h> using namespace std; bool f_isTXT = false; bool g_isDevice = false; int loop = 1; int32_t device = 0; bool is_profi = false; bool is_dump = false; bool is_debug = false; string input_Ftype = ".bin"; string model_Ftype = ".om"; string check = ""; void InitAndCheckParams(int argc, char* argv[], map<char, string>& params, vector<string>& inputs) { const char* optstring = "m::i::o::f::hd::p::l::y::e::g::"; int c, deb, index; struct option opts[] = { { "model", required_argument, NULL, 'm' }, { "input", required_argument, NULL, 'i' }, { "output", required_argument, NULL, 'o' }, { "outfmt", required_argument, NULL, 'f' }, { "help", no_argument, NULL, 1 }, { "dump", required_argument, NULL, 'd' }, { "profiler", required_argument, NULL, 'p' }, { "loop", required_argument, NULL, 'l' }, { "dymBatch", required_argument, NULL, 'y' }, { "device", required_argument, NULL, 'e' }, { "debug", required_argument, NULL, 'g' }, { 0, 0, 0, 0 } }; while ((c = getopt_long(argc, argv, optstring, opts, &index)) != -1) { switch (c) { case 'm': check = optarg; if (check.find(model_Ftype) != string::npos) { params['m'] = optarg; break; } else { printf("input model file type is not .om , please check your model type!\n"); exit(0); } case 'i': check = optarg; if (check.find(input_Ftype) == string::npos) { printf("input data file type is not .bin , please check your input file type!\n"); exit(0); } params['i'] = optarg; Utils::SplitString(params['i'], inputs, ','); break; case 'o': params['o'] = optarg; break; case 'f': params['f'] = optarg; break; case '?': printf("unknown paramenter\n"); printf("Execute sample failed.\n"); Utils::printHelpLetter(); exit(0); case 'd': params['d'] = optarg; break; case 'p': params['p'] = optarg; break; case 'l': loop = Utils::str2num(optarg); cout << "loop:" << loop << endl; if (loop > 100 || loop < 1) { printf("loop must in 1 to 100\n"); exit(0); } break; case 'y': params['y'] = optarg; break; case 'e': device = Utils::str2num(optarg); cout << "device:" << device << endl; if (device > 255 || device < 0) { printf("device id must in 0 to 255\n"); exit(0); } break; case 'g': params['g'] = optarg; break; case 1: Utils::printHelpLetter(); exit(0); default: printf("unknown paramenter\n"); printf("Execute sample failed.\n"); Utils::printHelpLetter(); exit(0); } } } int main(int argc, char* argv[]) { map<char, string> params; vector<string> inputs; InitAndCheckParams(argc, argv, params, inputs); printf("******************************\n"); printf("Test Start!\n"); if (params.empty()) { printf("Invalid params.\n"); printf("Execute sample failed.\n"); Utils::printHelpLetter(); return FAILED; } if (params['d'].compare("true") == 0) { is_dump = true; } if (params['p'].compare("true") == 0) { is_profi = true; } if (params['g'].compare("true") == 0) { is_debug = true; } if (is_profi && is_dump) { ERROR_LOG("dump and profiler can not both be true"); return FAILED; } Utils::ProfilerJson(is_profi, params); Utils::DumpJson(is_dump, params); SampleProcess processSample; Result ret = processSample.InitResource(); if (ret != SUCCESS) { ERROR_LOG("Sample init resource failed."); return FAILED; } ret = processSample.Process(params, inputs); if (ret != SUCCESS) { ERROR_LOG("Sample process failed."); return FAILED; } INFO_LOG("Execute sample success."); printf("Test Finish!\n"); printf("******************************\n"); return SUCCESS; }
29.994186
98
0.518705
Huawei-Ascend
d4d35d752be72487a0839cdee9d55ec5db6bad50
21,042
cc
C++
pmem-mariadb/sql/wsrep_hton.cc
wc222/pmdk-examples
64aadc3a70471c469ac8e214eb1e04ff47cf18ff
[ "BSD-3-Clause" ]
1
2019-10-31T08:25:52.000Z
2019-10-31T08:25:52.000Z
pmem-mariadb/sql/wsrep_hton.cc
WSCWDA/pmdk-examples
c3d079e52cd18b0e14836ef42bad9a995336bf90
[ "BSD-3-Clause" ]
1
2021-02-24T05:26:44.000Z
2021-02-24T05:26:44.000Z
pmem-mariadb/sql/wsrep_hton.cc
isabella232/pmdk-examples
be7a5a18ba7bb8931e512f6d552eadf820fa2235
[ "BSD-3-Clause" ]
null
null
null
/* Copyright 2008-2015 Codership Oy <http://www.codership.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #include "mariadb.h" #include <mysqld.h> #include "sql_base.h" #include "rpl_filter.h" #include <sql_class.h> #include "wsrep_mysqld.h" #include "wsrep_binlog.h" #include "wsrep_xid.h" #include <cstdio> #include <cstdlib> #include "debug_sync.h" extern ulonglong thd_to_trx_id(THD *thd); extern "C" int thd_binlog_format(const MYSQL_THD thd); // todo: share interface with ha_innodb.c /* Cleanup after local transaction commit/rollback, replay or TOI. */ void wsrep_cleanup_transaction(THD *thd) { if (!WSREP(thd)) return; if (wsrep_emulate_bin_log) thd_binlog_trx_reset(thd); thd->wsrep_ws_handle.trx_id= WSREP_UNDEFINED_TRX_ID; thd->wsrep_trx_meta.gtid= WSREP_GTID_UNDEFINED; thd->wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED; thd->wsrep_exec_mode= LOCAL_STATE; thd->wsrep_affected_rows= 0; thd->wsrep_skip_wsrep_GTID= false; return; } /* wsrep hton */ handlerton *wsrep_hton; /* Registers wsrep hton at commit time if transaction has registered htons for supported engine types. Hton should not be registered for TOTAL_ORDER operations. Registration is needed for both LOCAL_MODE and REPL_RECV transactions to run commit in 2pc so that wsrep position gets properly recorded in storage engines. Note that all hton calls should immediately return for threads that are in REPL_RECV mode as their states are controlled by wsrep appliers or replaying code. Only threads in LOCAL_MODE should run wsrep callbacks from hton methods. */ void wsrep_register_hton(THD* thd, bool all) { if (WSREP(thd) && thd->wsrep_exec_mode != TOTAL_ORDER && !thd->wsrep_apply_toi) { if (thd->wsrep_exec_mode == LOCAL_STATE && (thd_sql_command(thd) == SQLCOM_OPTIMIZE || thd_sql_command(thd) == SQLCOM_ANALYZE || thd_sql_command(thd) == SQLCOM_REPAIR) && thd->lex->no_write_to_binlog == 1) { WSREP_DEBUG("Skipping wsrep_register_hton for LOCAL sql admin command : %s", thd->query()); return; } THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; for (Ha_trx_info *i= trans->ha_list; i; i = i->next()) { if ((i->ht()->db_type == DB_TYPE_INNODB) || (i->ht()->db_type == DB_TYPE_TOKUDB)) { trans_register_ha(thd, all, wsrep_hton); /* follow innodb read/write settting * but, as an exception: CTAS with empty result set will not be * replicated unless we declare wsrep hton as read/write here */ if (i->is_trx_read_write() || ((thd->lex->sql_command == SQLCOM_CREATE_TABLE || thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE) && thd->wsrep_exec_mode == LOCAL_STATE)) { thd->ha_data[wsrep_hton->slot].ha_info[all].set_trx_read_write(); } break; } } } } /* Calls wsrep->post_commit() for locally executed transactions that have got seqno from provider (must commit) and don't require replaying. */ void wsrep_post_commit(THD* thd, bool all) { if (!WSREP(thd)) return; switch (thd->wsrep_exec_mode) { case LOCAL_COMMIT: { DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); if (wsrep && wsrep->post_commit(wsrep, &thd->wsrep_ws_handle)) { DBUG_PRINT("wsrep", ("set committed fail")); WSREP_WARN("set committed fail: %llu %d", (long long)thd->real_id, thd->get_stmt_da()->status()); } wsrep_cleanup_transaction(thd); break; } case LOCAL_STATE: { /* non-InnoDB statements may have populated events in stmt cache => cleanup */ WSREP_DEBUG("cleanup transaction for LOCAL_STATE"); /* Run post-rollback hook to clean up in the case if some keys were populated for the transaction in provider but during commit time there was no write set to replicate. This may happen when client sets the SAVEPOINT and immediately rolls back to savepoint after first operation. */ if (all && thd->wsrep_conflict_state != MUST_REPLAY && wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) { WSREP_WARN("post_rollback fail: %llu %d", (long long)thd->thread_id, thd->get_stmt_da()->status()); } wsrep_cleanup_transaction(thd); break; } default: break; } } /* wsrep exploits binlog's caches even if binlogging itself is not activated. In such case connection close needs calling actual binlog's method. Todo: split binlog hton from its caches to use ones by wsrep without referring to binlog's stuff. */ static int wsrep_close_connection(handlerton* hton, THD* thd) { DBUG_ENTER("wsrep_close_connection"); if (thd->wsrep_exec_mode == REPL_RECV) { DBUG_RETURN(0); } DBUG_RETURN(wsrep_binlog_close_connection (thd)); } /* prepare/wsrep_run_wsrep_commit can fail in two ways - certification test or an equivalent. As a result, the current transaction just rolls back Error codes: WSREP_TRX_CERT_FAIL, WSREP_TRX_SIZE_EXCEEDED, WSREP_TRX_ERROR - a post-certification failure makes this server unable to commit its own WS and therefore the server must abort */ static int wsrep_prepare(handlerton *hton, THD *thd, bool all) { DBUG_ENTER("wsrep_prepare"); if (thd->wsrep_exec_mode == REPL_RECV) { DBUG_RETURN(0); } DBUG_ASSERT(thd->ha_data[wsrep_hton->slot].ha_info[all].is_trx_read_write()); DBUG_ASSERT(thd->wsrep_exec_mode == LOCAL_STATE); DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno == WSREP_SEQNO_UNDEFINED); if ((all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && (thd->variables.wsrep_on && !wsrep_trans_cache_is_empty(thd))) { int res= wsrep_run_wsrep_commit(thd, all); if (res != 0) { if (res == WSREP_TRX_SIZE_EXCEEDED) res= EMSGSIZE; else res= EDEADLK; // for a better error message } DBUG_RETURN (res); } DBUG_RETURN(0); } static int wsrep_savepoint_set(handlerton *hton, THD *thd, void *sv) { DBUG_ENTER("wsrep_savepoint_set"); if (thd->wsrep_exec_mode == REPL_RECV) { DBUG_RETURN(0); } if (!wsrep_emulate_bin_log) DBUG_RETURN(0); int rcode = wsrep_binlog_savepoint_set(thd, sv); DBUG_RETURN(rcode); } static int wsrep_savepoint_rollback(handlerton *hton, THD *thd, void *sv) { DBUG_ENTER("wsrep_savepoint_rollback"); if (thd->wsrep_exec_mode == REPL_RECV) { DBUG_RETURN(0); } if (!wsrep_emulate_bin_log) DBUG_RETURN(0); int rcode = wsrep_binlog_savepoint_rollback(thd, sv); DBUG_RETURN(rcode); } static int wsrep_rollback(handlerton *hton, THD *thd, bool all) { DBUG_ENTER("wsrep_rollback"); if (thd->wsrep_exec_mode == REPL_RECV) { DBUG_RETURN(0); } mysql_mutex_lock(&thd->LOCK_thd_data); switch (thd->wsrep_exec_mode) { case TOTAL_ORDER: case REPL_RECV: mysql_mutex_unlock(&thd->LOCK_thd_data); WSREP_DEBUG("Avoiding wsrep rollback for failed DDL: %s", thd->query()); DBUG_RETURN(0); default: break; } if ((all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && (thd->variables.wsrep_on && thd->wsrep_conflict_state != MUST_REPLAY)) { if (wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) { DBUG_PRINT("wsrep", ("setting rollback fail")); WSREP_ERROR("settting rollback fail: thd: %llu, schema: %s, SQL: %s", (long long)thd->real_id, thd->get_db(), thd->query()); } wsrep_cleanup_transaction(thd); } mysql_mutex_unlock(&thd->LOCK_thd_data); DBUG_RETURN(0); } int wsrep_commit(handlerton *hton, THD *thd, bool all) { DBUG_ENTER("wsrep_commit"); if (thd->wsrep_exec_mode == REPL_RECV) { DBUG_RETURN(0); } mysql_mutex_lock(&thd->LOCK_thd_data); if ((all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && (thd->variables.wsrep_on && thd->wsrep_conflict_state != MUST_REPLAY)) { if (thd->wsrep_exec_mode == LOCAL_COMMIT) { DBUG_ASSERT(thd->ha_data[wsrep_hton->slot].ha_info[all].is_trx_read_write()); /* Call to wsrep->post_commit() (moved to wsrep_post_commit()) must be done only after commit has done for all involved htons. */ DBUG_PRINT("wsrep", ("commit")); } else { /* Transaction didn't go through wsrep->pre_commit() so just roll back possible changes to clean state. */ if (WSREP_PROVIDER_EXISTS) { if (wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) { DBUG_PRINT("wsrep", ("setting rollback fail")); WSREP_ERROR("settting rollback fail: thd: %llu, schema: %s, SQL: %s", (long long)thd->real_id, thd->get_db(), thd->query()); } } wsrep_cleanup_transaction(thd); } } mysql_mutex_unlock(&thd->LOCK_thd_data); DBUG_RETURN(0); } extern Rpl_filter* binlog_filter; extern my_bool opt_log_slave_updates; enum wsrep_trx_status wsrep_run_wsrep_commit(THD *thd, bool all) { int rcode= -1; size_t data_len= 0; IO_CACHE *cache; int replay_round= 0; DBUG_ENTER("wsrep_run_wsrep_commit"); if (thd->get_stmt_da()->is_error()) { WSREP_DEBUG("commit issue, error: %d %s", thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message()); } DEBUG_SYNC(thd, "wsrep_before_replication"); if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK); if (thd->wsrep_exec_mode == REPL_RECV) { mysql_mutex_lock(&thd->LOCK_thd_data); if (thd->wsrep_conflict_state == MUST_ABORT) { if (wsrep_debug) WSREP_INFO("WSREP: must abort for BF"); DBUG_PRINT("wsrep", ("BF apply commit fail")); thd->wsrep_conflict_state = NO_CONFLICT; mysql_mutex_unlock(&thd->LOCK_thd_data); // // TODO: test all calls of the rollback. // rollback must happen automagically innobase_rollback(hton, thd, 1); // DBUG_RETURN(WSREP_TRX_ERROR); } mysql_mutex_unlock(&thd->LOCK_thd_data); } if (thd->wsrep_exec_mode != LOCAL_STATE) DBUG_RETURN(WSREP_TRX_OK); if (thd->wsrep_consistency_check == CONSISTENCY_CHECK_RUNNING) { WSREP_DEBUG("commit for consistency check: %s", thd->query()); DBUG_RETURN(WSREP_TRX_OK); } DBUG_PRINT("wsrep", ("replicating commit")); mysql_mutex_lock(&thd->LOCK_thd_data); if (thd->wsrep_conflict_state == MUST_ABORT) { DBUG_PRINT("wsrep", ("replicate commit fail")); thd->wsrep_conflict_state = ABORTED; mysql_mutex_unlock(&thd->LOCK_thd_data); if (wsrep_debug) { WSREP_INFO("innobase_commit, abort %s", (thd->query()) ? thd->query() : "void"); } DBUG_RETURN(WSREP_TRX_CERT_FAIL); } mysql_mutex_lock(&LOCK_wsrep_replaying); DBUG_PRINT("info", ("wsrep_replaying: %d wsrep_conflict_state: %d killed: %d shutdown_in_progress: %d", (int) wsrep_replaying, (int) thd->wsrep_conflict_state, (int) thd->killed, (int) shutdown_in_progress)); while (wsrep_replaying > 0 && thd->wsrep_conflict_state == NO_CONFLICT && thd->killed == NOT_KILLED && !shutdown_in_progress) { mysql_mutex_unlock(&LOCK_wsrep_replaying); mysql_mutex_unlock(&thd->LOCK_thd_data); mysql_mutex_lock(&thd->mysys_var->mutex); thd_proc_info(thd, "WSREP waiting on replaying"); thd->mysys_var->current_mutex= &LOCK_wsrep_replaying; thd->mysys_var->current_cond= &COND_wsrep_replaying; mysql_mutex_unlock(&thd->mysys_var->mutex); mysql_mutex_lock(&LOCK_wsrep_replaying); // Using timedwait is a hack to avoid deadlock in case if BF victim // misses the signal. struct timespec wtime = {0, 1000000}; mysql_cond_timedwait(&COND_wsrep_replaying, &LOCK_wsrep_replaying, &wtime); if (replay_round++ % 100000 == 0) WSREP_DEBUG("commit waiting for replaying: replayers %d, thd: %lld " "conflict: %d (round: %d)", wsrep_replaying, (longlong) thd->thread_id, thd->wsrep_conflict_state, replay_round); mysql_mutex_unlock(&LOCK_wsrep_replaying); mysql_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; thd->mysys_var->current_cond= 0; mysql_mutex_unlock(&thd->mysys_var->mutex); mysql_mutex_lock(&thd->LOCK_thd_data); mysql_mutex_lock(&LOCK_wsrep_replaying); } mysql_mutex_unlock(&LOCK_wsrep_replaying); if (thd->wsrep_conflict_state == MUST_ABORT) { DBUG_PRINT("wsrep", ("replicate commit fail")); thd->wsrep_conflict_state = ABORTED; mysql_mutex_unlock(&thd->LOCK_thd_data); WSREP_DEBUG("innobase_commit abort after replaying wait %s", (thd->query()) ? thd->query() : "void"); DBUG_RETURN(WSREP_TRX_CERT_FAIL); } thd->wsrep_query_state = QUERY_COMMITTING; mysql_mutex_unlock(&thd->LOCK_thd_data); cache = get_trans_log(thd); rcode = 0; if (cache) { thd->binlog_flush_pending_rows_event(true); rcode = wsrep_write_cache(wsrep, thd, cache, &data_len); if (WSREP_OK != rcode) { WSREP_ERROR("rbr write fail, data_len: %zu, %d", data_len, rcode); DBUG_RETURN(WSREP_TRX_SIZE_EXCEEDED); } } DBUG_PRINT("info", ("rcode: %d wsrep_conflict_state: %d", rcode, thd->wsrep_conflict_state)); if (data_len == 0) { if (thd->get_stmt_da()->is_ok() && thd->get_stmt_da()->affected_rows() > 0 && !binlog_filter->is_on()) { WSREP_DEBUG("empty rbr buffer, query: %s, " "affected rows: %llu, " "changed tables: %d, " "sql_log_bin: %d, " "wsrep status (%d %d %d)", thd->query(), thd->get_stmt_da()->affected_rows(), stmt_has_updated_trans_table(thd), thd->variables.sql_log_bin, thd->wsrep_exec_mode, thd->wsrep_query_state, thd->wsrep_conflict_state); } else { WSREP_DEBUG("empty rbr buffer, query: %s", thd->query()); } thd->wsrep_query_state= QUERY_EXEC; DBUG_RETURN(WSREP_TRX_OK); } if (WSREP_UNDEFINED_TRX_ID == thd->wsrep_ws_handle.trx_id) { WSREP_WARN("SQL statement was ineffective thd: %lld buf: %zu\n" "schema: %s \n" "QUERY: %s\n" " => Skipping replication", (longlong) thd->thread_id, data_len, thd->get_db(), thd->query()); rcode = WSREP_TRX_FAIL; } else if (!rcode) { if (WSREP_OK == rcode && wsrep) rcode = wsrep->pre_commit(wsrep, (wsrep_conn_id_t)thd->thread_id, &thd->wsrep_ws_handle, WSREP_FLAG_COMMIT | ((thd->wsrep_PA_safe) ? 0ULL : WSREP_FLAG_PA_UNSAFE), &thd->wsrep_trx_meta); DBUG_PRINT("info", ("rcode after pre_commit: %d", rcode)); if (rcode == WSREP_TRX_MISSING) { WSREP_WARN("Transaction missing in provider, thd: %lld schema: %s SQL: %s", (longlong) thd->thread_id, thd->get_db(), thd->query()); rcode = WSREP_TRX_FAIL; } else if (rcode == WSREP_BF_ABORT) { WSREP_DEBUG("thd: %lld seqno: %lld BF aborted by provider, will replay", (longlong) thd->thread_id, (longlong) thd->wsrep_trx_meta.gtid.seqno); mysql_mutex_lock(&thd->LOCK_thd_data); thd->wsrep_conflict_state = MUST_REPLAY; DBUG_ASSERT(wsrep_thd_trx_seqno(thd) > 0); mysql_mutex_unlock(&thd->LOCK_thd_data); mysql_mutex_lock(&LOCK_wsrep_replaying); wsrep_replaying++; WSREP_DEBUG("replaying increased: %d, thd: %lld", wsrep_replaying, (longlong) thd->thread_id); mysql_mutex_unlock(&LOCK_wsrep_replaying); } } else { WSREP_ERROR("I/O error reading from thd's binlog iocache: " "errno=%d, io cache code=%d", my_errno, cache->error); DBUG_ASSERT(0); // failure like this can not normally happen DBUG_RETURN(WSREP_TRX_ERROR); } mysql_mutex_lock(&thd->LOCK_thd_data); DEBUG_SYNC(thd, "wsrep_after_replication"); DBUG_PRINT("info", ("rcode: %d wsrep_conflict_state: %d", rcode, thd->wsrep_conflict_state)); switch(rcode) { case 0: /* About MUST_ABORT: We assume that even if thd conflict state was set to MUST_ABORT, underlying transaction was not rolled back or marked as deadlock victim in QUERY_COMMITTING state. Conflict state is set to NO_CONFLICT and commit proceeds as usual. */ if (thd->wsrep_conflict_state == MUST_ABORT) thd->wsrep_conflict_state= NO_CONFLICT; if (thd->wsrep_conflict_state != NO_CONFLICT) { WSREP_WARN("thd: %llu seqno: %lld conflict state %d after post commit", (longlong) thd->thread_id, (longlong) thd->wsrep_trx_meta.gtid.seqno, thd->wsrep_conflict_state); } thd->wsrep_exec_mode= LOCAL_COMMIT; DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); /* Override XID iff it was generated by mysql */ if (thd->transaction.xid_state.xid.get_my_xid()) { wsrep_xid_init(&thd->transaction.xid_state.xid, thd->wsrep_trx_meta.gtid.uuid, thd->wsrep_trx_meta.gtid.seqno); } DBUG_PRINT("wsrep", ("replicating commit success")); break; case WSREP_BF_ABORT: DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); /* fall through */ case WSREP_TRX_FAIL: WSREP_DEBUG("commit failed for reason: %d", rcode); DBUG_PRINT("wsrep", ("replicating commit fail")); thd->wsrep_query_state= QUERY_EXEC; if (thd->wsrep_conflict_state == MUST_ABORT) { thd->wsrep_conflict_state= ABORTED; } else { WSREP_DEBUG("conflict state: %d", thd->wsrep_conflict_state); if (thd->wsrep_conflict_state == NO_CONFLICT) { thd->wsrep_conflict_state = CERT_FAILURE; WSREP_LOG_CONFLICT(NULL, thd, FALSE); } } mysql_mutex_unlock(&thd->LOCK_thd_data); DBUG_RETURN(WSREP_TRX_CERT_FAIL); case WSREP_SIZE_EXCEEDED: WSREP_ERROR("transaction size exceeded"); mysql_mutex_unlock(&thd->LOCK_thd_data); DBUG_RETURN(WSREP_TRX_SIZE_EXCEEDED); case WSREP_CONN_FAIL: WSREP_ERROR("connection failure"); mysql_mutex_unlock(&thd->LOCK_thd_data); DBUG_RETURN(WSREP_TRX_ERROR); default: WSREP_ERROR("unknown connection failure"); mysql_mutex_unlock(&thd->LOCK_thd_data); DBUG_RETURN(WSREP_TRX_ERROR); } thd->wsrep_query_state= QUERY_EXEC; mysql_mutex_unlock(&thd->LOCK_thd_data); DBUG_RETURN(WSREP_TRX_OK); } static int wsrep_hton_init(void *p) { wsrep_hton= (handlerton *)p; //wsrep_hton->state=opt_bin_log ? SHOW_OPTION_YES : SHOW_OPTION_NO; wsrep_hton->state= SHOW_OPTION_YES; wsrep_hton->db_type=(legacy_db_type)0; wsrep_hton->savepoint_offset= sizeof(my_off_t); wsrep_hton->close_connection= wsrep_close_connection; wsrep_hton->savepoint_set= wsrep_savepoint_set; wsrep_hton->savepoint_rollback= wsrep_savepoint_rollback; wsrep_hton->commit= wsrep_commit; wsrep_hton->rollback= wsrep_rollback; wsrep_hton->prepare= wsrep_prepare; wsrep_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN; // todo: fix flags return 0; } struct st_mysql_storage_engine wsrep_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; maria_declare_plugin(wsrep) { MYSQL_STORAGE_ENGINE_PLUGIN, &wsrep_storage_engine, "wsrep", "Codership Oy", "A pseudo storage engine to represent transactions in multi-master " "synchornous replication", PLUGIN_LICENSE_GPL, wsrep_hton_init, /* Plugin Init */ NULL, /* Plugin Deinit */ 0x0100 /* 1.0 */, NULL, /* status variables */ NULL, /* system variables */ "1.0", /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ } maria_declare_plugin_end;
32.174312
108
0.657637
wc222
d4dadf6e20689466e1c472ef39b47de2f9bb8cb7
3,538
cpp
C++
gui-firmware/devices/Display.cpp
Danfx/BR-Ventilador
052524803e35a8e5db8b1c3f72c16dc91c19ca54
[ "MIT" ]
null
null
null
gui-firmware/devices/Display.cpp
Danfx/BR-Ventilador
052524803e35a8e5db8b1c3f72c16dc91c19ca54
[ "MIT" ]
null
null
null
gui-firmware/devices/Display.cpp
Danfx/BR-Ventilador
052524803e35a8e5db8b1c3f72c16dc91c19ca54
[ "MIT" ]
null
null
null
/* * LICENSE MIT - https://tldrlegal.com/license/mit-license * * Copyright Daniel Fussia, https://github.com/Danfx * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "../hdr/devices/Display.h" #include "../hdr/hardware.h" #include "Arduino.h" #include "Main.cpp" #include "../hdr/defines.h" Display::Display():lcd(LCD_RESET,LCD_EN,LCD_D4,LCD_D5,LCD_D6,LCD_D7){ } void Display::begin() { lcd.begin(LCD_COLS,LCD_ROWS); } void Display::printMenu(int cursor,config_t* mode,config_t* cfg,size_t cfg_len){ int k=0; for(size_t i=0;i<cfg_len;i++){ if( cfg[i].visibility == SHOW_ALWAYS || mode->value == cfg[i].visibility ){ if( cursor == k++ ){ Serial.print("> "); } Serial.print(cfg[i].label); Serial.print(" : "); #if 1 if( cfg[i].key == "mode" ){ if( cfg[i].value == MODE_PCV ){ Serial.println("PCV"); } else if( cfg[i].value == MODE_VCV ){ Serial.println("VCV"); } } else { Serial.println(cfg[i].value); } #else // exibe somente valores Serial.println(cfg[i].value); #endif } } } void Display::printPressure(double press, double plim, double peep, double i_ms, int frequencia){ char buffer[10]; press = press < 0 ? 0 : press; dtostrf(press,2,2,buffer); // Turn on the display: lcd.display(); lcd.clear(); // row 0 lcd.setCursor(5, 0); lcd.print("MODO PCV"); // row 1 lcd.setCursor(0, 1); lcd.print("Patual:"); lcd.print(buffer); lcd.setCursor(12, 1); lcd.print(" [cmH2O]"); //row 2 lcd.setCursor(0, 2); lcd.print("Plim:"); lcd.print(plim); lcd.setCursor(11, 2); lcd.print("PEEP:"); lcd.print(peep); //row 3 lcd.setCursor(0, 3); lcd.print("Freq:"); lcd.print(frequencia); lcd.setCursor(11, 3); lcd.print("Ti:"); lcd.print(i_ms); lcd.setCursor(17, 3); lcd.print("[s]"); } void Display::printFlow(double flow,int mode){ //char buffer[10]; //press = press < 0 ? 0 : press; //dtostrf(press,2,2,buffer); // Turn on the display: lcd.display(); lcd.clear(); // row 0 lcd.setCursor(5, 0); lcd.print("MODO VCV"); // row 1 lcd.setCursor(0, 1); lcd.print("Fluxo atual:"); lcd.print(flow); lcd.setCursor(12, 1); lcd.print(" [L/s]"); //row 2 lcd.setCursor(1, 2); lcd.print("Plim:"); lcd.print("15"); lcd.setCursor(11, 2); lcd.print("PEEP:"); lcd.print("5"); //row 3 lcd.setCursor(1, 3); lcd.print("Fluxo:"); lcd.print("15"); lcd.setCursor(11, 3); lcd.print("Vol:"); lcd.print("300"); lcd.setCursor(17, 3); lcd.print("mL]"); //&dataMain = cb_Display(); //lcd.print(cb_Display()); }
26.402985
97
0.665065
Danfx
d4dd0afd948698afa9d16f3a5e98beb464d4f3ff
6,104
cpp
C++
src/reconstruction/Image.cpp
ShnitzelKiller/Reverse-Engineering-Carpentry
585b5ff053c7e3bf286b663a584bc83687691bd6
[ "MIT" ]
3
2021-09-08T07:28:13.000Z
2022-03-02T21:12:40.000Z
src/reconstruction/Image.cpp
ShnitzelKiller/Reverse-Engineering-Carpentry
585b5ff053c7e3bf286b663a584bc83687691bd6
[ "MIT" ]
1
2021-09-21T14:40:55.000Z
2021-09-26T01:19:38.000Z
src/reconstruction/Image.cpp
ShnitzelKiller/Reverse-Engineering-Carpentry
585b5ff053c7e3bf286b663a584bc83687691bd6
[ "MIT" ]
null
null
null
// // Created by James Noeckel on 12/10/19. // #include "Image.h" #include <fstream> #include <memory> #include "parsing.hpp" #include <iostream> #include <utility> std::unordered_map<int32_t, Image> Image::parse_file(const std::string &filename, const std::string &image_path, const std::string &depth_path, double scale) { size_t size; std::unique_ptr<char[]> memblock = read_file(filename, size); const char* ptr = memblock.get(); std::unordered_map<int32_t, Image> images; if (!ptr) return images; uint64_t num_images; ptr = read_object(ptr, num_images); for (size_t i=0; i<num_images; i++) { Image image; image.scale_ = scale; image.image_path_ = image_path; image.depth_path_ = depth_path; int32_t image_id; ptr = read_object(ptr, image_id); Eigen::Vector4d qvec; ptr = read_object(ptr, qvec); image.rot_ = Eigen::Quaterniond(qvec(0), qvec(1), qvec(2), qvec(3)); ptr = read_object(ptr, image.trans_); ptr = read_object(ptr, image.camera_id_); ptr = read_object(ptr, image.image_name_); image.depth_name_ = image.image_name_ + ".geometric.bin"; uint64_t num_points2D; ptr = read_object(ptr, num_points2D); image.xys_.resize(num_points2D); image.point3D_ids_.resize(num_points2D); for (size_t j=0; j<num_points2D; j++) { ptr = read_object(ptr, image.xys_[j]); ptr = read_object(ptr, image.point3D_ids_[j]); } std::cout << "Image " << image_id << ": " << image << std::endl; images.insert(std::make_pair(image_id, image)); } return images; } Eigen::Vector3d Image::origin() const { return -(rot_.conjugate() * trans_); } Eigen::Vector3d Image::direction() const { return rot_.conjugate() * Eigen::Vector3d(0, 0, 1); } cv::Mat Image::getImage(bool grayscale) { if (!loaded_image_) { std::cout << "loading " << image_path_ + image_name_ << std::endl; img_ = cv::imread(image_path_ + image_name_); if (grayscale) { cv::cvtColor(img_, img_, CV_BGR2GRAY); } if (scale_ != 1) { cv::Mat temp; cv::resize(img_, temp, cv::Size(), scale_, scale_); img_ = temp; } loaded_grayscale_ = grayscale; loaded_image_ = true; } else if (grayscale != loaded_grayscale_) { loaded_image_ = false; getImage(grayscale); } return img_; } cv::Mat Image::getDepthGeometric() { if (!loaded_depth_geom_) { std::string ending = depth_name_.substr(depth_name_.rfind('.') + 1); std::transform(ending.begin(), ending.end(), ending.begin(), [](unsigned char c) -> unsigned char { return std::tolower(c); }); std::string filename = depth_path_ + depth_name_; if (ending == "exr") { depth_geom_ = cv::imread(filename, cv::IMREAD_ANYDEPTH | cv::IMREAD_GRAYSCALE); if (!depth_geom_.empty()) { loaded_depth_geom_ = true; } else { std::cerr << "failed to load " << filename << std::endl; } } else if (ending == "bin") { std::string num; size_t offset; int width, height, channels; std::ifstream is(filename); if (!is) { std::cerr << "file not found: \"" << filename << '"' << std::endl; return depth_geom_; } try { std::getline(is, num, '&'); width = std::stoi(num); std::getline(is, num, '&'); height = std::stoi(num); std::getline(is, num, '&'); channels = std::stoi(num); offset = is.tellg(); } catch (std::invalid_argument &exc) { std::cerr << "error reading header of " << filename << std::endl; return depth_geom_; } if (channels != 1) { std::cerr << "wrong number of channels in depth image" << std::endl; return depth_geom_; } size_t size; std::unique_ptr<char[]> memblock = read_file(filename, size, offset); if (size < width * height * 4) { std::cerr << "not enough image data for dimensions " << width << "x" << height << std::endl; return depth_geom_; } const char *ptr = memblock.get(); depth_geom_ = cv::Mat(height, width, CV_32FC1); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { ptr = read_object(ptr, depth_geom_.at<float>(i, j)); depth_geom_.at<float>(i, j) *= depth_scale_; } } loaded_depth_geom_ = true; } else { std::cerr << "unrecognized file type " << ending << " for " << filename << std::endl; } } return depth_geom_; } void Image::clearImages() { img_ = cv::Mat(); depth_geom_ = cv::Mat(); derivative_x_ = cv::Mat(); derivative_y_ = cv::Mat(); loaded_image_ = false; loaded_depth_geom_ = false; computed_derivative_ = false; } cv::Mat Image::getDerivativeX() { if (!computed_derivative_) { computeDerivatives(); } return derivative_x_; } cv::Mat Image::getDerivativeY() { if (!computed_derivative_) { computeDerivatives(); } return derivative_y_; } void Image::computeDerivatives() { cv::Mat img = getImage(true); cv::Scharr(img, derivative_x_, CV_16S, 1, 0); cv::Scharr(img, derivative_y_, CV_16S, 0, 1); computed_derivative_ = true; } std::ostream &operator<<(std::ostream &o, const Image &im) { o << "rot (" << im.rot_.w() << ", " << im.rot_.x() << ", " << im.rot_.y() << ", " << im.rot_.z() << "), trans (" << im.trans_.transpose() << "), camera ID: " << im.camera_id_ << ", image name: " << im.image_name_ << ", num points: " << im.point3D_ids_.size(); return o; }
35.08046
263
0.544233
ShnitzelKiller
d4de32547d2bf6774e0645816f83923e2ca9a3fb
913
cpp
C++
C_C++/oop_assignment/contest/week1Contest/date.cpp
oneofsunshine/program_learning
5afc2e5e6e7a6604d4bd9c8e102822e1cf751c0b
[ "Apache-2.0" ]
1
2018-02-10T03:53:45.000Z
2018-02-10T03:53:45.000Z
C_C++/oop_assignment/contest/week1Contest/date.cpp
oneofsunshine/program_learning
5afc2e5e6e7a6604d4bd9c8e102822e1cf751c0b
[ "Apache-2.0" ]
null
null
null
C_C++/oop_assignment/contest/week1Contest/date.cpp
oneofsunshine/program_learning
5afc2e5e6e7a6604d4bd9c8e102822e1cf751c0b
[ "Apache-2.0" ]
null
null
null
#include<iostream> using namespace std; int ap[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int ar[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int date(int s, int rOrP, int m, int d) { int t = s; if(rOrP) { for(int i = 0; i < m - 1; i++) t += ar[i]; t += d; }// 润年从第一天到目标日期总天数(多1); else { for(int i = 0; i < m -1; i++) t += ap[i]; t += d; }// 平年从第一天到目标日期总天数(多1); return t % 7 - 1; } int main() { int start, month, day; char rp; cin>>start>>rp>>month>>day; switch(date(start, (int)rp - 'p', month, day)) { case 0:cout<<"SUN";break; case 1:cout<<"MON";break; case 2:cout<<"TUE";break; case 3:cout<<"WED";break; case 4:cout<<"THU";break; case 5:cout<<"FRI";break; case 6:cout<<"SAT";break; default:cout<<"wrong"; } }
23.410256
62
0.463308
oneofsunshine
d4e05aaa8660d582f77ea064cfc04eb35c534074
26,577
cc
C++
src/lib/fidl_codec/wire_object.cc
opensource-assist/fuschia
66646c55b3d0b36aae90a4b6706b87f1a6261935
[ "BSD-3-Clause" ]
null
null
null
src/lib/fidl_codec/wire_object.cc
opensource-assist/fuschia
66646c55b3d0b36aae90a4b6706b87f1a6261935
[ "BSD-3-Clause" ]
null
null
null
src/lib/fidl_codec/wire_object.cc
opensource-assist/fuschia
66646c55b3d0b36aae90a4b6706b87f1a6261935
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "wire_object.h" #include <iomanip> #include <iostream> #include <memory> #include <vector> #include "src/lib/fidl_codec/colors.h" #include "src/lib/fidl_codec/display_handle.h" #include "src/lib/fidl_codec/json_visitor.h" #include "src/lib/fidl_codec/library_loader.h" #include "src/lib/fidl_codec/visitor.h" #include "src/lib/fidl_codec/wire_types.h" #include "src/lib/fxl/logging.h" namespace fidl_codec { constexpr char kInvalid[] = "invalid"; constexpr char kNull[] = "null"; const Colors WithoutColors("", "", "", "", "", ""); const Colors WithColors(/*new_reset=*/"\u001b[0m", /*new_red=*/"\u001b[31m", /*new_green=*/"\u001b[32m", /*new_blue=*/"\u001b[34m", /*new_white_on_magenta=*/"\u001b[45m\u001b[37m", /*new_yellow_background=*/"\u001b[103m"); void Value::Visit(Visitor* visitor) const { visitor->VisitValue(this); } bool NullableValue::DecodeNullable(MessageDecoder* decoder, uint64_t offset, uint64_t size) { uintptr_t data; if (!decoder->GetValueAt(offset, &data)) { return false; } if (data == FIDL_ALLOC_ABSENT) { is_null_ = true; return true; } if (data != FIDL_ALLOC_PRESENT) { if (type() == nullptr) { decoder->AddError() << std::hex << (decoder->absolute_offset() + offset) << std::dec << ": Invalid value <" << std::hex << data << std::dec << "> for nullable\n"; } else { decoder->AddError() << std::hex << (decoder->absolute_offset() + offset) << std::dec << ": Invalid value <" << std::hex << data << std::dec << "> for nullable " << type()->Name() << "\n"; } return false; } uint64_t nullable_offset = decoder->next_object_offset(); // Set the offset for the next object (just after this one). decoder->SkipObject(size); // Decode the object. DecodeContent(decoder, nullable_offset); return true; } void NullableValue::Visit(Visitor* visitor) const { visitor->VisitNullableValue(this); } void InlineValue::DecodeContent(MessageDecoder* /*decoder*/, uint64_t /*offset*/) { FXL_LOG(FATAL) << "Value is defined inline"; } void InlineValue::Visit(Visitor* visitor) const { visitor->VisitInlineValue(this); } int RawValue::DisplaySize(int /*remaining_size*/) const { return data_ ? static_cast<int>(data_->size()) * 3 - 1 : 0; } void RawValue::PrettyPrint(std::ostream& os, const Colors& /*colors*/, const fidl_message_header_t* /*header*/, std::string_view /*line_header*/, int /*tabs*/, int /*remaining_size*/, int /*max_line_size*/) const { if (!data_ || data_->size() == 0) { return; } size_t buffer_size = data_->size() * 3; std::vector<char> buffer(buffer_size); for (size_t i = 0; i < data_->size(); ++i) { if (i != 0) { buffer[i * 3 - 1] = ' '; } snprintf(buffer.data() + (i * 3), 4, "%02x", (*data_)[i]); } os << buffer.data(); } void RawValue::Visit(Visitor* visitor) const { visitor->VisitRawValue(this); } template <> void NumericValue<uint8_t>::Visit(Visitor* visitor) const { visitor->VisitU8Value(this); } template <> void NumericValue<uint16_t>::Visit(Visitor* visitor) const { visitor->VisitU16Value(this); } template <> void NumericValue<uint32_t>::Visit(Visitor* visitor) const { visitor->VisitU32Value(this); } template <> void NumericValue<uint64_t>::Visit(Visitor* visitor) const { visitor->VisitU64Value(this); } template <> void NumericValue<int8_t>::Visit(Visitor* visitor) const { visitor->VisitI8Value(this); } template <> void NumericValue<int16_t>::Visit(Visitor* visitor) const { visitor->VisitI16Value(this); } template <> void NumericValue<int32_t>::Visit(Visitor* visitor) const { visitor->VisitI32Value(this); } template <> void NumericValue<int64_t>::Visit(Visitor* visitor) const { visitor->VisitI64Value(this); } template <> void NumericValue<float>::Visit(Visitor* visitor) const { visitor->VisitF32Value(this); } template <> void NumericValue<double>::Visit(Visitor* visitor) const { visitor->VisitF64Value(this); } int StringValue::DisplaySize(int /*remaining_size*/) const { if (is_null()) { return strlen(kNull); } if (!string_) { return strlen(kInvalid); } return static_cast<int>(string_->size()) + 2; // The two quotes. } void StringValue::DecodeContent(MessageDecoder* decoder, uint64_t offset) { auto data = reinterpret_cast<const char*>(decoder->GetAddress(offset, string_length_)); string_ = data ? std::optional(std::string(data, data + string_length_)) : std::nullopt; } void StringValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* /*header*/, std::string_view /*line_header*/, int /*tabs*/, int /*remaining_size*/, int /*max_line_size*/) const { os << colors.red; if (is_null()) { os << kNull; } else if (!string_) { os << kInvalid; } else { os << '"' << *string_ << '"'; } os << colors.reset; } void StringValue::Visit(Visitor* visitor) const { visitor->VisitStringValue(this); } int BoolValue::DisplaySize(int /*remaining_size*/) const { constexpr int kTrueSize = 4; constexpr int kFalseSize = 5; constexpr int kInvalidSize = 7; return value_ ? kInvalidSize : (*value_ ? kTrueSize : kFalseSize); } void BoolValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* /*header*/, std::string_view /*line_header*/, int /*tabs*/, int /*remaining_size*/, int /*max_line_size*/) const { if (!value_) { os << colors.red << "invalid" << colors.reset; } else { os << colors.blue << (*value_ ? "true" : "false") << colors.reset; } } void BoolValue::Visit(Visitor* visitor) const { visitor->VisitBoolValue(this); } int Object::DisplaySize(int remaining_size) const { if (is_null()) { return 4; } int size = 0; for (const auto& [name, value] : fields_) { // Two characters for the separator ("{ " or ", ") and three characters for // equal (" = "). constexpr int kExtraSize = 5; size += static_cast<int>(name.size()) + kExtraSize; if (value->type() != nullptr) { // Two characters for ": ". size += static_cast<int>(value->type()->Name().size()) + 2; } size += value->DisplaySize(remaining_size - size); if (size > remaining_size) { return size; } } // Two characters for the closing brace (" }"). size += 2; return size; } void Object::DecodeContent(MessageDecoder* decoder, uint64_t offset) { DecodeAt(decoder, offset); } void Object::DecodeAt(MessageDecoder* decoder, uint64_t base_offset) { for (const auto& member : struct_definition_.members()) { std::unique_ptr<Value> value = member->type()->Decode(decoder, base_offset + member->Offset(decoder)); if (value != nullptr) { fields_[std::string(member->name())] = std::move(value); } } } void Object::ExtractJson(rapidjson::Document::AllocatorType& allocator, rapidjson::Value& result) const { JsonVisitor visitor(&result, &allocator); Visit(&visitor); } void Object::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* header, std::string_view line_header, int tabs, int remaining_size, int max_line_size) const { if (is_null()) { os << colors.blue << "null" << colors.reset; } else if (fields_.empty()) { os << "{}"; } else if (DisplaySize(remaining_size) + static_cast<int>(line_header.size()) <= remaining_size) { const char* separator = "{ "; for (const auto& member : struct_definition_.members()) { auto it = fields_.find(std::string(member->name())); if (it == fields_.end()) continue; const auto& [name, value] = *it; os << separator << name; separator = ", "; if (value->type() != nullptr) { std::string type_name = value->type()->Name(); os << ": " << colors.green << type_name << colors.reset; } os << " = "; value->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size, max_line_size); } os << " }"; } else { os << "{\n"; for (const auto& member : struct_definition_.members()) { auto it = fields_.find(std::string(member->name())); if (it == fields_.end()) continue; const auto& [name, value] = *it; int size = (tabs + 1) * kTabSize + static_cast<int>(name.size()); os << line_header << std::string((tabs + 1) * kTabSize, ' ') << name; if (value->type() != nullptr) { std::string type_name = value->type()->Name(); // Two characters for ": ". size += static_cast<int>(type_name.size()) + 2; os << ": " << colors.green << type_name << colors.reset; } size += 3; os << " = "; value->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size - size, max_line_size); os << "\n"; } os << line_header << std::string(tabs * kTabSize, ' ') << '}'; } } void Object::Visit(Visitor* visitor) const { visitor->VisitObject(this); } EnvelopeValue::EnvelopeValue(const Type* type) : NullableValue(type) {} int EnvelopeValue::DisplaySize(int remaining_size) const { if (is_null() || (value_ == nullptr)) { return 4; } return value_->DisplaySize(remaining_size); } void EnvelopeValue::DecodeContent(MessageDecoder* decoder, uint64_t offset) { if (offset + num_bytes_ > decoder->num_bytes()) { decoder->AddError() << std::hex << (decoder->absolute_offset() + offset) << std::dec << ": Not enough data to decode an envelope\n"; return; } if (num_handles_ > decoder->GetRemainingHandles()) { decoder->AddError() << std::hex << (decoder->absolute_offset() + offset) << std::dec << ": Not enough handles to decode an envelope\n"; return; } MessageDecoder envelope_decoder(decoder, offset, num_bytes_, num_handles_); value_ = envelope_decoder.DecodeValue(type()); } void EnvelopeValue::DecodeAt(MessageDecoder* decoder, uint64_t base_offset) { decoder->GetValueAt(base_offset, &num_bytes_); base_offset += sizeof(num_bytes_); decoder->GetValueAt(base_offset, &num_handles_); base_offset += sizeof(num_handles_); if (DecodeNullable(decoder, base_offset, num_bytes_)) { if (type() == nullptr) { if (!is_null()) { decoder->AddError() << std::hex << (decoder->absolute_offset() + base_offset) << std::dec << ": The envelope should be null\n"; } } if (is_null()) { if (num_bytes_ != 0) { decoder->AddError() << std::hex << (decoder->absolute_offset() + base_offset) << std::dec << ": Null envelope shouldn't have bytes\n"; } if (num_handles_ != 0) { decoder->AddError() << std::hex << (decoder->absolute_offset() + base_offset) << std::dec << ": Null envelope shouldn't have handles\n"; } } } } void EnvelopeValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* header, std::string_view line_header, int tabs, int remaining_size, int max_line_size) const { if (is_null() || (value_ == nullptr)) { os << colors.red << "null" << colors.reset; } else { value_->PrettyPrint(os, colors, header, line_header, tabs, remaining_size, max_line_size); } } void EnvelopeValue::Visit(Visitor* visitor) const { visitor->VisitEnvelopeValue(this); } TableValue::TableValue(const Type* type, const Table& table_definition, uint64_t envelope_count) : NullableValue(type), table_definition_(table_definition), envelope_count_(envelope_count) {} int TableValue::DisplaySize(int remaining_size) const { int size = 0; for (const auto& field : envelopes_) { if ((field.value() != nullptr) && !field.value()->is_null()) { // Two characters for the separator ("{ " or ", ") and three characters // for equal (" = "). constexpr int kExtraSize = 5; size += static_cast<int>(field.name().size()) + kExtraSize; if (field.value()->type() != nullptr) { size += static_cast<int>(field.value()->type()->Name().size()) + 2; } size += field.value()->DisplaySize(remaining_size - size); if (size > remaining_size) { return size; } } } // Two characters for the closing brace (" }"). size += 2; return size; } void TableValue::DecodeContent(MessageDecoder* decoder, uint64_t offset) { for (uint64_t envelope_id = 0; envelope_id < envelope_count_; ++envelope_id) { const TableMember* member = (envelope_id < table_definition_.members().size() - 1) ? table_definition_.members()[envelope_id + 1] : nullptr; std::unique_ptr<EnvelopeValue> envelope; std::string key_name; if (member == nullptr) { key_name = std::string("unknown$") + std::to_string(envelope_id + 1); envelope = std::make_unique<EnvelopeValue>(table_definition_.unknown_member_type()); } else { key_name = member->name(); envelope = std::make_unique<EnvelopeValue>(member->type()); } envelope->DecodeAt(decoder, offset); envelopes_.emplace_back(key_name, std::move(envelope)); offset += 2 * sizeof(uint64_t); } } void TableValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* header, std::string_view line_header, int tabs, int remaining_size, int max_line_size) const { int display_size = DisplaySize(remaining_size); if (display_size == 2) { os << "{}"; } else if (DisplaySize(remaining_size) + static_cast<int>(line_header.size()) <= remaining_size) { const char* separator = "{ "; for (const auto& field : envelopes_) { if ((field.value() != nullptr) && !field.value()->is_null()) { os << separator << field.name(); separator = ", "; if (field.value()->type() != nullptr) { std::string type_name = field.value()->type()->Name(); os << ": " << colors.green << type_name << colors.reset; } os << " = "; field.value()->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size, max_line_size); } } os << " }"; } else { os << "{\n"; for (const auto& field : envelopes_) { if ((field.value() != nullptr) && !field.value()->is_null()) { int size = (tabs + 1) * kTabSize + static_cast<int>(field.name().size()) + 3; os << line_header << std::string((tabs + 1) * kTabSize, ' ') << field.name(); if (field.value()->type() != nullptr) { std::string type_name = field.value()->type()->Name(); size += static_cast<int>(type_name.size()) + 2; os << ": " << colors.green << type_name << colors.reset; } os << " = "; field.value()->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size - size, max_line_size); os << "\n"; } } os << line_header << std::string(tabs * kTabSize, ' ') << '}'; } } void TableValue::Visit(Visitor* visitor) const { visitor->VisitTableValue(this); } int UnionValue::DisplaySize(int remaining_size) const { if (is_null() || field_.value()->is_null()) { return 4; } // Two characters for the opening brace ("{ ") + three characters for equal // (" = ") and two characters for the closing brace (" }"). constexpr int kExtraSize = 7; int size = static_cast<int>(field_.name().size()) + kExtraSize; if (field_.value() != nullptr) { if (field_.value()->type() != nullptr) { // Two characters for ": ". size += static_cast<int>(field_.value()->type()->Name().size()) + 2; } size += field_.value()->DisplaySize(remaining_size - size); } return size; } void UnionValue::DecodeContent(MessageDecoder* decoder, uint64_t offset) { DecodeAt(decoder, offset); } void UnionValue::DecodeAt(MessageDecoder* decoder, uint64_t base_offset) { uint32_t tag = 0; decoder->GetValueAt(base_offset, &tag); const UnionMember* member = union_definition_.MemberWithTag(tag); if (member == nullptr) { field_ = Field("unknown$" + std::to_string(tag), std::make_unique<RawValue>(nullptr, std::nullopt)); } else { field_ = Field(std::string(member->name()), member->type()->Decode(decoder, base_offset + member->offset())); } } void UnionValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* header, std::string_view line_header, int tabs, int remaining_size, int max_line_size) const { if (header != nullptr) { os << (fidl_should_decode_union_from_xunion(header) ? "v1!" : "v0!"); } if (is_null() || field_.value()->is_null()) { os << colors.blue << "null" << colors.reset; } else if (DisplaySize(remaining_size) + static_cast<int>(line_header.size()) <= remaining_size) { // Two characters for the opening brace ("{ ") + three characters for equal // (" = ") and two characters for the closing brace (" }"). constexpr int kExtraSize = 7; int size = static_cast<int>(field_.name().size()) + kExtraSize; os << "{ " << field_.name(); if (field_.value() != nullptr) { if (field_.value()->type() != nullptr) { std::string type_name = field_.value()->type()->Name(); // Two characters for ": ". size += static_cast<int>(type_name.size()) + 2; os << ": " << colors.green << type_name << colors.reset; } os << " = "; field_.value()->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size - size, max_line_size); } os << " }"; } else { os << "{\n"; // Three characters for " = ". int size = (tabs + 1) * kTabSize + static_cast<int>(field_.name().size()) + 3; os << line_header << std::string((tabs + 1) * kTabSize, ' ') << field_.name(); if (field_.value() != nullptr) { if (field_.value()->type() != nullptr) { std::string type_name = field_.value()->type()->Name(); // Two characters for ": ". size += static_cast<int>(type_name.size()) + 2; os << ": " << colors.green << type_name << colors.reset; } os << " = "; field_.value()->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size - size, max_line_size); } os << '\n'; os << line_header << std::string(tabs * kTabSize, ' ') << "}"; } } void UnionValue::Visit(Visitor* visitor) const { visitor->VisitUnionValue(this); } void XUnionValue::Visit(Visitor* visitor) const { visitor->VisitXUnionValue(this); } int ArrayValue::DisplaySize(int remaining_size) const { int size = 2; for (const auto& value : values_) { // Two characters for ", ". size += value->DisplaySize(remaining_size - size) + 2; if (size > remaining_size) { return size; } } return size; } void ArrayValue::DecodeContent(MessageDecoder* /*decoder*/, uint64_t /*offset*/) { FXL_LOG(FATAL) << "Value is defined inline"; } void ArrayValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* header, std::string_view line_header, int tabs, int remaining_size, int max_line_size) const { if (values_.empty()) { os << "[]"; } else if (DisplaySize(remaining_size) + static_cast<int>(line_header.size()) <= remaining_size) { const char* separator = "[ "; for (const auto& value : values_) { os << separator; separator = ", "; value->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size, max_line_size); } os << " ]"; } else { os << "[\n"; for (const auto& value : values_) { int size = (tabs + 1) * kTabSize; os << line_header << std::string((tabs + 1) * kTabSize, ' '); value->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size - size, max_line_size); os << "\n"; } os << line_header << std::string(tabs * kTabSize, ' ') << ']'; } } void ArrayValue::Visit(Visitor* visitor) const { visitor->VisitArrayValue(this); } int VectorValue::DisplaySize(int remaining_size) const { if (is_null()) { return 4; } if (is_string_) { return static_cast<int>(size_ + 2); // The string and the two quotes. } int size = 0; for (const auto& value : values_) { // Two characters for the separator ("[ " or ", "). size += value->DisplaySize(remaining_size - size) + 2; if (size > remaining_size) { return size; } } // Two characters for the closing bracket (" ]"). size += 2; return size; } void VectorValue::DecodeContent(MessageDecoder* decoder, uint64_t offset) { if (size_ == 0) { return; } is_string_ = true; for (uint64_t i = 0; (i < size_) && (offset + component_type_->InlineSize(decoder) <= decoder->num_bytes()); ++i) { std::unique_ptr<Value> value = component_type_->Decode(decoder, offset); if (value != nullptr) { uint8_t uvalue = value->GetUint8Value(); if (!std::isprint(uvalue)) { if ((uvalue == '\r') || (uvalue == '\n')) { has_new_line_ = true; } else { is_string_ = false; } } values_.push_back(std::move(value)); } offset += component_type_->InlineSize(decoder); } } void VectorValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* header, std::string_view line_header, int tabs, int remaining_size, int max_line_size) const { if (is_null()) { os << colors.blue << "null" << colors.reset; } else if (values_.empty()) { os << "[]"; } else if (is_string_) { if (has_new_line_) { os << "[\n"; bool needs_header = true; for (const auto& value : values_) { if (needs_header) { os << line_header << std::string((tabs + 1) * kTabSize, ' '); needs_header = false; } uint8_t uvalue = value->GetUint8Value(); os << uvalue; if (uvalue == '\n') { needs_header = true; } } if (!needs_header) { os << '\n'; } os << line_header << std::string(tabs * kTabSize, ' ') << ']'; } else { os << '"'; for (const auto& value : values_) { os << value->GetUint8Value(); } os << '"'; } } else if (DisplaySize(remaining_size) + static_cast<int>(line_header.size()) <= remaining_size) { const char* separator = "[ "; for (const auto& value : values_) { os << separator; separator = ", "; value->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size, max_line_size); } os << " ]"; } else { os << "[\n"; int size = 0; for (const auto& value : values_) { int value_size = value->DisplaySize(max_line_size - size); if (size == 0) { os << line_header << std::string((tabs + 1) * kTabSize, ' '); size = (tabs + 1) * kTabSize; } else if (value_size + 3 > max_line_size - size) { os << ",\n"; os << line_header << std::string((tabs + 1) * kTabSize, ' '); size = (tabs + 1) * kTabSize; } else { os << ", "; size += 2; } value->PrettyPrint(os, colors, header, line_header, tabs + 1, max_line_size - size, max_line_size); size += value_size; } os << '\n'; os << line_header << std::string(tabs * kTabSize, ' ') << ']'; } } void VectorValue::Visit(Visitor* visitor) const { visitor->VisitVectorValue(this); } int EnumValue::DisplaySize(int /*remaining_size*/) const { if (!data_) { return strlen(kInvalid); } return enum_definition_.GetNameFromBytes(data_->data()).size(); } void EnumValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* /*header*/, std::string_view /*line_header*/, int /*tabs*/, int /*remaining_size*/, int /*max_line_size*/) const { if (!data_) { os << colors.red << kInvalid << colors.reset; } else { os << colors.blue << enum_definition_.GetNameFromBytes(data_->data()) << colors.reset; } } void EnumValue::Visit(Visitor* visitor) const { visitor->VisitEnumValue(this); } int BitsValue::DisplaySize(int /*remaining_size*/) const { if (!data_) { return strlen(kInvalid); } return bits_definition_.GetNameFromBytes(data_->data()).size(); } void BitsValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* /*header*/, std::string_view /*line_header*/, int /*tabs*/, int /*remaining_size*/, int /*max_line_size*/) const { if (!data_) { os << colors.red << kInvalid << colors.reset; } else { os << colors.blue << bits_definition_.GetNameFromBytes(data_->data()) << colors.reset; } } void BitsValue::Visit(Visitor* visitor) const { visitor->VisitBitsValue(this); } int HandleValue::DisplaySize(int /*remaining_size*/) const { return std::to_string(handle_.handle).size(); } void HandleValue::DecodeContent(MessageDecoder* /*decoder*/, uint64_t /*offset*/) { FXL_LOG(FATAL) << "Handle value is defined inline"; } void HandleValue::PrettyPrint(std::ostream& os, const Colors& colors, const fidl_message_header_t* /*header*/, std::string_view /*line_header*/, int /*tabs*/, int /*remaining_size*/, int /*max_line_size*/) const { DisplayHandle(colors, handle_, os); } void HandleValue::Visit(Visitor* visitor) const { visitor->VisitHandleValue(this); } } // namespace fidl_codec
36.208447
100
0.594236
opensource-assist
d4e0fa3bc07a83ad0fad4cc327a560b227fcc8ce
2,047
hpp
C++
czrpc/base/singleton.hpp
chxuan/czrpc
95695f6400e8d981f6e451707937cea3d92c87d5
[ "MIT" ]
5
2017-02-12T14:39:28.000Z
2021-10-07T04:54:09.000Z
czrpc/base/singleton.hpp
xulinzhang/czrpc
95695f6400e8d981f6e451707937cea3d92c87d5
[ "MIT" ]
null
null
null
czrpc/base/singleton.hpp
xulinzhang/czrpc
95695f6400e8d981f6e451707937cea3d92c87d5
[ "MIT" ]
4
2018-08-24T02:31:14.000Z
2021-02-20T07:34:29.000Z
#pragma once #include <iostream> #include <mutex> namespace czrpc { namespace base { template<typename T> class singleton_helper { public: singleton_helper() = delete; virtual ~singleton_helper() = delete; singleton_helper(const singleton_helper&) = delete; singleton_helper& operator=(const singleton_helper&) = delete; static T* get() { static T t; return &t; } }; #define DEFINE_SINGLETON(class_name) \ public: \ friend class singleton_helper<class_name>; \ using singleton = singleton_helper<class_name>; \ private: \ virtual ~class_name() {} \ class_name(const class_name&) = delete; \ class_name& operator=(const class_name&) = delete; \ public: template<typename T> class singleton_helper_with_param { public: singleton_helper_with_param() = delete; virtual ~singleton_helper_with_param() = delete; singleton_helper_with_param(const singleton_helper_with_param&) = delete; singleton_helper_with_param& operator=(const singleton_helper_with_param&) = delete; template<typename... Args> static void create(Args&&... args) { if (t_ == nullptr) { std::lock_guard<std::mutex> lock(mutex_); if (t_ == nullptr) { t_ = new T(std::forward<Args>(args)...); } } } static void destroy() { if (t_ != nullptr) { delete t_; t_ = nullptr; } } static T* get() { return t_; } private: static T* t_; static std::mutex mutex_; }; template<typename T> T* singleton_helper_with_param<T>::t_ = nullptr; template<typename T> std::mutex singleton_helper_with_param<T>::mutex_; #define DEFINE_SINGLETON_WITH_PARAM(class_name) \ public: \ friend class singleton_helper_with_param<class_name>; \ using singleton = singleton_helper_with_param<class_name>; \ private: \ virtual ~class_name() {} \ class_name(const class_name&) = delete; \ class_name& operator=(const class_name&) = delete; \ public: } }
22.25
88
0.655105
chxuan
d4e11eed102183d3ddb1cf50c75b0bde7504b6d5
1,049
cpp
C++
tests/eventloop_test.cpp
lddddd1997/NetServer
940b84bef7d0856bc2fe5f16164bfe041e4d4c9f
[ "MIT" ]
null
null
null
tests/eventloop_test.cpp
lddddd1997/NetServer
940b84bef7d0856bc2fe5f16164bfe041e4d4c9f
[ "MIT" ]
null
null
null
tests/eventloop_test.cpp
lddddd1997/NetServer
940b84bef7d0856bc2fe5f16164bfe041e4d4c9f
[ "MIT" ]
null
null
null
// #include <EventLoopThread.h> // #include <iostream> // #include <unistd.h> // using namespace std; // // g++ eventloop_test.cpp EventLoopThread.cpp EventLoop.cpp Channel.cpp Epoller.cpp -I . -pthread // void print(EventLoop *p = nullptr) // { // printf("print: pid = %d, tid = %ld, loop = %p\n", // getpid(), this_thread::get_id(), p); // } // void quit(EventLoop* p) // { // print(p); // p->CommitTaskToLoop(std::bind(print, p)); // // p->Quit(); // } // int main() // { // print(); // { // EventLoopThread thr1; // never start // } // // { // // // dtor calls quit() // // EventLoopThread thr2; // // EventLoop* loop = thr2.StartLoop(); // // loop->CommitTaskToLoop(std::bind(print, loop)); // // // sleep(5); // // } // { // // quit() before dtor // EventLoopThread thr3; // EventLoop* loop = thr3.StartLoop(); // loop->CommitTaskToLoop(std::bind(quit, loop)); // sleep(5); // } // return 0; // }
22.804348
100
0.503337
lddddd1997
d4e415253b0aece975c5bf55a54b123d4eb9403e
9,659
cpp
C++
VirtualBox-5.0.0/src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp
egraba/vbox_openbsd
6cb82f2eed1fa697d088cecc91722b55b19713c2
[ "MIT" ]
1
2015-04-30T14:18:45.000Z
2015-04-30T14:18:45.000Z
VirtualBox-5.0.0/src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp
egraba/vbox_openbsd
6cb82f2eed1fa697d088cecc91722b55b19713c2
[ "MIT" ]
null
null
null
VirtualBox-5.0.0/src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp
egraba/vbox_openbsd
6cb82f2eed1fa697d088cecc91722b55b19713c2
[ "MIT" ]
null
null
null
/* $Id: tstFileAppendWin-1.cpp $ */ /** @file * IPRT Testcase - Exploration of File Appending on Windows. */ /* * Copyright (C) 2008-2015 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. * * The contents of this file may alternatively be used under the terms * of the Common Development and Distribution License Version 1.0 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the * VirtualBox OSE distribution, in which case the provisions of the * CDDL are applicable instead of those of the GPL. * * You may elect to license modified versions of this file under the * terms and conditions of either the GPL or the CDDL or both. */ /******************************************************************************* * Header Files * *******************************************************************************/ #include <Windows.h> #include <stdio.h> #include <string.h> #include <stdarg.h> /******************************************************************************* * Global Variables * *******************************************************************************/ static int g_cErrors = 0; static int MyFailure(const char *pszFormat, ...) { va_list va; printf("tstFileAppendWin-1: FATAL: "); va_start(va, pszFormat); vprintf(pszFormat, va); va_end(va); g_cErrors++; return 1; } void MyError(const char *pszFormat, ...) { va_list va; printf("tstFileAppendWin-1: ERROR: "); va_start(va, pszFormat); vprintf(pszFormat, va); va_end(va); g_cErrors++; } int main() { HANDLE hFile; LARGE_INTEGER off; DWORD cb; char szBuf[256]; printf("tstFileAppendWin-1: TESTING...\n"); /* * Open it write only and do some appending. * Checking that read fails and that the file position changes after the read. */ DeleteFile("tstFileAppendWin-1.tst"); hFile = CreateFile("tstFileAppendWin-1.tst", (FILE_GENERIC_WRITE & ~FILE_WRITE_DATA), FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) return MyFailure("1st CreateFile: %d\n", GetLastError()); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("1st SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 0) MyError("unexpected position on open: %ld - expected 0\n", (long)off.QuadPart); if (!WriteFile(hFile, "0123456789", 10, &cb, NULL)) MyError("write fail: %d\n", GetLastError()); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("2nd SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 10) MyError("unexpected position on write: %ld - expected 10\n", (long)off.QuadPart); else printf("tstFileAppendWin-1: off=%ld after first write\n", (long)off.QuadPart); SetLastError(0); if (ReadFile(hFile, szBuf, 1, &cb, NULL)) MyError("read didn't fail! cb=%#lx lasterr=%d\n", (long)cb, GetLastError()); off.QuadPart = 5; if (!SetFilePointerEx(hFile, off, &off, FILE_BEGIN)) MyError("3rd SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 5) MyError("unexpected position after set file pointer: %ld - expected 5\n", (long)off.QuadPart); CloseHandle(hFile); /* * Open it write only and do some more appending. * Checking the initial position and that it changes after the write. */ hFile = CreateFile("tstFileAppendWin-1.tst", (FILE_GENERIC_WRITE & ~FILE_WRITE_DATA), FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) return MyFailure("2nd CreateFile: %d\n", GetLastError()); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("4th SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 0) MyError("unexpected position on open: %ld - expected 0\n", (long)off.QuadPart); else printf("tstFileAppendWin-1: off=%ld on 2nd open\n", (long)off.QuadPart); if (!WriteFile(hFile, "abcdefghij", 10, &cb, NULL)) MyError("2nd write failed: %d\n", GetLastError()); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("5th SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 20) MyError("unexpected position on 2nd write: %ld - expected 20\n", (long)off.QuadPart); else printf("tstFileAppendWin-1: off=%ld after 2nd write\n", (long)off.QuadPart); CloseHandle(hFile); /* * Open it read/write. * Check the initial position and read stuff. Then append some more and * check the new position and see that read returns 0/EOF. Finally, * do some seeking and read from a new position. */ hFile = CreateFile("tstFileAppendWin-1.tst", (FILE_GENERIC_WRITE & ~FILE_WRITE_DATA) | GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) return MyFailure("3rd CreateFile: %d\n", GetLastError()); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("6th SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 0) MyError("unexpected position on open: %ld - expected 0\n", (long)off.QuadPart); else printf("tstFileAppendWin-1: off=%ld on 3rd open\n", (long)off.QuadPart); if (!ReadFile(hFile, szBuf, 10, &cb, NULL) || cb != 10) MyError("1st ReadFile failed: %d\n", GetLastError()); else if (memcmp(szBuf, "0123456789", 10)) MyError("read the wrong stuff: %.10s - expected 0123456789\n", szBuf); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("7th SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 10) MyError("unexpected position on 1st read: %ld - expected 0\n", (long)off.QuadPart); else printf("tstFileAppendWin-1: off=%ld on 1st read\n", (long)off.QuadPart); if (!WriteFile(hFile, "klmnopqrst", 10, &cb, NULL)) MyError("3rd write failed: %d\n", GetLastError()); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("8th SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 30) MyError("unexpected position on 3rd write: %ld - expected 30\n", (long)off.QuadPart); else printf("tstFileAppendWin-1: off=%ld after 3rd write\n", (long)off.QuadPart); SetLastError(0); if (ReadFile(hFile, szBuf, 1, &cb, NULL) && cb != 0) MyError("read after write didn't fail! cb=%#lx lasterr=%d\n", (long)cb, GetLastError()); off.QuadPart = 15; if (!SetFilePointerEx(hFile, off, &off, FILE_BEGIN)) MyError("9th SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 15) MyError("unexpected position on 3rd write: %ld - expected 15\n", (long)off.QuadPart); else { if (!ReadFile(hFile, szBuf, 10, &cb, NULL) || cb != 10) MyError("1st ReadFile failed: %d\n", GetLastError()); else if (memcmp(szBuf, "fghijklmno", 10)) MyError("read the wrong stuff: %.10s - expected fghijklmno\n", szBuf); off.QuadPart = 0; if (!SetFilePointerEx(hFile, off, &off, FILE_CURRENT)) MyError("10th SetFilePointerEx failed: %d\n", GetLastError()); else if (off.QuadPart != 25) MyError("unexpected position on 2nd read: %ld - expected 25\n", (long)off.QuadPart); else printf("tstFileAppendWin-1: off=%ld after 2nd read\n", (long)off.QuadPart); } CloseHandle(hFile); /* * Open it read only + append and check that we cannot write to it. */ hFile = CreateFile("tstFileAppendWin-1.tst", FILE_APPEND_DATA | GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) return MyFailure("4th CreateFile: %d\n", GetLastError()); SetLastError(0); if (WriteFile(hFile, "pqrstuvwx", 10, &cb, NULL)) MyError("write didn't on read-only+append open: %d cb=%#lx\n", GetLastError(), (long)cb); CloseHandle(hFile); DeleteFile("tstfileAppendWin-1.tst"); if (g_cErrors) printf("tstFileAppendWin-1: FAILED\n"); else printf("tstFileAppendWin-1: SUCCESS\n"); return g_cErrors ? 1 : 0; }
37.293436
102
0.586707
egraba
d4e42d3f21202f45938ecfb54efe2260b204a37d
10,259
cpp
C++
logdevice/clients/python/logdevice_reader.cpp
mickvav/LogDevice
24a8b6abe4576418eceb72974083aa22d7844705
[ "BSD-3-Clause" ]
1
2021-05-19T23:01:58.000Z
2021-05-19T23:01:58.000Z
logdevice/clients/python/logdevice_reader.cpp
mickvav/LogDevice
24a8b6abe4576418eceb72974083aa22d7844705
[ "BSD-3-Clause" ]
null
null
null
logdevice/clients/python/logdevice_reader.cpp
mickvav/LogDevice
24a8b6abe4576418eceb72974083aa22d7844705
[ "BSD-3-Clause" ]
null
null
null
/** * Copyright (c) 2017-present, Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <algorithm> #include <atomic> #include <chrono> #include <cmath> #include <boost/make_shared.hpp> #include "logdevice/clients/python/util/util.h" #include "logdevice/include/Client.h" using namespace boost::python; using namespace facebook::logdevice; // A class that implements the Python iterator interface, and treats the // LogDevice Reader.read method as an infinite iterator -- returning one // record at a time, from the internal buffer that the Reader already // contains, and returns it. // // This has some inter-thread communication overhead, so we might need to do a // little less calling into Reader, and a bit more "serve out of our own // buffer", to reduce that overhead -- since we can be non-locking in here, // while they have to be locking. class ReaderWrapper : boost::noncopyable { public: explicit ReaderWrapper(std::unique_ptr<Reader> reader) : reader_(std::move(reader)), keep_reading_(true) { // this determines the minimum delay to shut down reading from outside, // once LogDevice have a method to break out (thread-)safely from // iteration, this can go away in favour of not emulating their timeout. auto timeout = std::chrono::milliseconds(1000); reader_->setTimeout(timeout); }; /** * Return the next (DataRecord, GapRecord) pair, in which exactly one of the * two is not None. * * Ownership of a DataRecord or GapRecord is handed to Python in a * boost::shared_ptr, which will arrange to destroy it when the Python * object wrapper goes out of scope and is garbage collected. */ boost::python::tuple next() { std::vector<std::unique_ptr<DataRecord>> record; GapRecord gap; while (keep_reading_ && reader_->isReadingAny()) { // check for signals using Python layer, and raise if one was found; // the PyErr_CheckSignals function sets the error indicator. if (PyErr_CheckSignals() != 0) throw_python_exception(); // read one record, which is a blocking operation, so ensure that we // don't hold the Python GIL while we do it. we reacquire it at the end // of the read because we are doing things (like Python exception // handling) that require the lock. ssize_t n = 0; { gil_release_and_guard guard; n = reader_->read(1, &record, &gap); } if (n < 0) { if (err == E::GAP) { return boost::python::make_tuple(object(), // DataRecord is None boost::make_shared<GapRecord>(gap)); } throw_logdevice_exception(); throw std::runtime_error("unpossible, the line above always throws!"); } if (n > 0) { // Got a data record return boost::python::make_tuple( // TODO boost::shared_ptr(std::unique_ptr) constructor requires // Boost >= 1.57 which not all of our deps are ready for. // boost::shared_ptr<DataRecord>(std::move(record[0])), boost::shared_ptr<DataRecord>(record[0].release()), object() // GapRecord is None ); } // no records found in our logs before the timeout, so we exited // just to check if we should terminate iteration early, and then // go back to waiting. } // this is how you tell Python we ran out of things to do. throw_python_exception(PyExc_StopIteration, "No more data."); throw std::runtime_error("unpossible, the line above always throws!"); } bool stop_iteration() { keep_reading_ = false; return true; // yes, we did stop as you requested } bool start_reading(logid_t logid, lsn_t from, lsn_t until = LSN_MAX) { if (reader_->startReading(logid, from, until) == 0) return true; throw_logdevice_exception(); throw std::runtime_error("unpossible, the line above always throws!"); } bool stop_reading(logid_t logid) { if (reader_->stopReading(logid) == 0) return true; throw_logdevice_exception(); throw std::runtime_error("unpossible, the line above always throws!"); } bool is_connection_healthy(logid_t logid) { switch (reader_->isConnectionHealthy(logid)) { case 1: return true; case 0: return false; default: throw_logdevice_exception(); throw std::runtime_error("unpossible, the line above always throws!"); }; } bool without_payload() { reader_->withoutPayload(); return true; } private: // our reader std::unique_ptr<Reader> reader_; // should we break out from reading? std::atomic<bool> keep_reading_; }; // helper function to wrap a reader for return to Python -- helps hide the // class, which nobody else needs to know about object wrap_logdevice_reader(std::unique_ptr<Reader> reader) { // boost::shared_ptr is used because boost::python understands it, but does // not understand std::shared_ptr. auto wrapper = boost::shared_ptr<ReaderWrapper>(new ReaderWrapper(std::move(reader))); return object(wrapper); } // The Python iterator protocol requires that we return ourself from a method // call; this simply returns the existing Python object, which allows that // to work. object identity(object const& o) { return o; } // Generate overloads to handle the optional argument to start_reading() #pragma GCC diagnostic ignored "-Wunused-local-typedefs" BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(start_reading_overloads, ReaderWrapper::start_reading, 2, 3) void register_logdevice_reader() { class_<ReaderWrapper, boost::shared_ptr<ReaderWrapper>, boost::noncopyable>( "Reader", R"DOC( A LogDevice reader, able to read from one or more logs and return records from them. If reading more than one log there is no assurance of sequencing between logs, but records in any individual log will be strictly ordered. The reader yields (data, gap) pairs. In each pair, exactly one of the two is not None. If a data record is available, the first element is a DataRecord instance. Otherwise, there is a gap in the numbering sequence; the second element is a GapRecord instance. This class is NOT thread safe, and you MUST NOT call any method on it from another thread. This includes calling any method while iterating on log entries with the read() method! )DOC", no_init) .def("__iter__", &identity) .def(NEXT_METHOD, &ReaderWrapper::next, R"DOC( Implement the 'next' operation from the Python iterator protocol. This will read until the 'stop_iteration()' method is called from Python, or a record (data or gap) can be returned. )DOC") .def("stop_iteration", &ReaderWrapper::stop_iteration, "Stop iteration immediately, breaking out of any wait.\n" "This is thread-safe.") .def("start_reading", &ReaderWrapper::start_reading, start_reading_overloads(args("logid", "from", "until"), "Start reading log LOGID from LSN FROM " "through LSN UNTIL (optional)")) .def("stop_reading", &ReaderWrapper::stop_reading, R"DOC(Stop reading log LOGID. WARNING: This is not suitable for breaking out early from reading on the log! This will cause internal corruption and SEVs. )DOC") .def("is_connection_healthy", &ReaderWrapper::is_connection_healthy, R"DOC( Checks if the connection to the LogDevice cluster for a log appears healthy. When a read() call times out, this can be used to make an informed guess whether this is because there is no data or because there a service interruption. NOTE: this is not 100% accurate but will expose common issues like losing network connectivity. This returns True if everything looked healthy when checked, or False if something went wrong talking to the cluster. It can also raise an exception if something terrible goes wrong during the process of checking. )DOC") // TODO: danielp 2015-03-17: disabled until LogDevice has a native "break // out // of read early" function that is thread-safe, since we use timeout // internally. If this is actually needed in code we can emulate it, but // until then lets disable it but keep the code present. // // .def("set_timeout", [](ReaderWrapper &self, double seconds) { // auto ts = std::chrono::milliseconds( // // support -1 == unlimited convention // seconds == -1 ? -1 : lround(seconds * 1000) // ); // if (self.reader->setTimeout(ts) == 0) // return true; // throw_logdevice_exception(); // TODO: danielp 2015-03-13: I // assume // // this is set when this failure // // happens, because it is for // // everything else. // }, // R"DOC( // Sets the limit on how long the iterator returned from read() may wait // for // records to become available. A timeout of -1 means no limit (infinite // timeout). A timeout of 0 means no waiting (nonblocking reads). // // When the timeout is hit without new records being returned the iterator // will reach the 'end' of the iteration, and the Python for loop will // return. // // If you set an infinite timeout there is no way to break out early from // reading, so be careful about your decisions. // )DOC" // ) .def("without_payload", &ReaderWrapper::without_payload, R"DOC( If called, data records read by this Reader will not include payloads. This makes reading more efficient when payloads are not needed (they won't be transmitted over the network). )DOC"); }
36.902878
80
0.651915
mickvav
d4e6742e509a534b5d9f6b7fd58d812161159754
694
cpp
C++
cpp_dsgn_pattern_n_derivatives_pricing/chapter16/exercise16_1/exercise16_1/TreeProductsDecoupling.cpp
calvin456/intro_derivative_pricing
0841fbc0344bee00044d67977faccfd2098b5887
[ "MIT" ]
5
2016-12-28T16:07:38.000Z
2022-03-11T09:55:57.000Z
cpp_dsgn_pattern_n_derivatives_pricing/chapter16/exercise16_1/exercise16_1/TreeProductsDecoupling.cpp
calvin456/intro_derivative_pricing
0841fbc0344bee00044d67977faccfd2098b5887
[ "MIT" ]
null
null
null
cpp_dsgn_pattern_n_derivatives_pricing/chapter16/exercise16_1/exercise16_1/TreeProductsDecoupling.cpp
calvin456/intro_derivative_pricing
0841fbc0344bee00044d67977faccfd2098b5887
[ "MIT" ]
5
2017-06-04T04:50:47.000Z
2022-03-17T17:41:16.000Z
//TreeProductsDecoupling.cpp #include "TreeProductsDecoupling.h" TreeProduct::TreeProduct(double FinalTime_) : FinalTime(FinalTime_) { } double TreeProduct::GetFinalTime() const { return FinalTime; } /* * * Copyright (c) 2002 * Mark Joshi * * Permission to use, copy, modify, distribute and sell this * software for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Mark Joshi makes no representations about the * suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. */
23.133333
63
0.772334
calvin456
d4e6f627ea3a154d7cb6c140543469ad6399fadf
2,449
cpp
C++
C++ aleatorios/C++/main.cpp
higorslva/projetos-universidade
92ed784025c85369f722f5d06c7a42fff7957f2e
[ "Apache-2.0" ]
null
null
null
C++ aleatorios/C++/main.cpp
higorslva/projetos-universidade
92ed784025c85369f722f5d06c7a42fff7957f2e
[ "Apache-2.0" ]
null
null
null
C++ aleatorios/C++/main.cpp
higorslva/projetos-universidade
92ed784025c85369f722f5d06c7a42fff7957f2e
[ "Apache-2.0" ]
null
null
null
#include <windows.h> #include <stdio.h> #include <stdlib.h> /* This is where all the input to the window goes to */ LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) { /* Upon destruction, tell the main thread to stop */ case WM_DESTROY: { PostQuitMessage(0); break; } /* All other messages (a lot of them) are processed using default procedures */ default: return DefWindowProc(hwnd, Message, wParam, lParam); } return 0; } /* The 'main' function of Win32 GUI programs: this is where execution starts */ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASSEX wc; /* A properties struct of our window */ HWND hwnd; /* A 'HANDLE', hence the H, or a pointer to our window */ MSG msg; /* A temporary location for all messages */ /* zero out the struct and set the stuff we want to modify */ memset(&wc,0,sizeof(wc)); wc.cbSize = sizeof(WNDCLASSEX); wc.lpfnWndProc = WndProc; /* This is where we will send messages to */ wc.hInstance = hInstance; wc.hCursor = LoadCursor(NULL, IDC_ARROW); /* White, COLOR_WINDOW is just a #define for a system color, try Ctrl+Clicking it */ wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszClassName = "WindowClass"; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); /* Load a standard icon */ wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); /* use the name "A" to use the project icon */ if(!RegisterClassEx(&wc)) { MessageBox(NULL, "Window Registration Failed!","Error!",MB_ICONEXCLAMATION|MB_OK); return 0; } hwnd = CreateWindowEx(WS_EX_CLIENTEDGE,"WindowClass","Caption",WS_VISIBLE|WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, /* x */ CW_USEDEFAULT, /* y */ 640, /* width */ 480, /* height */ NULL,NULL,hInstance,NULL); if(hwnd == NULL) { MessageBox(NULL, "Window Creation Failed!","Error!",MB_ICONEXCLAMATION|MB_OK); return 0; } /* This is the heart of our program where all input is processed and sent to WndProc. Note that GetMessage blocks code flow until it receives something, so this loop will not produce unreasonably high CPU usage */ while(GetMessage(&msg, NULL, 0, 0) > 0) { /* If no error is received... */ TranslateMessage(&msg); /* Translate key codes to chars if present */ DispatchMessage(&msg); /* Send it to WndProc */ } return msg.wParam; }
35.492754
98
0.681911
higorslva
d4e934f1a0b756729dc58ef03910e155318d58dd
517
cpp
C++
runtime/indirect_heap/indirect_heap.cpp
cwang64/compute-runtime
440520ffdc5807574f0abfbf64b3790d1c0547e4
[ "MIT" ]
3
2019-09-20T23:26:36.000Z
2019-10-03T17:44:12.000Z
runtime/indirect_heap/indirect_heap.cpp
cwang64/compute-runtime
440520ffdc5807574f0abfbf64b3790d1c0547e4
[ "MIT" ]
1
2019-09-17T08:06:24.000Z
2019-09-17T08:06:24.000Z
runtime/indirect_heap/indirect_heap.cpp
cwang64/compute-runtime
440520ffdc5807574f0abfbf64b3790d1c0547e4
[ "MIT" ]
3
2019-05-16T07:22:51.000Z
2019-11-11T03:05:32.000Z
/* * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "indirect_heap.h" namespace NEO { IndirectHeap::IndirectHeap(GraphicsAllocation *gfxAllocation) : BaseClass(gfxAllocation) { } IndirectHeap::IndirectHeap(GraphicsAllocation *gfxAllocation, bool canBeUtilizedAs4GbHeap) : BaseClass(gfxAllocation), canBeUtilizedAs4GbHeap(canBeUtilizedAs4GbHeap) { } IndirectHeap::IndirectHeap(void *buffer, size_t bufferSize) : BaseClass(buffer, bufferSize) { } } // namespace NEO
23.5
167
0.777563
cwang64
d4e9ffcc1b51dc4883025ba2995e531cf681fdc0
3,380
cpp
C++
src/library/projection.cpp
JLimperg/lean
81cabd7b5a8f789633639f5fba64b45d31e37259
[ "Apache-2.0" ]
2,232
2015-01-01T18:20:29.000Z
2022-03-30T02:35:50.000Z
src/library/projection.cpp
JLimperg/lean
81cabd7b5a8f789633639f5fba64b45d31e37259
[ "Apache-2.0" ]
1,187
2015-01-06T05:18:44.000Z
2019-10-31T18:45:42.000Z
src/library/projection.cpp
JLimperg/lean
81cabd7b5a8f789633639f5fba64b45d31e37259
[ "Apache-2.0" ]
306
2015-01-16T22:30:27.000Z
2022-03-28T02:55:51.000Z
/* Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #include <string> #include "util/sstream.h" #include "kernel/kernel_exception.h" #include "kernel/instantiate.h" #include "kernel/inductive/inductive.h" #include "library/util.h" #include "library/projection.h" #include "library/module.h" #include "library/kernel_serializer.h" namespace lean { /** \brief This environment extension stores information about all projection functions defined in an environment object. */ struct projection_ext : public environment_extension { name_map<projection_info> m_info; projection_ext() {} }; struct projection_ext_reg { unsigned m_ext_id; projection_ext_reg() { m_ext_id = environment::register_extension(std::make_shared<projection_ext>()); } }; static projection_ext_reg * g_ext = nullptr; static projection_ext const & get_extension(environment const & env) { return static_cast<projection_ext const &>(env.get_extension(g_ext->m_ext_id)); } static environment update(environment const & env, projection_ext const & ext) { return env.update(g_ext->m_ext_id, std::make_shared<projection_ext>(ext)); } struct proj_modification : public modification { LEAN_MODIFICATION("proj") name m_proj; projection_info m_info; proj_modification() {} proj_modification(name const & proj, projection_info const & info) : m_proj(proj), m_info(info) {} void perform(environment & env) const override { projection_ext ext = get_extension(env); ext.m_info.insert(m_proj, m_info); env = update(env, ext); } void serialize(serializer & s) const override { s << m_proj << m_info.m_constructor << m_info.m_nparams << m_info.m_i << m_info.m_inst_implicit; } static std::shared_ptr<modification const> deserialize(deserializer & d) { name p, mk; unsigned nparams, i; bool inst_implicit; d >> p >> mk >> nparams >> i >> inst_implicit; return std::make_shared<proj_modification>(p, projection_info(mk, nparams, i, inst_implicit)); } }; environment save_projection_info(environment const & env, name const & p, name const & mk, unsigned nparams, unsigned i, bool inst_implicit) { return module::add_and_perform(env, std::make_shared<proj_modification>( p, projection_info(mk, nparams, i, inst_implicit))); } projection_info const * get_projection_info(environment const & env, name const & p) { projection_ext const & ext = get_extension(env); return ext.m_info.find(p); } name_map<projection_info> const & get_projection_info_map(environment const & env) { return get_extension(env).m_info; } /** \brief Return true iff the type named \c S can be viewed as a structure in the given environment. If not, generate an error message using \c pos. */ bool is_structure_like(environment const & env, name const & S) { optional<inductive::inductive_decl> decl = inductive::is_inductive_decl(env, S); if (!decl) return false; return length(decl->m_intro_rules) == 1 && *inductive::get_num_indices(env, S) == 0; } void initialize_projection() { g_ext = new projection_ext_reg(); proj_modification::init(); } void finalize_projection() { proj_modification::finalize(); delete g_ext; } }
33.137255
142
0.718047
JLimperg
d4eaa86b9b2429aa8e8f8a30748d0c6aebffea37
5,533
hpp
C++
config/Templates/FslUtil.Vulkan/Template_header0.hpp
Unarmed1000/RAIIGen
2516ab5949c1fb54ca1b6e51e5e99e15ecfebbfb
[ "BSD-3-Clause" ]
8
2016-11-02T14:08:51.000Z
2021-03-25T02:00:00.000Z
config/Templates/FslUtil.Vulkan/Template_header0.hpp
Unarmed1000/RAIIGen
2516ab5949c1fb54ca1b6e51e5e99e15ecfebbfb
[ "BSD-3-Clause" ]
4
2016-08-23T12:37:17.000Z
2016-09-30T01:58:20.000Z
config/Templates/FslUtil.Vulkan/Template_header0.hpp
Unarmed1000/RAIIGen
2516ab5949c1fb54ca1b6e51e5e99e15ecfebbfb
[ "BSD-3-Clause" ]
null
null
null
#ifndef FSLUTIL_##NAMESPACE_NAME!##_##CLASS_NAME!##_HPP #define FSLUTIL_##NAMESPACE_NAME!##_##CLASS_NAME!##_HPP /**************************************************************************************************************************************************** * Copyright (c) 2016 Freescale Semiconductor, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of the Freescale Semiconductor, Inc. nor the names of * its contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************************************************************************************/ // ##AG_TOOL_STATEMENT## // Auto generation template based on RapidVulkan https://github.com/Unarmed1000/RapidVulkan with permission. #include <FslUtil/##NAMESPACE_NAME##/ClaimMode.hpp> #include <FslUtil/##NAMESPACE_NAME##/Common.hpp> #include <FslUtil/##NAMESPACE_NAME##/Util.hpp>##ADDITIONAL_INCLUDES## #include <FslBase/Attributes.hpp> #include <vulkan/vulkan.h> #include <cassert> namespace Fsl { namespace Vulkan { //! This object is movable so it can be thought of as behaving in the same was as a unique_ptr and is compatible with std containers class ##CLASS_NAME## {##CLASS_ADDITIONAL_MEMBER_VARIABLES## ##RESOURCE_TYPE## ##RESOURCE_MEMBER_NAME##; public: ##CLASS_NAME##(const ##CLASS_NAME##&) = delete; ##CLASS_NAME##& operator=(const ##CLASS_NAME##&) = delete; //! @brief Move assignment operator ##CLASS_NAME##& operator=(##CLASS_NAME##&& other) { if (this != &other) { // Free existing resources then transfer the content of other to this one and fill other with default values if (IsValid()) Reset(); // Claim ownership here##MOVE_ASSIGNMENT_CLAIM_MEMBERS## // Remove the data from other##MOVE_ASSIGNMENT_INVALIDATE_MEMBERS## } return *this; } //! @brief Move constructor //! Transfer ownership from other to this ##CLASS_NAME##(##CLASS_NAME##&& other)##MOVE_CONSTRUCTOR_MEMBER_INITIALIZATION## { // Remove the data from other##MOVE_CONSTRUCTOR_INVALIDATE_MEMBERS## } //! @brief Create a 'invalid' instance (use Reset to populate it) ##CLASS_NAME##()##DEFAULT_CONSTRUCTOR_MEMBER_INITIALIZATION## { } //! @brief Assume control of the ##CLASS_NAME## (this object becomes responsible for releasing it) explicit ##CLASS_NAME##(##MEMBER_PARAMETERS##) : ##CLASS_NAME##() { Reset(##MEMBER_PARAMETER_NAMES##); } ##CLASS_EXTRA_CONSTRUCTORS_HEADER## ~##CLASS_NAME##() { Reset(); } //! @brief returns the managed handle and releases the ownership. ##RESOURCE_TYPE## Release() FSL_FUNC_POSTFIX_WARN_UNUSED_RESULT { const auto resource = ##RESOURCE_MEMBER_NAME##;##RESET_INVALIDATE_MEMBERS## return resource; } //! @brief Destroys any owned resources and resets the object to its default state. void Reset() { if (! IsValid()) return; ##RESET_MEMBER_ASSERTIONS## ##DESTROY_FUNCTION##(##DESTROY_FUNCTION_ARGUMENTS##);##RESET_INVALIDATE_MEMBERS## } //! @brief Destroys any owned resources and assume control of the ##CLASS_NAME## (this object becomes responsible for releasing it) void Reset(##MEMBER_PARAMETERS##) { if (IsValid()) Reset(); ##RESET_SET_MEMBERS_NORMAL## } ##CLASS_EXTRA_RESET_METHODS_HEADER####CLASS_ADDITIONAL_GET_MEMBER_VARIABLE_METHODS## //! @brief Get the associated resource handle ##RESOURCE_TYPE## Get() const { return ##RESOURCE_MEMBER_NAME##; } //! @brief Get a pointer to the associated resource handle const ##RESOURCE_TYPE##* GetPointer() const { return &##RESOURCE_MEMBER_NAME##; } //! @brief Check if this object contains a valid resource inline bool IsValid() const { return ##RESOURCE_MEMBER_NAME## != ##DEFAULT_VALUE##; }##ADDITIONAL_METHODS_HEADER## }; } } #endif
37.134228
149
0.646665
Unarmed1000
d4eb747851a50f569fa5c90030ce176ed16fc555
36,687
hxx
C++
dev/ese/src/os/_osdisk.hxx
augustoproiete-forks/microsoft--Extensible-Storage-Engine
a38945d2147167e3fa749594f54dae6c7307b8da
[ "MIT" ]
1
2021-02-02T07:04:07.000Z
2021-02-02T07:04:07.000Z
dev/ese/src/os/_osdisk.hxx
augustoproiete-forks/microsoft--Extensible-Storage-Engine
a38945d2147167e3fa749594f54dae6c7307b8da
[ "MIT" ]
null
null
null
dev/ese/src/os/_osdisk.hxx
augustoproiete-forks/microsoft--Extensible-Storage-Engine
a38945d2147167e3fa749594f54dae6c7307b8da
[ "MIT" ]
null
null
null
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #ifndef __OSDISK_HXX_INCLUDED #define __OSDISK_HXX_INCLUDED #include <winioctl.h> class _OSFILE; class COSDisk; typedef _OSFILE* P_OSFILE; struct IFILEIBOFFSET { QWORD iFile; QWORD ibOffset; const static IFILEIBOFFSET IfileiboffsetNotFound; bool operator==( const IFILEIBOFFSET& rhs ) const { return ( iFile == rhs.iFile && ibOffset == rhs.ibOffset ); } bool operator<( const IFILEIBOFFSET& rhs ) const { return ( iFile != rhs.iFile ? iFile < rhs.iFile : ibOffset < rhs.ibOffset ); } bool operator>( const IFILEIBOFFSET& rhs ) const { return ( iFile != rhs.iFile ? iFile > rhs.iFile : ibOffset > rhs.ibOffset ); } }; template< typename T > class MemCopyable { public: MemCopyable() {}; MemCopyable( const T* pSrc ) { memcpy( this, pSrc, sizeof( T ) ); } }; class IOREQ : MemCopyable<IOREQ> { public: static SIZE_T OffsetOfAPIC() { return OffsetOf( IOREQ, m_apic ); } private: IOREQ& operator=( const IOREQ& ioreq ); public: IOREQ(); IOREQ( const IOREQ* pioreqToCopy ); public: enum IOREQTYPE { ioreqUnknown = 0, ioreqInAvailPool, ioreqCachedInTLS, ioreqInReservePool, ioreqAllocFromAvail, ioreqAllocFromEwreqLookaside, ioreqInIOCombiningList, ioreqEnqueuedInIoHeap, ioreqEnqueuedInVipList, ioreqEnqueuedInMetedQ, ioreqRemovedFromQueue, ioreqIssuedSyncIO, ioreqIssuedAsyncIO, ioreqSetSize, ioreqExtendingWriteIssued, ioreqCompleted, ioreqMax }; enum IOMETHOD { iomethodNone = 0, iomethodSync, iomethodSemiSync, iomethodAsync, iomethodScatterGather }; public: OVERLAPPED ovlp; CPool< IOREQ, OffsetOfAPIC >::CInvasiveContext m_apic; IOREQ* pioreqIorunNext; LONG ipioreqHeap; private: volatile DWORD m_ciotime; CCriticalSection m_crit; IOREQTYPE m_ioreqtype:8; IOMETHOD m_iomethod:8; DWORD m_reserved:16; public: volatile DWORD m_grbitHungActionsTaken; public: IOREQTYPE Ioreqtype() const { return m_ioreqtype; } IOMETHOD Iomethod() const { return m_iomethod; } DWORD Ciotime() const { return m_ciotime; } #ifdef DEBUG BOOL FNotOwner() const { return m_crit.FNotOwner(); } BOOL FOwner() const { return m_crit.FOwner(); } #endif HRT hrtIOStart; COSDisk * m_posdCurrentIO; FLAG32 fWrite:1; INT group:2; FLAG32 fCoalesced:1; FLAG32 fFromReservePool:1; FLAG32 m_fFromTLSCache:1; FLAG32 m_fHasHeapReservation:1; FLAG32 m_fHasBackgroundReservation:1; FLAG32 m_fHasUrgentBackgroundReservation:1; FLAG32 m_fCanCombineIO:1; static const INT cRetriesMax = 0x7ffe; INT m_cRetries:15; INT m_reserved1:7; FullTraceContext m_tc; OSFILEQOS grbitQOS; QWORD ibOffset; const BYTE * pbData; DWORD cbData; P_OSFILE p_osf; DWORD_PTR dwCompletionKey; PFN pfnCompletion; static SIZE_T OffsetOfHIIC() { return OffsetOf( IOREQ, m_hiic ); } private: CInvasiveList< IOREQ, OffsetOfHIIC >::CElement m_hiic; public: DWORD m_tidAlloc; TICK m_tickAlloc; DWORD_PTR m_iocontext; public: static SIZE_T OffsetOfMetedQueueIC() { return OffsetOf( IOREQ, m_irbticMetedQ ); } private: InvasiveRedBlackTree< IFILEIBOFFSET, IOREQ, OffsetOfMetedQueueIC >::InvasiveContext m_irbticMetedQ; public: IOREQ* pioreqVipList; public: #ifndef RTM FLAG32 m_fDequeueCombineIO:1; FLAG32 m_fSplitIO:1; FLAG32 m_fReMergeSplitIO:1; FLAG32 m_fOutOfMemory:1; INT m_cTooComplex:3; FLAG32 m_reservedNRtm:25; #endif public: VOID ValidateIOREQTypeTransition( const IOREQTYPE ioreqtypeNext ); VOID SetIOREQType( const IOREQTYPE ioreqtypeNext, const IOMETHOD iomethod = iomethodNone ); VOID BeginIO( const IOMETHOD iomethod, const HRT hrtIOStart, const BOOL fHead ); typedef enum { CompletedIO = 1, ReEnqueueingIO = 2 } COMPLETION_STATUS; VOID CompleteIO( const COMPLETION_STATUS eCompletionStatus ); VOID IncrementIOTime(); QWORD IbBlockMax() const { Assert( ibOffset < (QWORD)llMax ); Assert( cbData != 0 ); return ibOffset + (QWORD)cbData; } #ifndef RTM void AssertValid( void ) const; #endif friend VOID DumpOneIOREQ( const IOREQ * const pioreqDebuggee, const IOREQ * const pioreq ); friend ERR ErrIOMgrPatrolDogICheckOutIOREQ( __in ULONG ichunk, __in ULONG iioreq, __in IOREQ * pioreq, void * pctx ); friend DWORD IOMgrIOPatrolDogThread( DWORD_PTR dwContext ); public: INLINE BOOL FInAvailPool() const { return ioreqInAvailPool == m_ioreqtype; } INLINE BOOL FCachedInTLS() const { return ioreqCachedInTLS == m_ioreqtype; } INLINE BOOL FInReservePool() const { return ioreqInReservePool == m_ioreqtype; } INLINE BOOL FAllocFromAvail() const { return ioreqAllocFromAvail == m_ioreqtype; } INLINE BOOL FAllocFromEwreqLookaside() const { return ioreqAllocFromEwreqLookaside == m_ioreqtype; } INLINE BOOL FInIOCombiningList() const { return ioreqInIOCombiningList == m_ioreqtype; } INLINE BOOL FEnqueuedInHeap() const { return ioreqEnqueuedInIoHeap == m_ioreqtype; } INLINE BOOL FEnqueuedInVIPList() const { return ioreqEnqueuedInVipList == m_ioreqtype; } INLINE BOOL FEnqueuedInMetedQ() const { return ioreqEnqueuedInMetedQ == m_ioreqtype; } INLINE BOOL FRemovedFromQueue() const { return ioreqRemovedFromQueue == m_ioreqtype; } INLINE BOOL FIssuedSyncIO() const { return ioreqIssuedSyncIO == m_ioreqtype; } INLINE BOOL FIssuedAsyncIO() const { return ioreqIssuedAsyncIO == m_ioreqtype; } INLINE BOOL FSetSize() const { return ioreqSetSize == m_ioreqtype; } INLINE BOOL FExtendingWriteIssued() const { return ioreqExtendingWriteIssued == m_ioreqtype; } INLINE BOOL FCompleted() const { return ioreqCompleted == m_ioreqtype; } #ifndef RTM BOOL FInAvailState() const { return FInAvailPool() || FCachedInTLS() || FInReservePool(); } BOOL FInPendingState() const { return FAllocFromAvail() || FAllocFromEwreqLookaside() || FInIOCombiningList(); } #endif BOOL FInEnqueuedState() const { return FEnqueuedInHeap() || FEnqueuedInVIPList() || FEnqueuedInMetedQ(); } INLINE BOOL FVirtuallyIssuedState() const { return FRemovedFromQueue() ; } INLINE BOOL FOtherIssuedState() const { return FSetSize() || FExtendingWriteIssued(); } INLINE BOOL FOSIssuedState() const { return FIssuedSyncIO() || FIssuedAsyncIO(); } BOOL FInIssuedState() const { return FVirtuallyIssuedState() || FOSIssuedState() || FOtherIssuedState(); } #ifndef RTM INLINE BOOL FEnqueueable() const { return m_fHasHeapReservation || grbitQOS & qosIOPoolReserved; } #endif INLINE BOOL FUseMetedQ() const { return !!( grbitQOS & qosIODispatchBackground ) || !!( grbitQOS & qosIODispatchWriteMeted ); } }; inline INT CmpIOREQOffset( const IOREQ * const pioreq1, const IOREQ * const pioreq2 ) { if ( pioreq1->ibOffset < pioreq2->ibOffset ) { return -1; } else if ( pioreq1->ibOffset > pioreq2->ibOffset ) { return 1; } Assert( pioreq1->ibOffset == pioreq2->ibOffset ); return 0; } typedef struct _IOREQCHUNK { DWORD cioreq; DWORD cioreqMac; struct _IOREQCHUNK * pioreqchunkNext; BYTE rgbReserved[32-sizeof(DWORD)-sizeof(DWORD)-sizeof(struct _IOREQCHUNK *)]; IOREQ rgioreq[]; } IOREQCHUNK; class COSDisk : public CZeroInit { public: static SIZE_T OffsetOfILE() { return OffsetOf( COSDisk, m_ile ); } private: CInvasiveList< COSDisk, OffsetOfILE >::CElement m_ile; public: COSDisk(); ERR ErrInitDisk( __in_z const WCHAR * const wszDiskPathId, __in const DWORD dwDiskNumber ); ~COSDisk(); enum OSDiskState { eOSDiskInitCtor = 1, eOSDiskConnected }; void AddRef(); static void Release( COSDisk * posd ); ULONG CRef() const; BOOL FIsDisk( __in_z const WCHAR * const wszTargetDisk ) const; void TraceStationId( const TraceStationIdentificationReason tsidr ); void Dump( CPRINTF* pcprintf, DWORD_PTR dwOffset = 0 ) const; private: OSDiskState m_eState; volatile ULONG m_cref; DWORD m_dwDiskNumber; COSEventTraceIdCheck m_traceidcheckDisk; WCHAR m_wszDiskPathId[IFileSystemAPI::cchPathMax]; #define szEseNoLoadSmartData "EseNoLo-S%d-E%d" #define cchMaxEseNoLoadSmartData ( 10 + 2 + 12 + 1 + 2 ) enum { eSmartLoadDiskOpenFailed = 1, eSmartLoadDiskOpenRoFailed = 2, eSmartLoadDevIoCtrlGetVerFailed = 3, eSmartLoadSmartVersionUnexpected = 4, eSmartLoadSmartRevisionUnexpected = 5, eSmartLoadSmartCmdCapabilityNotSet = 6, eSmartLoadDevIoCtrlRcvDriveDataFailed = 7 }; void SetSmartEseNoLoadFailed( __in const ULONG iStep, __in const DWORD error, __out_bcount_z(cbIdentifier) CHAR * szIdentifier, __in const ULONG cbIdentifier ); typedef struct OSDiskInfo_ { BYTE m_bDiskSmartVersion; BYTE m_bDiskSmartRevision; BYTE m_bDiskSmartIdeDevMap; DWORD m_grbitDiskSmartCapabilities; CHAR m_szDiskModel[ max( 50 + 1, cchMaxEseNoLoadSmartData ) ]; CHAR m_szDiskModelSmart[ max( 39 + 1, cchMaxEseNoLoadSmartData ) ]; CHAR m_szDiskSerialNumber[ max( 50 + 1, cchMaxEseNoLoadSmartData ) ]; CHAR m_szDiskFirmwareRev[ 20 + 1 ]; DWORD m_errorOsdci; _Field_size_( sizeof(DISK_CACHE_INFORMATION) ) DISK_CACHE_INFORMATION m_osdci; DWORD m_errorOsswcp; _Field_size_( sizeof(STORAGE_WRITE_CACHE_PROPERTY) ) STORAGE_WRITE_CACHE_PROPERTY m_osswcp; DWORD m_errorOssad; _Field_size_( sizeof(STORAGE_ADAPTER_DESCRIPTOR) ) STORAGE_ADAPTER_DESCRIPTOR m_ossad; DWORD m_errorOsdspd; _Field_size_( sizeof(DEVICE_SEEK_PENALTY_DESCRIPTOR) ) DEVICE_SEEK_PENALTY_DESCRIPTOR m_osdspd; DWORD m_errorOsdtd; _Field_size_( sizeof(DEVICE_TRIM_DESCRIPTOR) ) DEVICE_TRIM_DESCRIPTOR m_osdtd; DWORD m_errorOsdcod; _Field_size_( sizeof(DEVICE_COPY_OFFLOAD_DESCRIPTOR) ) DEVICE_COPY_OFFLOAD_DESCRIPTOR m_osdcod; } OSDiskInfo; OSDiskInfo m_osdi; void LoadDiskInfo_( __in_z PCWSTR wszDiskPath, __in const DWORD dwDiskNumber ); void LoadCachePerf_( HANDLE hDisk ); public: const WCHAR * WszDiskPathId() const; ERR ErrDiskId( ULONG_PTR* const pulDiskId ) const; DWORD DwDiskNumber() const { return m_dwDiskNumber; } BOOL FSeekPenalty() const; public: #ifdef DEBUG void AssertValid() const; #endif public: class IORun { private: CSimpleQueue<IOREQ> m_storage; #ifdef DEBUG ULONG m_cbRun; #endif void InitRun_( IOREQ * pioreqRun ); public: #ifdef DEBUG void AssertValid( ) const; #endif IORun() : m_storage() { OnDebug( m_cbRun = 0 ); } IORun( IOREQ * pioreqHead ) : m_storage() { OnDebug( m_cbRun = 0 ); FAddToRun( pioreqHead ); } bool FEmpty( ) const { ASSERT_VALID( this ); return 0 == m_storage.CElements(); } ULONG Cioreq( ) const { ASSERT_VALID( this ); return m_storage.CElements(); } #ifdef DEBUG BOOL FRunMember( const IOREQ * pioreqCheck ) const; #endif ULONG CbRun( ) const; QWORD IbRunMax() const { ASSERT_VALID( this ); Assert( !FEmpty() ); return FEmpty() ? 0 : ( m_storage.Head()->ibOffset + (QWORD)CbRun() ); } QWORD IbOffset( ) const { ASSERT_VALID( this ); Assert( !FEmpty() ); return FEmpty() ? 0 : m_storage.Head()->ibOffset; } BOOL FWrite( ) const { ASSERT_VALID( this ); Assert( !FEmpty() ); return FEmpty() ? 2 : !!m_storage.Head()->fWrite; } _OSFILE * P_OSF( ) const { ASSERT_VALID( this ); Assert( !FEmpty() ); return FEmpty() ? NULL : m_storage.Head()->p_osf; } BOOL FHasHeapReservation( ) const { ASSERT_VALID( this ); Assert( !FEmpty() ); return FEmpty() ? fFalse : m_storage.Head()->m_fHasHeapReservation; } BOOL FUseMetedQ( ) const { ASSERT_VALID( this ); Assert( !FEmpty() ); return FEmpty() ? 0 : m_storage.Head()->FUseMetedQ(); } BOOL FIssuedFromQueue( ) const { ASSERT_VALID( this ); Assert( !FEmpty() ); return FEmpty() ? fFalse : m_storage.Head()->FIssuedAsyncIO(); } BOOL FMultiBlock( ) const { ASSERT_VALID( this ); Expected( !FEmpty() ); return FEmpty() ? fFalse : ( m_storage.Head() != m_storage.Tail() ); } IOREQ::IOMETHOD IomethodGet( ) const; #ifndef RTM const IOREQ * PioreqHead( ) const { ASSERT_VALID( this ); return m_storage.Head(); } #endif bool FAddToRun( IOREQ * pioreq ); void SetIOREQType( const IOREQ::IOREQTYPE ioreqtypeNext ); void PrepareForIssue( __in const IOREQ::IOMETHOD iomethod, __out DWORD * const pcbRun, __out BOOL * const pfIOOSLowPriority, __inout PFILE_SEGMENT_ELEMENT const rgfse, __in const DWORD cfse ); IOREQ * PioreqGetRun(); }; static DWORD CbIOLength( const IOREQ * const pioreqHead ) { QWORD ibOffsetMin = _I64_MAX; QWORD ibOffsetMax = 0; DWORD cbOffsetMaxData = 0; for ( const IOREQ * pioreqT = pioreqHead; pioreqT; pioreqT = pioreqT->pioreqIorunNext ) { QWORD ibOffset = pioreqT->ibOffset; if ( ibOffsetMin > ibOffset ) { ibOffsetMin = ibOffset; } if ( ibOffsetMax <= ibOffset ) { ibOffsetMax = ibOffset; cbOffsetMaxData = pioreqT->cbData; } } Assert( ibOffsetMin <= ibOffsetMax ); Assert( cbOffsetMaxData ); return (DWORD)( ibOffsetMax - ibOffsetMin ) + cbOffsetMaxData; } class CIoRunPool { private: static const INT s_cConcurrentFileIoRuns = 2; static const INT irunNil = -1; HRT m_rghrtIoRunStarted[ s_cConcurrentFileIoRuns ]; IORun m_rgiorunIoRuns[ s_cConcurrentFileIoRuns ]; INT IrunIoRunPoolIFindFileRun_( _In_ const _OSFILE * const p_osf ) const; IOREQ * PioreqIoRunPoolIRemoveRunSlot_( _In_ const INT irun ); void IoRunPoolIAddNewRunSlot_( _In_ const INT irun, _Inout_ IOREQ * pioreqToAdd ); public: #ifdef ENABLE_JET_UNIT_TEST CIoRunPool() { memset( m_rgiorunIoRuns, 0, sizeof(m_rgiorunIoRuns) ); ASSERT_VALID( &( m_rgiorunIoRuns[0] ) ); Expected( m_rgiorunIoRuns[0].PioreqHead() == NULL ); } ~CIoRunPool() { } #endif void Dump() const; BOOL FCanCombineWithExistingRun( _In_ const _OSFILE * p_osf, _In_ const BOOL fWrite, _In_ const QWORD ibOffsetCombine, _In_ const DWORD cbDataCombine, _In_ const BOOL fOverrideIoMax ) const; #ifdef DEBUG BOOL FCanCombineWithExistingRun( _In_ const IOREQ * const pioreq ) const; INT Cioruns() const; #endif BOOL FContainsFileIoRun( _In_ const _OSFILE * const p_osf ) const; enum IoRunPoolEmptyCheck { fCheckAllEmpty = 1, fCheckOneEmpty = 2 }; BOOL FEmpty( _In_ const IoRunPoolEmptyCheck fCheck ) const; IOREQ * PioreqSwapAddIoreq( _Inout_ IOREQ * const pioreqToAdd ); IOREQ * PioreqEvictFileRuns( _In_ const _OSFILE * const p_osf ); }; public: class QueueOp { public: enum EQueueOp { eUnknown = 0, eSpecialOperation, eIOOperation }; private: EQueueOp m_eQueueOp; IOREQ * m_pioreq; COSDisk::IORun m_iorun; public: #ifdef DEBUG bool FValid( ) const; #endif QueueOp() : m_eQueueOp( eUnknown ), m_pioreq( NULL ), m_iorun() { } QueueOp( IOREQ * pioreqHead ) : m_eQueueOp( eUnknown ), m_pioreq( NULL ), m_iorun() { bool fAccepted = FAddToRun( pioreqHead ); Assert( fAccepted ); } bool FEmpty() const; BOOL FIssuedFromQueue() const; BOOL FHasHeapReservation() const; BOOL FUseMetedQ() const { return m_pioreq ? m_pioreq->FUseMetedQ() : m_iorun.FUseMetedQ(); } BOOL FWrite() const { Assert( FValid() ); Assert( !FEmpty() ); return m_pioreq ? m_pioreq->fWrite : m_iorun.FWrite(); } P_OSFILE P_osfPerfctrUpdates() const; DWORD CbRun() const; ULONG Cioreq() const; #ifdef DEBUG BOOL FRunMember( const IOREQ * pioreqCheck ) const; #endif bool FAddToRun( IOREQ * pioreq ); void SetIOREQType( const IOREQ::IOREQTYPE ioreqtypeNext ); IOREQ * PioreqOp() const; COSDisk::IORun * PiorunIO(); IOREQ * PioreqGetRun(); }; public: __int64 IpassBeginDispatchPass() { return m_pIOQueue->IpassBeginDispatchPass(); } __int64 IpassContinuingDispatchPass() { return m_pIOQueue->IpassContinuingDispatchPass(); } ERR ErrReserveQueueSpace( __in OSFILEQOS grbitQOS, __inout IOREQ * pioreq ); ERR ErrAllocIOREQ( __in OSFILEQOS grbitQOS, __in const _OSFILE * p_osf, __in const BOOL fWrite, __in QWORD ibOffsetCombine, __in DWORD cbDataCombine, __out IOREQ ** ppioreq ); VOID FreeIOREQ( __in IOREQ * pioreq ); void EnqueueIORun( __in IOREQ * pioreqHead ); static void EnqueueDeferredIORun( _In_ const _OSFILE * const p_osf ); void EnqueueIOREQ( __in IOREQ * pioreq ); ERR ErrDequeueIORun( __inout COSDisk::QueueOp * pqop ); void IncCioDispatching( void ); void DecCioDispatching( void ); void IncCioAsyncDispatching( _In_ const BOOL fWrite ); void QueueCompleteIORun( __in IOREQ * pioreqHead ); BOOL FQueueCompleteIOREQ( __in IOREQ * const pioreq ); ERR ErrRemoveDeferredIoOp( _In_ TraceContext& tc, _In_ const QWORD ibOffsetMatch, _In_ const DWORD cbDataMatch, _In_ const IOREQ * const pioreqMatch, _Out_ IOREQ ** ppioreqHead ); #ifdef DEBUG LONG CioOutstanding() const; #endif LONG CioDispatched() const; LONG CioUrgentEnqueued() const; LONG CioAllowedMetedOps( _In_ const LONG cioWaitingQ ) const; LONG CioReadyMetedEnqueued() const; LONG CioReadyWriteEnqueued() const { return m_pIOQueue->CioWriteQueue(); } LONG CioAllEnqueued() const; LONG CioAsyncReadDispatching() const { return m_cioAsyncReadDispatching; } LONG CioMetedReadQueue() const { return m_pIOQueue->CioMetedReadQueue(); } void IncCioForeground( void ) { AtomicIncrement( (LONG*)&m_cioForeground ); Assert( m_cioForeground > 0 ); } void DecCioForeground( void ) { AtomicDecrement( (LONG*)&m_cioForeground ); Assert( m_cioForeground >= 0 ); } ULONG CioForeground() const { return m_cioForeground; } ERR ErrBeginConcurrentIo( const BOOL fForegroundSyncIO ); void EndConcurrentIo( const BOOL fForegroundSyncIO, const BOOL fWrite ); void BeginExclusiveIo(); void EndExclusiveIo(); void SuspendDiskIo(); void ResumeDiskIo(); void TrackOsFfbBegin( const IOFLUSHREASON iofr, const QWORD hFile ); void TrackOsFfbComplete( const IOFLUSHREASON iofr, const DWORD error, const HRT hrtStart, const QWORD usFfb, const LONG64 cioFlushing, const WCHAR * const wszFileName ); private: __int64 m_cioDequeued; volatile ULONG m_cioForeground; volatile ULONG m_cioDispatching; volatile LONG m_cioAsyncReadDispatching; volatile LONG m_cioAsyncWriteDispatching; volatile BOOL m_fExclusiveIo; volatile ULONG m_cFfbOutstanding; HRT m_hrtLastFfb; HRT m_hrtLastMetedDispatch; public: class IOQueueToo : CZeroInit { public: enum QueueInitType { qitRead = 0x1, qitWrite = 0x2, }; enum QueueFirstIoFlags { qfifDraining = 0x1, qfifBuilding = 0x2, qfifEither = ( qfifDraining | qfifBuilding ), }; public: IOQueueToo( CCriticalSection * pcritController, const QueueInitType qitInit ); ~IOQueueToo(); public: BOOL FInsertIo( _In_ IOREQ * pioreqHead, _In_ const LONG cioreqRun, _Out_ IOREQ ** ppioreqHeadAccepted ); void ExtractIo( _Inout_ COSDisk::QueueOp * const pqop, _Out_ IOREQ ** ppioreqTraceHead, _Inout_ BOOL * pfCycles ); void Cycle(); IFILEIBOFFSET IfileiboffsetFirstIo( _In_ const QueueFirstIoFlags qfif ); BOOL FStarvedMetedOp() const; LONG CioEnqueued() const { return m_cioEnqueued; } private: OnDebug( QueueInitType m_qit ); OnDebug( CCriticalSection * m_pcritIoQueue ); ULONG m_cioEnqueued; ULONG m_cioreqEnqueued; HRT m_hrtBuildingStart; typedef InvasiveRedBlackTree< IFILEIBOFFSET, IOREQ, IOREQ::OffsetOfMetedQueueIC > IRBTQ; IRBTQ m_irbtBuilding; IRBTQ m_irbtDraining; friend void COSDisk::Dump( CPRINTF* pcprintf, DWORD_PTR dwOffset ) const; }; private: class IOQueue : CZeroInit { public: IOQueue( CCriticalSection * pcritController ); ERR ErrIOQueueInit( __in LONG cIOEnqueuedMax, __in LONG cIOBackgroundMax, __in LONG cIOUrgentBackgroundMax ); ~IOQueue(); private: void IOQueueTerm(); ERR _ErrIOHeapInit( __in LONG cIOEnqueuedMax ); void _IOHeapTerm(); void TrackIorunEnqueue( _In_ const IOREQ * const pioreqHead, _In_ const DWORD cbRun, _In_ HRT hrtEnqueueBegin, _In_ OSDiskIoQueueManagement dioqm ) const; void TrackIorunDequeue( _In_ const IOREQ * const pioreqHead, _In_ const DWORD cbRun, _In_ HRT hrtDequeueBegin, _In_ OSDiskIoQueueManagement dioqm, _In_ const USHORT cIorunCombined, _In_ const IOREQ * const pioreqAdded ) const; public: __int64 IpassBeginDispatchPass(); __int64 IpassContinuingDispatchPass(); ERR ErrReserveQueueSpace( __in OSFILEQOS grbitQOS, __inout IOREQ * pioreq ); BOOL FReleaseQueueSpace( __inout IOREQ * pioreq ); void InsertOp( __inout COSDisk::QueueOp * pqop ); void ExtractOp( _In_ const COSDisk * const posd, _Inout_ COSDisk::QueueOp * pqop ); ERR ErrRemoveDeferredIoOp( _In_ const IOREQ * const pioreqFind, _Out_ IOREQ ** ppioreqHead ); INLINE LONG CioreqIOHeap() const; INLINE LONG CioVIPList() const; INLINE LONG CioMetedReadQueue() const; INLINE LONG CioWriteQueue() const { return m_qWriteIo.CioEnqueued(); } private: __int64 m_cDispatchPass; __int64 m_cDispatchContinues; private: class IOHeapA { friend ERR COSDisk::IOQueue::_ErrIOHeapInit( __in LONG cIOEnqueuedMax ); private: IOREQ* volatile * rgpioreqIOAHeap; LONG ipioreqIOAHeapMax; volatile LONG ipioreqIOAHeapMac; CCriticalSection * const m_pcrit; private: void _HeapATerm(); public: IOHeapA( CCriticalSection * pcritController ) : m_pcrit( pcritController ), rgpioreqIOAHeap( NULL ), ipioreqIOAHeapMax( 0 ), ipioreqIOAHeapMac( 0 ) { } ERR ErrHeapAInit( __in LONG cIOEnqueuedMax ); ~IOHeapA() { _HeapATerm(); } public: BOOL FHeapAEmpty() const; LONG CioreqHeapA() const; IOREQ* PioreqHeapATop(); void HeapAAdd( IOREQ* pioreq ); void HeapARemove( IOREQ* pioreq ); BOOL FHeapAFrom( const IOREQ * pioreq ) const; private: BOOL FHeapAISmaller( IOREQ* pioreq1, IOREQ* pioreq2 ) const; LONG IpioreqHeapAIParent( LONG ipioreq ) const; LONG IpioreqHeapAILeftChild( LONG ipioreq ) const; LONG IpioreqHeapAIRightChild( LONG ipioreq ) const; private: void HeapAIUpdate( IOREQ* pioreq ); }; class IOHeapB { private: IOREQ* volatile * rgpioreqIOBHeap; LONG ipioreqIOBHeapMax; volatile LONG ipioreqIOBHeapMic; CCriticalSection * const m_pcrit; private: void _HeapBTerm(); public: IOHeapB( CCriticalSection * pcritController ) : m_pcrit( pcritController ), rgpioreqIOBHeap( NULL ), ipioreqIOBHeapMax( 0 ), ipioreqIOBHeapMic( 0 ) { } ERR ErrHeapBInit( IOREQ* volatile * rgpioreqIOAHeap, LONG ipioreqIOAHeapMax ); ~IOHeapB() { _HeapBTerm(); } public: BOOL FHeapBEmpty() const; LONG CioreqHeapB() const; IOREQ* PioreqHeapBTop(); void HeapBAdd( IOREQ* pioreq ); void HeapBRemove( IOREQ* pioreq ); private: BOOL FHeapBISmaller( IOREQ* pioreq1, IOREQ* pioreq2 ) const; LONG IpioreqHeapBIParent( LONG ipioreq ) const; LONG IpioreqHeapBILeftChild( LONG ipioreq ) const; LONG IpioreqHeapBIRightChild( LONG ipioreq ) const; void HeapBIUpdate( IOREQ* pioreq ); }; private: CCriticalSection * m_pcritIoQueue; LONG m_cioreqMax; CSemaphore m_semIOQueue; #ifdef DEBUG friend COSDisk::~COSDisk(); #endif IOHeapA * m_pIOHeapA; IOHeapB * m_pIOHeapB; BOOL fUseHeapA; QWORD iFileCurrent; QWORD ibOffsetCurrent; private: INLINE void IOHeapAdd( IOREQ* pioreq, _Out_ OSDiskIoQueueManagement * const pdioqmTypeTracking ); INLINE void IOHeapRemove( IOREQ* pioreq, _Out_ OSDiskIoQueueManagement * const pdioqmTypeTracking ); INLINE BOOL FIOHeapEmpty(); INLINE IOREQ* PioreqIOHeapTop(); private: LONG m_cioVIPList; CLocklessLinkedList<IOREQ> m_VIPListHead; BOOL FValidVIPList() const { Assert( m_pcritIoQueue->FOwner() ); Assert( 0 == m_cioVIPList || !m_VIPListHead.FEmpty() ); Assert( 0 != m_cioVIPList || m_VIPListHead.FEmpty() ); #ifdef DEBUG const IOREQ * pioreqT = m_VIPListHead.Head(); LONG cioreqT = 0; while ( pioreqT ) { cioreqT++; Assert( pioreqT->FEnqueuedInVIPList() ); pioreqT = pioreqT->pioreqVipList; } Assert( cioreqT == m_cioVIPList ); Assert( cioreqT < 100 || ( FNegTestSet( fDisableTimeoutDeadlockDetection ) && cioreqT < 800 ) ); return fTrue; #endif } private: IOQueueToo m_qMetedAsyncReadIo; IOQueueToo m_qWriteIo; private: INT m_cioQosBackgroundMax; INT m_cioreqQOSBackgroundLow; volatile INT m_cioQosBackgroundCurrent; INT m_cioQosUrgentBackgroundMax; volatile INT m_cioQosUrgentBackgroundCurrent; friend void COSDisk::Dump( CPRINTF* pcprintf, DWORD_PTR dwOffset ) const; }; private: IOQueue * m_pIOQueue; CCriticalSection m_critIOQueue; public: INLINE DWORD CioOsQueueDepth(); private: HANDLE m_hDisk; static const TICK s_dtickPerformancePeriod = 100; TICK m_tickPerformanceLastMeasured; DWORD m_cioOsQueueDepth; INLINE VOID RefreshDiskPerformance(); VOID QueryDiskPerformance(); }; ERR ErrOSDiskConnect( __in_z const WCHAR * const wszDiskPathId, __in const DWORD dwDiskNumber, __out IDiskAPI ** ppdiskapi ); void OSDiskDisconnect( __inout IDiskAPI * pdiskapi, __in const _OSFILE * p_osf ); class PatrolDogSynchronizer { private: enum PatrolDogState { pdsInactive, pdsActivating, pdsActive, pdsDeactivating }; CAutoResetSignal m_asigNudgePatrolDog; BOOL volatile m_fPutDownPatrolDog; DWORD volatile m_cLoiters; THREAD m_threadPatrolDog; LONG volatile m_patrolDogState; void* m_pvContext; void InitPatrolDogState_(); void AssertPatrolDogInitialState_( const PatrolDogState pdsExpected = pdsInactive ) const; public: PatrolDogSynchronizer(); ~PatrolDogSynchronizer(); ERR ErrInitPatrolDog( const PUTIL_THREAD_PROC pfnPatrolDog, const EThreadPriority priority, void* const pvContext ); void TermPatrolDog(); void EnterPerimeter(); void LeavePerimeter(); BOOL FCheckForLoiter( const TICK dtickTimeout ); void* PvContext() const; SIZE_T CbSizeOf() const; }; extern PatrolDogSynchronizer g_patrolDogSync; QWORD CmsecLatencyOfOSOperation( const IOREQ* const pioreq, const HRT dhrtIOElapsed ); QWORD CmsecLatencyOfOSOperation( const IOREQ* const pioreq ); void OSDiskIOThreadStartIssue( const P_OSFILE p_osf ); void OSDiskIIOThreadCompleteWithErr( DWORD error, DWORD cbTransfer, IOREQ* pioreqHead ); void OSDiskIIOThreadIComplete( const DWORD dwError, const DWORD_PTR dwThreadContext, DWORD cbTransfer, IOREQ *pioreqHead ); VOID OSDiskIIOThreadIRetryIssue(); BOOL GetOverlappedResult_( HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait ); #define hNoCPEvent ((DWORD_PTR)0x1) #endif
34.032468
242
0.528471
augustoproiete-forks
d4ecabab21eb4134631ffb318840a0501e082d08
6,302
cpp
C++
src/qt/src/3rdparty/webkit/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp
ant0ine/phantomjs
8114d44a28134b765ab26b7e13ce31594fa81253
[ "BSD-3-Clause" ]
46
2015-01-08T14:32:34.000Z
2022-02-05T16:48:26.000Z
src/qt/src/3rdparty/webkit/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp
ant0ine/phantomjs
8114d44a28134b765ab26b7e13ce31594fa81253
[ "BSD-3-Clause" ]
7
2015-01-20T14:28:12.000Z
2017-01-18T17:21:44.000Z
src/qt/src/3rdparty/webkit/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp
ant0ine/phantomjs
8114d44a28134b765ab26b7e13ce31594fa81253
[ "BSD-3-Clause" ]
14
2015-10-27T06:17:48.000Z
2020-03-03T06:15:50.000Z
/* * Copyright (C) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #if ENABLE(WEB_AUDIO) #include "AudioDestinationMac.h" #include "AudioSourceProvider.h" #include <CoreAudio/AudioHardware.h> namespace WebCore { const int kBufferSize = 128; // Factory method: Mac-implementation PassOwnPtr<AudioDestination> AudioDestination::create(AudioSourceProvider& provider, double sampleRate) { return adoptPtr(new AudioDestinationMac(provider, sampleRate)); } double AudioDestination::hardwareSampleRate() { // Determine the default output device's sample-rate. AudioDeviceID deviceID = kAudioDeviceUnknown; UInt32 infoSize = sizeof(deviceID); AudioObjectPropertyAddress defaultOutputDeviceAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &defaultOutputDeviceAddress, 0, 0, &infoSize, (void*)&deviceID); if (result) return 0.0; // error Float64 nominalSampleRate; infoSize = sizeof(Float64); AudioObjectPropertyAddress nominalSampleRateAddress = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; result = AudioObjectGetPropertyData(deviceID, &nominalSampleRateAddress, 0, 0, &infoSize, (void*)&nominalSampleRate); if (result) return 0.0; // error return nominalSampleRate; } AudioDestinationMac::AudioDestinationMac(AudioSourceProvider& provider, double sampleRate) : m_outputUnit(0) , m_provider(provider) , m_renderBus(2, kBufferSize, false) , m_sampleRate(sampleRate) , m_isPlaying(false) { // Open and initialize DefaultOutputUnit Component comp; ComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; comp = FindNextComponent(0, &desc); ASSERT(comp); OSStatus result = OpenAComponent(comp, &m_outputUnit); ASSERT(!result); result = AudioUnitInitialize(m_outputUnit); ASSERT(!result); configure(); } AudioDestinationMac::~AudioDestinationMac() { if (m_outputUnit) CloseComponent(m_outputUnit); } void AudioDestinationMac::configure() { // Set render callback AURenderCallbackStruct input; input.inputProc = inputProc; input.inputProcRefCon = this; OSStatus result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Global, 0, &input, sizeof(input)); ASSERT(!result); // Set stream format AudioStreamBasicDescription streamFormat; streamFormat.mSampleRate = m_sampleRate; streamFormat.mFormatID = kAudioFormatLinearPCM; streamFormat.mFormatFlags = kAudioFormatFlagsCanonical | kAudioFormatFlagIsNonInterleaved; streamFormat.mBitsPerChannel = 8 * sizeof(AudioSampleType); streamFormat.mChannelsPerFrame = 2; streamFormat.mFramesPerPacket = 1; streamFormat.mBytesPerPacket = sizeof(AudioSampleType); streamFormat.mBytesPerFrame = sizeof(AudioSampleType); result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, (void*)&streamFormat, sizeof(AudioStreamBasicDescription)); ASSERT(!result); // Set the buffer frame size. UInt32 bufferSize = kBufferSize; result = AudioUnitSetProperty(m_outputUnit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Output, 0, (void*)&bufferSize, sizeof(bufferSize)); ASSERT(!result); } void AudioDestinationMac::start() { OSStatus result = AudioOutputUnitStart(m_outputUnit); if (!result) m_isPlaying = true; } void AudioDestinationMac::stop() { OSStatus result = AudioOutputUnitStop(m_outputUnit); if (!result) m_isPlaying = false; } // Pulls on our provider to get rendered audio stream. OSStatus AudioDestinationMac::render(UInt32 numberOfFrames, AudioBufferList* ioData) { AudioBuffer* buffers = ioData->mBuffers; m_renderBus.setChannelMemory(0, (float*)buffers[0].mData, numberOfFrames); m_renderBus.setChannelMemory(1, (float*)buffers[1].mData, numberOfFrames); m_provider.provideInput(&m_renderBus, numberOfFrames); return noErr; } // DefaultOutputUnit callback OSStatus AudioDestinationMac::inputProc(void* userData, AudioUnitRenderActionFlags*, const AudioTimeStamp*, UInt32 /*busNumber*/, UInt32 numberOfFrames, AudioBufferList* ioData) { AudioDestinationMac* audioOutput = static_cast<AudioDestinationMac*>(userData); return audioOutput->render(numberOfFrames, ioData); } } // namespace WebCore #endif // ENABLE(WEB_AUDIO)
36.639535
177
0.762615
ant0ine
d4ee1d1d4809b78f5db59b951bf03a4f9400e971
921
cpp
C++
lib/openGL/src/Evenement.cpp
benjyup/cpp_arcade
4b755990b64156148e529da1c39efe8a8c0c5d1f
[ "MIT" ]
null
null
null
lib/openGL/src/Evenement.cpp
benjyup/cpp_arcade
4b755990b64156148e529da1c39efe8a8c0c5d1f
[ "MIT" ]
null
null
null
lib/openGL/src/Evenement.cpp
benjyup/cpp_arcade
4b755990b64156148e529da1c39efe8a8c0c5d1f
[ "MIT" ]
null
null
null
// // Created by florian on 4/5/17. // #include "Evenement.hpp" arcade::Evenement::Evenement(IEvenement::KeyCode keycode) : _keyCode(keycode), _action(IEvenement::Action::KeyPressDown), _score(0) {} arcade::Evenement::~Evenement() {} arcade::IEvenement::Action arcade::Evenement::getAction() const { return (_action); } arcade::IEvenement::KeyCode arcade::Evenement::getKeyCode() const { return (_keyCode); } uint64_t arcade::Evenement::getScore() const { return (_score);} void arcade::Evenement::setAction(const IEvenement::Action action) { _action = action; } void arcade::Evenement::setKeyCode(const IEvenement::KeyCode keyCode) { _keyCode = keyCode; } void arcade::Evenement::setScore(const uint64_t score) { _score = score; } int32_t arcade::Evenement::getData(void) const { return (0); }
38.375
101
0.641694
benjyup
d4ef889e0b5e9c454d6a0fffc270440b1b149fae
41,279
cpp
C++
src/EHooker.cpp
cxxjava/CxxFiber
0558eb2f070f9e36859050f9d0fec89ef9d19982
[ "Apache-2.0" ]
14
2016-12-13T08:23:17.000Z
2020-03-29T23:28:46.000Z
src/EHooker.cpp
cxxjava/CxxFiber
0558eb2f070f9e36859050f9d0fec89ef9d19982
[ "Apache-2.0" ]
null
null
null
src/EHooker.cpp
cxxjava/CxxFiber
0558eb2f070f9e36859050f9d0fec89ef9d19982
[ "Apache-2.0" ]
8
2017-02-09T09:56:20.000Z
2019-02-19T07:22:11.000Z
/* * EHooker.cpp * * Created on: 2016-5-12 * Author: cxxjava@163.com */ #include "./EHooker.hh" #include "./EIoWaiter.hh" #include "./EFileContext.hh" #include "../inc/EFiberLocal.hh" #include "../inc/EFiberScheduler.hh" #include "eco_ae.h" #include <dlfcn.h> #include <poll.h> #include <signal.h> #include <unistd.h> #include <resolv.h> #include <netdb.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/fcntl.h> #include <sys/ioctl.h> #include <sys/uio.h> #ifdef __linux__ #include "elf_hook.h" #include <bits/signum.h> //__SIGRTMAX #include <sys/epoll.h> #include <sys/sendfile.h> #endif #ifdef __APPLE__ #include "mach_hook.h" #include <sys/event.h> #endif namespace efc { namespace eco { extern "C" { typedef void (*sig_t) (int); typedef void (*signal_t)(int sig, sig_t func); typedef unsigned int (*sleep_t)(unsigned int seconds); typedef int (*usleep_t)(useconds_t usec); typedef int (*nanosleep_t)(const struct timespec *req, struct timespec *rem); typedef int (*close_t)(int); typedef int (*fcntl_t)(int fd, int cmd, ...); typedef int (*ioctl_t)(int fd, unsigned long int request, ...); typedef int (*setsockopt_t)(int sockfd, int level, int optname, const void *optval, socklen_t optlen); typedef int (*dup2_t)(int oldfd, int newfd); typedef int (*poll_t)(struct pollfd *fds, nfds_t nfds, int timeout); typedef int (*select_t)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); typedef int (*connect_t)(int fd, const struct sockaddr *addr, socklen_t addrlen); typedef int (*accept_t)(int sockfd, struct sockaddr *addr, socklen_t *addrlen); typedef ssize_t (*read_t)(int fd, void *buf, size_t count); typedef ssize_t (*readv_t)(int fd, const struct iovec *iov, int iovcnt); typedef ssize_t (*recv_t)(int sockfd, void *buf, size_t len, int flags); typedef ssize_t (*recvfrom_t)(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen); typedef ssize_t (*recvmsg_t)(int sockfd, struct msghdr *msg, int flags); typedef ssize_t (*write_t)(int fd, const void *buf, size_t count); typedef ssize_t (*writev_t)(int fd, const struct iovec *iov, int iovcnt); typedef ssize_t (*send_t)(int sockfd, const void *buf, size_t len, int flags); typedef ssize_t (*sendto_t)(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); typedef ssize_t (*sendmsg_t)(int sockfd, const struct msghdr *msg, int flags); typedef size_t (*fread_t)(void *ptr, size_t size, size_t nitems, FILE *stream); typedef size_t (*fwrite_t)(const void *ptr, size_t size, size_t nitems, FILE *stream); typedef ssize_t (*pread_t)(int fd, void *buf, size_t count, off_t offset); typedef ssize_t (*pwrite_t)(int fd, const void *buf, size_t count, off_t offset); typedef void* (*dlopen_t)(const char* path, int mode); #ifdef __linux__ typedef int (*dup3_t)(int oldfd, int newfd, int flags); typedef hostent* (*gethostbyname_t)(const char *name); typedef res_state (*__res_state_t)(); typedef int (*__poll_t)(struct pollfd fds[], nfds_t nfds, int timeout); typedef int (*epoll_wait_t)(int epfd, struct epoll_event *events, int maxevents, int timeout); typedef ssize_t (*sendfile_t)(int out_fd, int in_fd, off_t *offset, size_t count); #endif #ifdef __APPLE__ typedef int (*kevent_t)(int kq, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); typedef int (*kevent64_t)(int kq, const struct kevent64_s *changelist, int nchanges, struct kevent64_s *eventlist, int nevents, unsigned int flags, const struct timespec *timeout); typedef int (*sendfile_t)(int fd, int s, off_t offset, off_t *len, struct sf_hdtr *hdtr, int flags); #endif //============================================================================= static signal_t signal_f = NULL; static sleep_t sleep_f = NULL; static usleep_t usleep_f = NULL; static nanosleep_t nanosleep_f = NULL; static close_t close_f = NULL; /*static*/ fcntl_t fcntl_f = NULL; static ioctl_t ioctl_f = NULL; static setsockopt_t setsockopt_f = NULL; static dup2_t dup2_f = NULL; static poll_t poll_f = NULL; static select_t select_f = NULL; static connect_t connect_f = NULL; static accept_t accept_f = NULL; /*static*/ read_t read_f = NULL; static readv_t readv_f = NULL; static recv_t recv_f = NULL; static recvfrom_t recvfrom_f = NULL; static recvmsg_t recvmsg_f = NULL; /*static*/ write_t write_f = NULL; static writev_t writev_f = NULL; static send_t send_f = NULL; static sendto_t sendto_f = NULL; static sendmsg_t sendmsg_f = NULL; static fread_t fread_f = NULL; static fwrite_t fwrite_f = NULL; static pread_t pread_f = NULL; static pwrite_t pwrite_f = NULL; static sendfile_t sendfile_f = NULL; static dlopen_t dlopen_f = NULL; #ifdef __linux__ static dup3_t dup3_f = NULL; static gethostbyname_t gethostbyname_f = NULL; static __res_state_t __res_state_f = NULL; static __poll_t __poll_f = NULL; /*static*/ epoll_wait_t epoll_wait_f = NULL; #endif #ifdef __APPLE__ /*static*/ kevent_t kevent_f = NULL; static kevent64_t kevent64_f = NULL; #endif } //!C //============================================================================= //@see: http://docs.oracle.com/cd/E19253-01/819-7050/chapter3-24/ DEFINE_STATIC_INITZZ_BEGIN(EHooker) signal_f = (signal_t)dlsym(RTLD_NEXT, "signal"); sleep_f = (sleep_t)dlsym(RTLD_NEXT, "sleep"); usleep_f = (usleep_t)dlsym(RTLD_NEXT, "usleep"); nanosleep_f = (nanosleep_t)dlsym(RTLD_NEXT, "nanosleep"); close_f = (close_t)dlsym(RTLD_NEXT, "close"); fcntl_f = (fcntl_t)dlsym(RTLD_NEXT, "fcntl"); ioctl_f = (ioctl_t)dlsym(RTLD_NEXT, "ioctl"); setsockopt_f = (setsockopt_t)dlsym(RTLD_NEXT, "setsockopt"); dup2_f = (dup2_t)dlsym(RTLD_NEXT, "dup2"); poll_f = (poll_t)dlsym(RTLD_NEXT, "poll"); select_f = (select_t)dlsym(RTLD_NEXT, "select"); connect_f = (connect_t)dlsym(RTLD_NEXT, "connect"); accept_f = (accept_t)dlsym(RTLD_NEXT, "accept"); read_f = (read_t)dlsym(RTLD_NEXT, "read"); readv_f = (readv_t)dlsym(RTLD_NEXT, "readv"); recv_f = (recv_t)dlsym(RTLD_NEXT, "recv"); recvfrom_f = (recvfrom_t)dlsym(RTLD_NEXT, "recvfrom"); recvmsg_f = (recvmsg_t)dlsym(RTLD_NEXT, "recvmsg"); write_f = (write_t)dlsym(RTLD_NEXT, "write"); writev_f = (writev_t)dlsym(RTLD_NEXT, "writev"); send_f = (send_t)dlsym(RTLD_NEXT, "send"); sendto_f = (sendto_t)dlsym(RTLD_NEXT, "sendto"); sendmsg_f = (sendmsg_t)dlsym(RTLD_NEXT, "sendmsg"); fread_f = (fread_t)dlsym(RTLD_NEXT, "fread"); fwrite_f = (fwrite_t)dlsym(RTLD_NEXT, "fwrite"); pread_f = (pread_t)dlsym(RTLD_NEXT, "pread"); pwrite_f = (pwrite_t)dlsym(RTLD_NEXT, "pwrite"); sendfile_f = (sendfile_t)dlsym(RTLD_NEXT, "sendfile"); dlopen_f = (dlopen_t)dlsym(RTLD_NEXT, "dlopen"); #ifdef __linux__ dup3_f = (dup3_t)dlsym(RTLD_NEXT, "dup3"); gethostbyname_f = (gethostbyname_t)dlsym(RTLD_NEXT, "gethostbyname"); __res_state_f = (__res_state_t)dlsym(RTLD_NEXT,"__res_state"); __poll_f = (__poll_t)dlsym(RTLD_NEXT, "__poll"); epoll_wait_f = (epoll_wait_t)dlsym(RTLD_NEXT, "epoll_wait"); #endif #ifdef __APPLE__ kevent_f = (kevent_t)dlsym(RTLD_NEXT, "kevent"); kevent64_f = (kevent64_t)dlsym(RTLD_NEXT, "kevent64"); #endif DEFINE_STATIC_INITZZ_END //============================================================================= extern "C" { static boolean process_signaled = false; static llong interrupt_escaped_time = 0L; static EThreadLocalStorage thread_signaled; #ifndef __SIGRTMAX #define __SIGRTMAX 64 #endif static sig_t sigfunc_map[__SIGRTMAX] = {0}; static void sigfunc(int sig_no) { process_signaled = true; llong t1 = ESystem::currentTimeMillis(); ES_ASSERT(sig_no < __SIGRTMAX); if (sig_no < __SIGRTMAX) { sig_t func = sigfunc_map[sig_no]; if (func) { func(sig_no); } } else { fprintf(stderr, "sig_no >= %d\n", __SIGRTMAX); } llong t2 = ESystem::currentTimeMillis(); interrupt_escaped_time = t2 - t1; process_signaled = false; } static uint32_t PollEvent2EEvent(short events) { uint32_t e = 0; if (events & POLLIN) e |= ECO_POLL_READABLE; if (events & POLLOUT) e |= ECO_POLL_WRITABLE; return e; } static short EEvent2PollEvent(uint32_t events) { short e = 0; if (events & ECO_POLL_READABLE) e |= POLLIN; if (events & ECO_POLL_WRITABLE) e |= POLLOUT; return e; } } //!C //============================================================================= extern "C" { sig_t signal(int sig, sig_t func) { EHooker::_initzz_(); ES_ASSERT(sig < __SIGRTMAX); if (sig < __SIGRTMAX) { if ((long)func > 512) { //special defined sig_t is always less 512 ? sigfunc_map[sig] = func; signal_f(sig, sigfunc); } else { signal_f(sig, func); } return func; } fprintf(stderr, "sig_no > %d\n", __SIGRTMAX); return NULL; } unsigned int sleep(unsigned int seconds) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return sleep_f(seconds); } llong milliseconds = seconds * 1000; EFiber::sleep(milliseconds); return 0; } int usleep(useconds_t usec) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return usleep_f(usec); } llong milliseconds = usec / 1000; EFiber::sleep(milliseconds); return 0; } int nanosleep(const struct timespec *req, struct timespec *rem) { EHooker::_initzz_(); if (!req) { errno = EINVAL; return -1; } EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return nanosleep_f(req, rem); } llong milliseconds = req->tv_sec * 1000 + req->tv_nsec / 1000000; EFiber::sleep(milliseconds); return 0; } int close(int fd) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (scheduler && EFileContext::isStreamFile(fd) && !EHooker::isInterrupted()) { scheduler->delFileContext(fd); } return close_f(fd); } int fcntl(int fd, int cmd, ...) { EHooker::_initzz_(); va_list args; va_start(args, cmd); void* arg = va_arg(args, void*); va_end(args); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (scheduler && EFileContext::isStreamFile(fd) && !EHooker::isInterrupted()) { sp<EFileContext> fdctx = scheduler->getFileContext(fd); if (!fdctx) { return -1; } if (cmd == F_SETFL) { int flags = (int)((long)(arg)); fdctx->setUserNonBlock(flags & O_NONBLOCK); return 0; } if (cmd == F_GETFL) { int flags = fcntl_f(fd, cmd); if (fdctx->isUserNonBlocked()) return flags | O_NONBLOCK; else return flags & ~O_NONBLOCK; } } return fcntl_f(fd, cmd, arg); } int ioctl(int fd, unsigned long int request, ...) { EHooker::_initzz_(); va_list va; va_start(va, request); void* arg = va_arg(va, void*); va_end(va); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (scheduler && (request == FIONBIO) && EFileContext::isStreamFile(fd) && !EHooker::isInterrupted()) { sp<EFileContext> fdctx = scheduler->getFileContext(fd); if (!fdctx) { return -1; } boolean nonblock = !!*(int*)arg; fdctx->setUserNonBlock(nonblock); return 0; } return ioctl_f(fd, request, arg); } int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen) { EHooker::_initzz_(); if (level == SOL_SOCKET) { if (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO) { EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (scheduler && EFileContext::isStreamFile(sockfd) && !EHooker::isInterrupted()) { sp<EFileContext> fdctx = scheduler->getFileContext(sockfd); if (!fdctx) { return -1; } if (optname == SO_RCVTIMEO) fdctx->setRecvTimeout((const timeval*)optval); if (optname == SO_SNDTIMEO) fdctx->setSendTimeout((const timeval*)optval); } } } return setsockopt_f(sockfd, level, optname, optval, optlen); } int dup2(int oldfd, int newfd) { EHooker::_initzz_(); if (oldfd == newfd) { return 0; } EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (scheduler && EFileContext::isStreamFile(newfd) && !EHooker::isInterrupted()) { scheduler->delFileContext(newfd); } return dup2_f(oldfd, newfd); } #ifdef __linux__ int dup3(int oldfd, int newfd, int flags) { EHooker::_initzz_(); if (oldfd == newfd) { errno = EINVAL; return -1; } EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (scheduler && EFileContext::isStreamFile(newfd) && !EHooker::isInterrupted()) { scheduler->delFileContext(newfd); } return dup3_f(oldfd, newfd, flags); } #endif int poll(struct pollfd *fds, nfds_t nfds, int timeout) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return poll_f(fds, nfds, timeout); } if (timeout == 0) return poll_f(fds, nfds, timeout); boolean invalide_all = true; for (nfds_t i = 0; i < nfds; ++i) { invalide_all &= (fds[i].fd < 0); } if (invalide_all) { EFiber::sleep(timeout); return 0; } #if 1 // try once at immediately. int ret = poll_f(fds, nfds, 0); if (ret != 0) { return ret; } #endif EIoWaiter* ioWaiter = EFiberScheduler::currentIoWaiter(); sp<EFiber> fiber = EFiber::currentFiber()->shared_from_this(); boolean none = true; for (nfds_t i = 0; i < nfds; ++i) { if (fds[i].fd < 0) continue; ioWaiter->setFileEvent(fds[i].fd, PollEvent2EEvent(fds[i].events), fiber); none = false; } if (none) { errno = 0; return nfds; } llong timerID = -1; if (timeout > 0) { timerID = ioWaiter->setupTimer(timeout, fiber); } ioWaiter->swapOut(fiber); // pause the fiber. if (timerID != -1) { ioWaiter->cancelTimer(timerID); } if (fiber->isWaitTimeout()) { for (nfds_t i = 0; i < nfds; ++i) { ioWaiter->delFileEvent(fds[i].fd, ECO_POLL_ALL_EVENTS); } return 0; } else { int n = 0; for (nfds_t i = 0; i < nfds; ++i) { fds[i].revents = EEvent2PollEvent(ioWaiter->getFileEvent(fds[i].fd)); ioWaiter->delFileEvent(fds[i].fd, ECO_POLL_ALL_EVENTS); if (fds[i].revents) n++; } errno = 0; return n; } } int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return select_f(nfds, readfds, writefds, exceptfds, timeout); } llong milliseconds = ELLong::MAX_VALUE; if (timeout) milliseconds = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; if (milliseconds == 0) return select_f(nfds, readfds, writefds, exceptfds, timeout); if (nfds == 0 || (!readfds && !writefds && !exceptfds)) { EFiber::sleep(milliseconds); return 0; } nfds = ES_MIN(nfds, FD_SETSIZE); #if 1 // try once at immediately. timeval zero_tv = {0, 0}; int ret = select_f(nfds, readfds, writefds, exceptfds, &zero_tv); if (ret != 0) { return ret; } #endif //FIXME: to support exceptfds. EIoWaiter* ioWaiter = EFiberScheduler::currentIoWaiter(); sp<EFiber> fiber = EFiber::currentFiber()->shared_from_this(); EArrayList<int> pfds; short events = 0; for (int fd = 0; fd < nfds; fd++) { if (readfds && FD_ISSET(fd, readfds)) { events = ECO_POLL_READABLE; } if (writefds && FD_ISSET(fd, writefds)) { events = ECO_POLL_WRITABLE; } if (events == 0) { continue; } ioWaiter->setFileEvent(fd, events, fiber); pfds.add(fd); } // clear the old. if (readfds) FD_ZERO(readfds); if (writefds) FD_ZERO(writefds); if (exceptfds) FD_ZERO(exceptfds); llong timerID = -1; if (milliseconds > 0) { timerID = ioWaiter->setupTimer(milliseconds, fiber); } ioWaiter->swapOut(fiber); // pause the fiber. if (timerID != -1) { ioWaiter->cancelTimer(timerID); } if (fiber->isWaitTimeout()) { for (int i = 0; i < pfds.size(); i++) { int fd = pfds.getAt(i); ioWaiter->delFileEvent(fd, ECO_POLL_ALL_EVENTS); } return 0; } else { int n = 0; for (int i = 0; i < pfds.size(); i++) { int fd = pfds.getAt(i); events = ioWaiter->getFileEvent(fd); if (events) n++; if (readfds && (events & ECO_POLL_READABLE)) { FD_SET(fd, readfds); } if (writefds && (events & ECO_POLL_WRITABLE)) { FD_SET(fd, writefds); } ioWaiter->delFileEvent(fd, ECO_POLL_ALL_EVENTS); } errno = 0; return n; } } int connect(int fd, const struct sockaddr *addr, socklen_t addrlen) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler /*|| !EFileContext::isStreamFile(fd)*/ || EHooker::isInterrupted()) { return connect_f(fd, addr, addrlen); } sp<EFileContext> fdctx = scheduler->getFileContext(fd); if (!fdctx) { //errno = EBADF; return -1; //return connect_f(fd, addr, addrlen); } if (fdctx->isUserNonBlocked()) { return connect_f(fd, addr, addrlen); } int n = connect_f(fd, addr, addrlen); if (n == 0) { // success immediately return 0; } else if (n == -1 && errno == EINPROGRESS) { // waiting EIoWaiter* ioWaiter = EFiberScheduler::currentIoWaiter(); sp<EFiber> fiber = EFiber::currentFiber()->shared_from_this(); ioWaiter->setFileEvent(fd, ECO_POLL_WRITABLE, fiber); ioWaiter->swapOut(fiber); // pause the fiber. ioWaiter->delFileEvent(fd, ECO_POLL_WRITABLE); // re-check int err = 0; socklen_t optlen = sizeof(int); if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&err, &optlen) == -1) { return -1; } if (!err) return 0; else { errno = err; return -1; } } else { // error return n; } } int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(accept_f, "accept", POLLIN, sockfd, sockfd, addr, addrlen); #else return EHooker::comm_io_on_fiber(accept_f, "accept", POLLIN, sockfd, addr, addrlen); #endif } ssize_t read(int fd, void *buf, size_t count) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(read_f, "read", POLLIN, fd, fd, buf, count); #else return EHooker::comm_io_on_fiber(read_f, "read", POLLIN, fd, buf, count); #endif } ssize_t readv(int fd, const struct iovec *iov, int iovcnt) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(readv_f, "readv", POLLIN, fd, fd, iov, iovcnt); #else return EHooker::comm_io_on_fiber(readv_f, "readv", POLLIN, fd, iov, iovcnt); #endif } ssize_t recv(int sockfd, void *buf, size_t len, int flags) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(recv_f, "recv", POLLIN, sockfd, sockfd, buf, len, flags); #else return EHooker::comm_io_on_fiber(recv_f, "recv", POLLIN, sockfd, buf, len, flags); #endif } ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(recvfrom_f, "recvfrom", POLLIN, sockfd, sockfd, buf, len, flags, src_addr, addrlen); #else return EHooker::comm_io_on_fiber(recvfrom_f, "recvfrom", POLLIN, sockfd, buf, len, flags, src_addr, addrlen); #endif } ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(recvmsg_f, "recvmsg", POLLIN, sockfd, sockfd, msg, flags); #else return EHooker::comm_io_on_fiber(recvmsg_f, "recvmsg", POLLIN, sockfd, msg, flags); #endif } ssize_t write(int fd, const void *buf, size_t count) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(write_f, "write", POLLOUT, fd, fd, buf, count); #else return EHooker::comm_io_on_fiber(write_f, "write", POLLOUT, fd, buf, count); #endif } ssize_t writev(int fd, const struct iovec *iov, int iovcnt) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(writev_f, "writev", POLLOUT, fd, fd, iov, iovcnt); #else return EHooker::comm_io_on_fiber(writev_f, "writev", POLLOUT, fd, iov, iovcnt); #endif } ssize_t send(int sockfd, const void *buf, size_t len, int flags) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(send_f, "send", POLLOUT, sockfd, sockfd, buf, len, flags); #else return EHooker::comm_io_on_fiber(send_f, "send", POLLOUT, sockfd, buf, len, flags); #endif } ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(sendto_f, "sendto", POLLOUT, sockfd, sockfd, buf, len, flags, dest_addr, addrlen); #else return EHooker::comm_io_on_fiber(sendto_f, "sendto", POLLOUT, sockfd, buf, len, flags, dest_addr, addrlen); #endif } ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(sendmsg_f, "sendmsg", POLLOUT, sockfd, sockfd, msg, flags); #else return EHooker::comm_io_on_fiber(sendmsg_f, "sendmsg", POLLOUT, sockfd, msg, flags); #endif } ssize_t pread(int fd, void *buf, size_t count, off_t offset) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(pread_f, "pread", POLLIN, fd, fd, buf, count, offset); #else return EHooker::comm_io_on_fiber(pread_f, "pread", POLLIN, fd, buf, count, offset); #endif } ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) { #ifdef CPP11_SUPPORT return EHooker::comm_io_on_fiber(pwrite_f, "pwrite", POLLOUT, fd, fd, buf, count, offset); #else return EHooker::comm_io_on_fiber(pwrite_f, "pwrite", POLLOUT, fd, buf, count, offset); #endif } size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream) { return EHooker::comm_io_on_fiber(fread_f, "fread", POLLIN, eso_fileno(stream), ptr, size, nitems, stream); } size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream) { return EHooker::comm_io_on_fiber(fwrite_f, "fwrite", POLLOUT, eso_fileno(stream), ptr, size, nitems, stream); } //============================================================================= #ifdef __linux__ struct hostbuf_wrap { struct hostent host; char* buffer; size_t iBufferSize; int host_errno; }; static void fiber_destroyed_callback_to_free_res_state(void* data) { if (data) { res_state w = (res_state)data; if (w) free(w); } } static void fiber_destroyed_callback_to_free_hostbuf_wrap(void* data) { if (data) { hostbuf_wrap* w = (hostbuf_wrap*)data; if (w->buffer) free(w->buffer); free(w); } } static EFiberLocal<res_state> res_state_local(fiber_destroyed_callback_to_free_res_state); static EFiberLocal<hostbuf_wrap*> hostbuf_wrap_local(fiber_destroyed_callback_to_free_hostbuf_wrap); res_state __res_state() { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return __res_state_f(); } res_state rs = res_state_local.get(); if (!rs) { rs = (res_state)malloc(sizeof(struct __res_state)); res_state_local.set(rs); } return rs; } struct hostent *gethostbyname(const char *name) { if (!name) { return NULL; } EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return gethostbyname_f(name); } hostbuf_wrap* hw = hostbuf_wrap_local.get(); if (!hw) { hw = (hostbuf_wrap*)calloc(1, sizeof(hostbuf_wrap)); hostbuf_wrap_local.set(hw); } if (hw->buffer && hw->iBufferSize > 1024) { free(hw->buffer); hw->buffer = NULL; } if (!hw->buffer) { hw->buffer = (char*)malloc(1024); hw->iBufferSize = 1024; } struct hostent *host = &hw->host; struct hostent *result = NULL; int *h_errnop = &(hw->host_errno); RETRY: #ifdef __GLIBC__ gethostbyname_r(name, host, hw->buffer, hw->iBufferSize, &result, h_errnop); #else result = gethostbyname_r(name, host, hw->buffer, hw->iBufferSize, h_errnop); #endif while (result == NULL && errno == ERANGE) { hw->iBufferSize = hw->iBufferSize * 2; hw->buffer = (char*)realloc(hw->buffer, hw->iBufferSize); goto RETRY; } return result; } int __poll(struct pollfd fds[], nfds_t nfds, int timeout) { return poll(fds, nfds, timeout); } int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || timeout == 0 || EHooker::isInterrupted()) { return epoll_wait_f(epfd, events, maxevents, timeout); } // waiting for events signal EIoWaiter* ioWaiter = EFiberScheduler::currentIoWaiter(); sp<EFiber> fiber = EFiber::currentFiber()->shared_from_this(); ioWaiter->setFileEvent(epfd, ECO_POLL_READABLE, fiber); llong milliseconds = (timeout > 0) ? timeout : EInteger::MAX_VALUE; llong timerID = ioWaiter->setupTimer(milliseconds, fiber); ioWaiter->swapOut(fiber); // pause the fiber. ioWaiter->cancelTimer(timerID); ioWaiter->delFileEvent(epfd, ECO_POLL_ALL_EVENTS); if (fiber->isWaitTimeout()) { errno = EINVAL; return -1; } else { return epoll_wait_f(epfd, events, maxevents, 0); } } ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || !EFileContext::isStreamFile(out_fd) || EHooker::isInterrupted()) { return sendfile_f(out_fd, in_fd, offset, count); } sp<EFileContext> fdctx = scheduler->getFileContext(out_fd); if (!fdctx) { return -1; } boolean isUNB = fdctx->isUserNonBlocked(); if (isUNB) { return sendfile_f(out_fd, in_fd, offset, count); } int milliseconds = fdctx->getSendTimeout(); if (milliseconds == 0) milliseconds = -1; off_t offset_ = offset ? *offset : 0; RETRY: pollfd pfd; pfd.fd = out_fd; pfd.events = POLLOUT; pfd.revents = 0; ssize_t ret = poll(&pfd, 1, milliseconds); if (ret == 1) { //success ret = sendfile_f(out_fd, in_fd, &offset_, count); if (ret > 0) count -= ret; if ((ret >= 0 && count > 0) || (ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))) { if (count > 0) goto RETRY; } } else if (ret == 0) { //timeout ret = -1; errno = isUNB ? EAGAIN : ETIMEDOUT; } if (offset) *offset = offset_; if (ret == 0) errno = 0; return ret; } #else // __APPLE__ // gethostbyname() is asynchronous already, @see libinfo/mdns_module.c:_mdns_search():kqueue! int kevent(int kq, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return kevent_f(kq, changelist, nchanges, eventlist, nevents, timeout); } if ((timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0) || !eventlist || nevents == 0) { // try at immediately. return kevent_f(kq, changelist, nchanges, eventlist, nevents, timeout); } // waiting for events signal if (changelist && nchanges > 0) { kevent_f(kq, changelist, nchanges, NULL, 0, NULL); } EIoWaiter* ioWaiter = EFiberScheduler::currentIoWaiter(); sp<EFiber> fiber = EFiber::currentFiber()->shared_from_this(); ioWaiter->setFileEvent(kq, ECO_POLL_READABLE, fiber); llong milliseconds = timeout ? (timeout->tv_sec * 1000 + timeout->tv_nsec / 1000000) : EInteger::MAX_VALUE; llong timerID = ioWaiter->setupTimer(milliseconds, fiber); ioWaiter->swapOut(fiber); // pause the fiber. ioWaiter->cancelTimer(timerID); ioWaiter->delFileEvent(kq, ECO_POLL_ALL_EVENTS); if (fiber->isWaitTimeout()) { errno = EINVAL; return -1; } else { struct timespec zerotv = {0, 0}; return kevent_f(kq, NULL, 0, eventlist, nevents, &zerotv); } } int kevent64(int kq, const struct kevent64_s *changelist, int nchanges, struct kevent64_s *eventlist, int nevents, unsigned int flags, const struct timespec *timeout) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || EHooker::isInterrupted()) { return kevent64_f(kq, changelist, nchanges, eventlist, nevents, flags, timeout); } if ((timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0) || !eventlist || nevents == 0) { // try once at immediately. return kevent64_f(kq, changelist, nchanges, eventlist, nevents, flags, timeout); } // waiting for events signal if (changelist && nchanges > 0) { kevent64_f(kq, changelist, nchanges, NULL, 0, flags, NULL); } EIoWaiter* ioWaiter = EFiberScheduler::currentIoWaiter(); sp<EFiber> fiber = EFiber::currentFiber()->shared_from_this(); ioWaiter->setFileEvent(kq, ECO_POLL_READABLE, fiber); llong milliseconds = timeout ? (timeout->tv_sec * 1000 + timeout->tv_nsec / 1000000) : EInteger::MAX_VALUE; llong timerID = ioWaiter->setupTimer(milliseconds, fiber); ioWaiter->swapOut(fiber); // pause the fiber. ioWaiter->cancelTimer(timerID); ioWaiter->delFileEvent(kq, ECO_POLL_ALL_EVENTS); if (fiber->isWaitTimeout()) { errno = EINVAL; return -1; } else { struct timespec zerotv = {0, 0}; return kevent64_f(kq, NULL, 0, eventlist, nevents, flags, &zerotv); } } int sendfile(int fd, int s, off_t offset, off_t *len, struct sf_hdtr *hdtr, int flags) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || !EFileContext::isStreamFile(s) || EHooker::isInterrupted()) { return sendfile_f(fd, s, offset, len, hdtr, flags); } sp<EFileContext> fdctx = scheduler->getFileContext(s); if (!fdctx) { return -1; } boolean isUNB = fdctx->isUserNonBlocked(); if (isUNB) { return sendfile_f(fd, s, offset, len, hdtr, flags); } int milliseconds = fdctx->getSendTimeout(); if (milliseconds == 0) milliseconds = -1; off_t inlen = len ? *len : 0; off_t outlen; RETRY: pollfd pfd; pfd.fd = s; pfd.events = POLLOUT; pfd.revents = 0; int ret = poll(&pfd, 1, milliseconds); if (ret == 1) { //success outlen = inlen; ret = sendfile_f(fd, s, offset, &outlen, hdtr, flags); if (ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) { if (outlen > 0) { offset += outlen; inlen -= outlen; } if (inlen > 0) goto RETRY; } } else if (ret == 0) { //timeout ret = -1; errno = isUNB ? EAGAIN : ETIMEDOUT; } if (ret == 0) errno = 0; return ret; } #endif } //!C //============================================================================= boolean EHooker::isInterrupted() { return process_signaled; } llong EHooker::interruptEscapedTime() { return interrupt_escaped_time; } #ifdef CPP11_SUPPORT template <typename F, typename ... Args> ssize_t EHooker::comm_io_on_fiber(F fn, const char* name, int event, int fd, Args&&... args) { EHooker::_initzz_(); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || !EFileContext::isStreamFile(fd) || EHooker::isInterrupted()) { return fn(std::forward<Args>(args)...); } sp<EFileContext> fdctx = scheduler->getFileContext(fd); if (!fdctx) { return -1; } boolean isUNB = fdctx->isUserNonBlocked(); if (isUNB) { return fn(std::forward<Args>(args)...); } ssize_t ret = -1; if ((event & POLLOUT) == POLLOUT) { // try once at immediately. ret = fn(std::forward<Args>(args)...); if (ret >= 0) { //success? goto SUCCESS; } } // try io wait. { int milliseconds = (event == POLLIN) ? fdctx->getRecvTimeout() : fdctx->getSendTimeout(); if (milliseconds == 0) milliseconds = -1; RETRY: pollfd pfd; pfd.fd = fd; pfd.events = event; pfd.revents = 0; ret = poll(&pfd, 1, milliseconds); if (ret == 1) { //success ret = fn(std::forward<Args>(args)...); if (ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) { goto RETRY; } } else if (ret == 0) { //timeout ret = -1; errno = isUNB ? EAGAIN : ETIMEDOUT; } } SUCCESS: if (ret >= 0 && ((intptr_t)fn == (intptr_t)accept_f)) { // if listen socket is non-blocking then accepted socket also non-blocking, // we need reset it to back. int socket = (int)ret; int flags = fcntl_f(socket, F_GETFL); fcntl_f(socket, F_SETFL, flags & ~O_NONBLOCK); } return ret; } #else //! template <typename F> static ssize_t call_fn(EFileContext* fdctx, F fn, int fd, va_list _args) { ssize_t ret = -1; va_list args; #ifdef va_copy va_copy(args, _args); #else args = _args; #endif if ((intptr_t)fn == (intptr_t)accept_f) { struct sockaddr* addr = va_arg(args, struct sockaddr*); socklen_t* addrlen = va_arg(args, socklen_t*); int socket = accept_f(fd, addr, addrlen); if (socket >= 0 && fdctx != null && !fdctx->isUserNonBlocked()) { // if listen socket is non-blocking then accepted socket also non-blocking, // we need reset it to back. int flags = fcntl_f(socket, F_GETFL); fcntl_f(socket, F_SETFL, flags & ~O_NONBLOCK); } ret = socket; } else if ((intptr_t)fn == (intptr_t)read_f) { void* buf = va_arg(args, void*); size_t count = va_arg(args, size_t); ret = read_f(fd, buf, count); } else if ((intptr_t)fn == (intptr_t)readv_f) { struct iovec* iov = va_arg(args, struct iovec*); int iovcnt = va_arg(args, int); ret = readv_f(fd, iov, iovcnt); } else if ((intptr_t)fn == (intptr_t)recv_f) { void *buf = va_arg(args, void*); size_t len = va_arg(args, size_t); int flags = va_arg(args, int); ret = recv_f(fd, buf, len, flags); } else if ((intptr_t)fn == (intptr_t)recvfrom_f) { void *buf = va_arg(args, void*); size_t len = va_arg(args, size_t); int flags = va_arg(args, int); struct sockaddr *src_addr = va_arg(args, struct sockaddr*); socklen_t *addrlen = va_arg(args, socklen_t*); ret = recvfrom_f(fd, buf, len, flags, src_addr, addrlen); } else if ((intptr_t)fn == (intptr_t)recvmsg_f) { struct msghdr *msg = va_arg(args, struct msghdr*); int flags = va_arg(args, int); ret = recvmsg_f(fd, msg, flags); } else if ((intptr_t)fn == (intptr_t)write_f) { void* buf = va_arg(args, void*); size_t count = va_arg(args, size_t); ret = write_f(fd, buf, count); } else if ((intptr_t)fn == (intptr_t)writev_f) { struct iovec* iov = va_arg(args, struct iovec*); int iovcnt = va_arg(args, int); ret = writev_f(fd, iov, iovcnt); } else if ((intptr_t)fn == (intptr_t)send_f) { void *buf = va_arg(args, void*); size_t len = va_arg(args, size_t); int flags = va_arg(args, int); ret = send_f(fd, buf, len, flags); } else if ((intptr_t)fn == (intptr_t)sendto_f) { void *buf = va_arg(args, void*); size_t len = va_arg(args, size_t); int flags = va_arg(args, int); struct sockaddr *dest_addr = va_arg(args, struct sockaddr*); socklen_t addrlen = va_arg(args, socklen_t); ret = sendto_f(fd, buf, len, flags, dest_addr, addrlen); } else if ((intptr_t)fn == (intptr_t)sendmsg_f) { struct msghdr *msg = va_arg(args, struct msghdr*); int flags = va_arg(args, int); ret = sendmsg_f(fd, msg, flags); } else if ((intptr_t)fn == (intptr_t)fread_f) { //fread void *ptr = va_arg(args, void*); size_t size = va_arg(args, size_t); size_t nitems = va_arg(args, size_t); FILE *stream = va_arg(args, FILE*); ret = fread_f(ptr, size, nitems, stream); } else if ((intptr_t)fn == (intptr_t)fwrite_f) { //fwrite void *ptr = va_arg(args, void*); size_t size = va_arg(args, size_t); size_t nitems = va_arg(args, size_t); FILE *stream = va_arg(args, FILE*); ret = fwrite_f(ptr, size, nitems, stream); } else if ((intptr_t)fn == (intptr_t)pread_f) { void *buf = va_arg(args, void*); size_t count = va_arg(args, size_t); off_t offset = va_arg(args, off_t); ret = pread_f(fd, buf, count, offset); } else if ((intptr_t)fn == (intptr_t)pwrite_f) { void *buf = va_arg(args, void*); size_t count = va_arg(args, size_t); off_t offset = va_arg(args, off_t); ret = pwrite_f(fd, buf, count, offset); } else { #ifdef va_copy va_end(args); #endif throw EUnsupportedOperationException(__FILE__, __LINE__); } #ifdef va_copy va_end(args); #endif return ret; } template <typename F> ssize_t EHooker::comm_io_on_fiber(F fn, const char* name, int event, int fd, ...) { EHooker::_initzz_(); ssize_t ret; va_list args; va_start(args, fd); EFiberScheduler* scheduler = EFiberScheduler::currentScheduler(); if (!scheduler || !EFileContext::isStreamFile(fd) || EHooker::isInterrupted()) { ret = call_fn(null, fn, fd, args); va_end(args); return ret; } sp<EFileContext> fdctx = scheduler->getFileContext(fd); if (!fdctx) { va_end(args); return -1; } boolean isUNB = fdctx->isUserNonBlocked(); if (isUNB) { ret = call_fn(null, fn, fd, args); va_end(args); return ret; } if ((event & POLLOUT) == POLLOUT) { // try once at immediately. ret = call_fn(fdctx.get(), fn, fd, args); if (ret >= 0) { //success? va_end(args); return ret; } } int milliseconds = (event == POLLIN) ? fdctx->getRecvTimeout() : fdctx->getSendTimeout(); if (milliseconds == 0) milliseconds = -1; RETRY: pollfd pfd; pfd.fd = fd; pfd.events = event; pfd.revents = 0; ret = poll(&pfd, 1, milliseconds); if (ret == 1) { //success ret = call_fn(fdctx.get(), fn, fd, args); if (ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) { goto RETRY; } } else if (ret == 0) { //timeout ret = -1; errno = isUNB ? EAGAIN : ETIMEDOUT; } va_end(args); return ret; } #endif //!CPP11_SUPPORT //============================================================================= extern "C" { struct rebinding __rebinding[] = { { "signal", (void*) signal, NULL }, { "sleep", (void*) sleep, NULL }, { "usleep", (void*) usleep, NULL }, { "nanosleep", (void*) nanosleep, NULL }, { "close", (void*) close, NULL }, { "fcntl", (void*) fcntl, NULL }, { "setsockopt", (void*) setsockopt, NULL }, { "dup2", (void*) dup2, NULL }, { "poll", (void*) poll, NULL }, { "select", (void*) select, NULL }, { "connect", (void*) connect, NULL }, { "accept", (void*) accept, NULL }, { "read", (void*) read, NULL }, { "readv", (void*) readv, NULL }, { "recvfrom", (void*) recvfrom, NULL }, { "recvmsg", (void*) recvmsg, NULL }, { "write", (void*) write, NULL }, { "writev", (void*) writev, NULL }, { "send", (void*) send, NULL }, { "sendto", (void*) sendto, NULL }, { "sendmsg", (void*) sendmsg, NULL }, { "fread", (void*) fread, NULL }, { "fwrite", (void*) fwrite, NULL }, { "pread", (void*) pread, NULL }, { "pwrite", (void*) pwrite, NULL }, { "sendfile", (void*) sendfile, NULL }, { "dlopen", (void*) dlopen, NULL } #ifdef __linux__ , { "dup3", (void*) dup3, NULL }, { "gethostbyname", (void*) gethostbyname, NULL }, { "__res_state", (void*) __res_state, NULL }, { "__poll", (void*) __poll, NULL }, { "epoll_wait", (void*) epoll_wait, NULL } #endif #ifdef __APPLE__ , { "kevent", (void*) kevent, NULL }, { "kevent64", (void*) kevent64, NULL } #endif }; #ifdef __linux__ void* dlopen(const char* path, int mode) { void* handle = dlopen_f(path, mode); if (handle) { rebind_symbols_image(path, handle, __rebinding, ES_ARRAY_LEN(__rebinding)); } return handle; } #else //__APPLE__ static const char * first_external_symbol_for_image( const mach_header_t *header) { Dl_info info; if (dladdr(header, &info) == 0) return NULL; segment_command_t *seg_linkedit = NULL; segment_command_t *seg_text = NULL; struct symtab_command *symtab = NULL; struct load_command *cmd = (struct load_command *) ((intptr_t) header + sizeof(mach_header_t)); for (uint32_t i = 0; i < header->ncmds; i++, cmd = (struct load_command *) ((intptr_t) cmd + cmd->cmdsize)) { switch (cmd->cmd) { case LC_SEGMENT: case LC_SEGMENT_64: if (!strcmp(((segment_command_t *) cmd)->segname, SEG_TEXT)) seg_text = (segment_command_t *) cmd; else if (!strcmp(((segment_command_t *) cmd)->segname, SEG_LINKEDIT)) seg_linkedit = (segment_command_t *) cmd; break; case LC_SYMTAB: symtab = (struct symtab_command *) cmd; break; } } if ((seg_text == NULL) || (seg_linkedit == NULL) || (symtab == NULL)) return NULL; intptr_t file_slide = ((intptr_t) seg_linkedit->vmaddr - (intptr_t) seg_text->vmaddr) - seg_linkedit->fileoff; intptr_t strings = (intptr_t) header + (symtab->stroff + file_slide); nlist_t *sym = (nlist_t *) ((intptr_t) header + (symtab->symoff + file_slide)); for (uint32_t i = 0; i < symtab->nsyms; i++, sym++) { if ((sym->n_type & N_EXT) != N_EXT || !sym->n_value) continue; return (const char *) strings + sym->n_un.n_strx; } return NULL; } void* dlopen(const char* path, int mode) { void* h = dlopen_f(path, mode); //! if (h) { /** * in order to trigger findExportedSymbol instead of findExportedSymbolInImageOrDependentImages. * See `dlsym` implementation at http://opensource.apple.com/source/dyld/dyld-239.3/src/dyldAPIs.cpp */ void* handle = (void *) ((intptr_t) h | 1); for (int32_t i = _dyld_image_count(); i >= 0; i--) { const char *first_symbol = first_external_symbol_for_image( (const mach_header_t *) _dyld_get_image_header(i)); if (first_symbol && *first_symbol) { first_symbol++; // in order to remove the leading underscore void *address = dlsym(handle, first_symbol); if (address) { Dl_info info; if (dladdr(address, &info)) { rebind_symbols_image(info.dli_fbase, _dyld_get_image_vmaddr_slide(i), __rebinding, ES_ARRAY_LEN(__rebinding)); } break; //! } } } } return h; } #endif //! } //!C } /* namespace eco */ } /* namespace efc */
26.944517
118
0.672473
cxxjava
d4f08af725ac4c4915603a9ee3da04b2cbda6646
4,269
hpp
C++
modules/viz/include/opencv2/viz.hpp
Nerei/opencv
92d5f8744c872ccf63b17334f018343973353e47
[ "BSD-3-Clause" ]
1
2015-04-22T14:10:46.000Z
2015-04-22T14:10:46.000Z
modules/viz/include/opencv2/viz.hpp
ameydhar/opencv
1c3bfae2121f689535ab1a17284f40f5d64e0927
[ "BSD-3-Clause" ]
null
null
null
modules/viz/include/opencv2/viz.hpp
ameydhar/opencv
1c3bfae2121f689535ab1a17284f40f5d64e0927
[ "BSD-3-Clause" ]
2
2018-05-03T21:08:19.000Z
2020-09-26T06:27:08.000Z
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2013, OpenCV Foundation, all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // * The name of the copyright holders may not be used to endorse or promote products // derived from this software without specific prior written permission. // // This software is provided by the copyright holders and contributors "as is" and // any express or implied warranties, including, but not limited to, the implied // warranties of merchantability and fitness for a particular purpose are disclaimed. // In no event shall the Intel Corporation or contributors be liable for any direct, // indirect, incidental, special, exemplary, or consequential damages // (including, but not limited to, procurement of substitute goods or services; // loss of use, data, or profits; or business interruption) however caused // and on any theory of liability, whether in contract, strict liability, // or tort (including negligence or otherwise) arising in any way out of // the use of this software, even if advised of the possibility of such damage. // // Authors: // * Ozan Tonkal, ozantonkal@gmail.com // * Anatoly Baksheev, Itseez Inc. myname.mysurname <> mycompany.com // // OpenCV Viz module is complete rewrite of // PCL visualization module (www.pointclouds.org) // //M*/ #ifndef __OPENCV_VIZ_HPP__ #define __OPENCV_VIZ_HPP__ #include <opencv2/viz/types.hpp> #include <opencv2/viz/widgets.hpp> #include <opencv2/viz/viz3d.hpp> namespace cv { namespace viz { //! takes coordiante frame data and builds transfrom to global coordinate frame CV_EXPORTS Affine3f makeTransformToGlobal(const Vec3f& axis_x, const Vec3f& axis_y, const Vec3f& axis_z, const Vec3f& origin = Vec3f::all(0)); //! constructs camera pose from position, focal_point and up_vector (see gluLookAt() for more infromation) CV_EXPORTS Affine3f makeCameraPose(const Vec3f& position, const Vec3f& focal_point, const Vec3f& y_dir); //! retrieves a window by its name. If no window with such name, then it creates new. CV_EXPORTS Viz3d get(const String &window_name); //! Unregisters all Viz windows from internal database. After it 'get()' will create new windows instead getting existing from the database. CV_EXPORTS void unregisterAllWindows(); //! checks float value for Nan inline bool isNan(float x) { unsigned int *u = reinterpret_cast<unsigned int *>(&x); return ((u[0] & 0x7f800000) == 0x7f800000) && (u[0] & 0x007fffff); } //! checks double value for Nan inline bool isNan(double x) { unsigned int *u = reinterpret_cast<unsigned int *>(&x); return (u[1] & 0x7ff00000) == 0x7ff00000 && (u[0] != 0 || (u[1] & 0x000fffff) != 0); } //! checks vectors for Nans template<typename _Tp, int cn> inline bool isNan(const Vec<_Tp, cn>& v) { return isNan(v.val[0]) || isNan(v.val[1]) || isNan(v.val[2]); } //! checks point for Nans template<typename _Tp> inline bool isNan(const Point3_<_Tp>& p) { return isNan(p.x) || isNan(p.y) || isNan(p.z); } } /* namespace viz */ } /* namespace cv */ #endif /* __OPENCV_VIZ_HPP__ */
43.561224
150
0.676037
Nerei
d4f19247f56162ffb8ad0c8a7f454126ce2046bd
8,036
hpp
C++
demo/c10k-server/ftp/ftp.hpp
AndreLouisCaron/w32
75b26a149e268138cbcf43e6f4669756ac4ac850
[ "BSD-2-Clause" ]
9
2015-12-30T15:21:20.000Z
2021-03-21T04:23:14.000Z
demo/c10k-server/ftp/ftp.hpp
AndreLouisCaron/w32
75b26a149e268138cbcf43e6f4669756ac4ac850
[ "BSD-2-Clause" ]
1
2022-01-02T11:12:57.000Z
2022-01-02T11:12:57.000Z
demo/c10k-server/ftp/ftp.hpp
AndreLouisCaron/w32
75b26a149e268138cbcf43e6f4669756ac4ac850
[ "BSD-2-Clause" ]
5
2018-04-09T04:44:58.000Z
2020-04-10T12:51:51.000Z
#ifndef _ftp_hpp__ #define _ftp_hpp__ // Copyright (c) 2009-2012, Andre Caron (andre.l.caron@gmail.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "../Core.hpp" #include "../Service.hpp" #include "../Task.hpp" #include "../Buffer.hpp" #include <istream> #include <map> #include <vector> namespace ftp { class Control; class Data; class Strategy; typedef std::vector<w32::string> Path; class Service : public server::Service { /* data. */ private: w32::net::ipv4::Address myHost; w32::uint16 myPort; /* construction. */ public: Service ( server::Core& core ); /* methods. */ public: w32::uint16 dynamicport (); w32::io::OutputStream uniquefile ( const Path& path, w32::string& name ); /* overrides. */ public: virtual void configure ( w32::xml::dom::Node node ); virtual w32::net::ipv4::Address host () const; virtual w32::uint16 port () const; virtual server::Task * connected ( Stream& stream, const Peer& peer ); }; class Control : public server::Task { /* data. */ protected: // I/O operations. w32::net::ipv4::Address myPeer; w32::net::StreamSocket myStream; server::IBuffer myGBuf; server::OBuffer myPBuf; // Thread-safety. w32::mt::CriticalSection myGuard; // Session state. std::string myUsername; std::vector<w32::string> myPath; // Data connection management. std::auto_ptr<Data> myData; std::auto_ptr<Strategy> myStrategy; /* construction. */ public: Control ( Service& service, const w32::net::ipv4::Address& peer, w32::net::StreamSocket& stream ); /* methods. */ public: const w32::net::ipv4::Address& peer () const; // Status updates from data connection. void finished (); void aborted (); private: void interpret (); void reply ( int status, const std::string& message = std::string() ); void append ( const std::string& message = std::string() ); void dispatch ( const std::string& code, std::istream& query ); /* overrides. */ public: virtual void acquired (); virtual void released (); virtual void abort (); virtual void completed ( const w32::io::Transfer * transfer, w32::dword size ); /* methods. */ private: // <http://tools.ietf.org/html/rfc959>. void noop ( std::istream& command ); void help ( std::istream& command ); void user ( std::istream& command ); void pass ( std::istream& command ); void acct ( std::istream& command ); void rein ( std::istream& command ); void quit ( std::istream& command ); void smnt ( std::istream& command ); void pwd ( std::istream& command ); void cwd ( std::istream& command ); void cdup ( std::istream& command ); void pasv ( std::istream& command ); void port ( std::istream& command ); void type ( std::istream& command ); void stru ( std::istream& command ); void mode ( std::istream& command ); void retr ( std::istream& command ); void stor ( std::istream& command ); void stou ( std::istream& command ); void appe ( std::istream& command ); void allo ( std::istream& command ); void rest ( std::istream& command ); void rnfr ( std::istream& command ); void rnto ( std::istream& command ); void abor ( std::istream& command ); void dele ( std::istream& command ); void rmd ( std::istream& command ); void mkd ( std::istream& command ); void list ( std::istream& command ); void nlst ( std::istream& command ); void site ( std::istream& command ); void syst ( std::istream& command ); void stat ( std::istream& command ); // <http://tools.ietf.org/html/rfc2389>. void feat ( std::istream& command ); void opts ( std::istream& command ); // <http://tools.ietf.org/html/rfc2640>. void lang ( std::istream& command ); // <http://tools.ietf.org/html/rfc3659>. void mdtm ( std::istream& command ); void size ( std::istream& command ); void tvfs ( std::istream& command ); void mlst ( std::istream& command ); void mlsd ( std::istream& command ); }; class Transfer { /* data. */ protected: server::IBuffer myGBuf; server::OBuffer myPBuf; /* construction. */ public: Transfer (); virtual ~Transfer (); /* methods. */ public: virtual bool completed ( const w32::io::Transfer& transfer, w32::dword size ); virtual void haul ( w32::net::StreamSocket& socket ) = 0; }; class Upload : public Transfer { /* data. */ private: w32::io::OutputStream myFile; /* construction. */ public: Upload ( w32::io::OutputStream& file ); virtual ~Upload (); /* overrides. */ public: virtual bool completed ( const w32::io::Transfer& transfer, w32::dword size ); virtual void haul ( w32::net::StreamSocket& stream ); }; class Download : public Transfer { /* data. */ private: w32::io::InputStream myFile; /* construction. */ public: Download ( w32::io::InputStream& file ); virtual ~Download (); /* overrides. */ public: virtual bool completed ( const w32::io::Transfer& transfer, w32::dword size ); virtual void haul ( w32::net::StreamSocket& stream ); }; class Data : public server::Task { /* data. */ private: Control& myControl; w32::net::StreamSocket myStream; w32::mt::CriticalSection myGuard; std::auto_ptr<Transfer> myTransfer; /* construction. */ public: Data ( Control& control, w32::net::StreamSocket& stream ); /* methods. */ public: void download ( w32::io::InputStream& file ); void upload ( w32::io::OutputStream& file ); /* overrides. */ public: virtual void acquired (); virtual void released (); virtual void abort (); virtual void completed ( const w32::io::Transfer * transfer, w32::dword size ); }; } #endif /* _ftp_hpp__ */
30.210526
74
0.578895
AndreLouisCaron
d4f3b97894c2b6e1f656275c0c48d8d7ad6005ad
518
cpp
C++
CPP/pascalTriangle.cpp
thefool76/hacktoberfest2021
237751e17a4fc325ded29fca013fb9f5853cd27c
[ "CC0-1.0" ]
448
2021-10-01T04:24:14.000Z
2022-03-06T14:34:20.000Z
CPP/pascalTriangle.cpp
Chanaka-Madushan-Herath/hacktoberfest2021
8473df9e058ccb6049720dd372342e0ea60f0e59
[ "CC0-1.0" ]
282
2021-10-01T04:29:06.000Z
2022-03-07T12:42:57.000Z
CPP/pascalTriangle.cpp
Chanaka-Madushan-Herath/hacktoberfest2021
8473df9e058ccb6049720dd372342e0ea60f0e59
[ "CC0-1.0" ]
1,807
2021-10-01T04:24:02.000Z
2022-03-28T04:51:25.000Z
#include<iostream> using namespace std; int main() { int n; // last level cin >> n; int arr[n][n]; for (int line = 0; line < n; ++line) { for(int space = 0; space <= n - line; ++space) cout << " "; for (int i = 0; i <= line; i++) { if (line == i || i == 0) arr[line][i] = 1; else arr[line][i] = arr[line - 1][i - 1] + arr[line - 1][i]; cout << arr[line][i] << " "; } cout << "\n"; } }
22.521739
71
0.376448
thefool76
d4f3ef40aed90c2afd070c8ec73eb1dbd5143634
614
cpp
C++
Week02/example2.cpp
Stoefff/Object-Oriented-Programming-FMI-2017
d2f8083ff146fb3cc68425cbd9af50bc37581e19
[ "MIT" ]
3
2018-03-05T13:57:56.000Z
2018-05-03T19:25:05.000Z
Week02/example2.cpp
Stoefff/Object-Oriented-Programming-FMI-2017
d2f8083ff146fb3cc68425cbd9af50bc37581e19
[ "MIT" ]
null
null
null
Week02/example2.cpp
Stoefff/Object-Oriented-Programming-FMI-2017
d2f8083ff146fb3cc68425cbd9af50bc37581e19
[ "MIT" ]
null
null
null
#include <iostream> #include <fstream> int main(){ std::ifstream file ("example.txt"); // saved us one row of writing same as ^ // We should always if the opening of a files is valid if (! file.good() ){ // there are also bad(), fail(), eof() std::cerr << "Could not open files"; // cerr - standart error return -1; } char buff[256]; // getline return how many symbols are read, return negative num when error while (file.getline(buff, 256) ){ file >> buff; std::cout << buff << std::endl; // Catches to space !! } file.close(); return 0; }
30.7
80
0.586319
Stoefff
d4f8b23421ac1afb4535fd401b3ac24b99887c11
6,131
cpp
C++
code/wxWidgets/src/motif/colour.cpp
Bloodknight/NeuTorsion
a5890e9ca145a8c1b6bec7b70047a43d9b1c29ea
[ "MIT" ]
38
2016-02-20T02:46:28.000Z
2021-11-17T11:39:57.000Z
code/wxWidgets/src/motif/colour.cpp
Dwarf-King/TorsionEditor
e6887d1661ebaf4ccbf1d09f2690e2bf805fbb50
[ "MIT" ]
17
2016-02-20T02:19:55.000Z
2021-02-08T15:15:17.000Z
code/wxWidgets/src/motif/colour.cpp
Dwarf-King/TorsionEditor
e6887d1661ebaf4ccbf1d09f2690e2bf805fbb50
[ "MIT" ]
46
2016-02-20T02:47:33.000Z
2021-01-31T15:46:05.000Z
///////////////////////////////////////////////////////////////////////////// // Name: colour.cpp // Purpose: wxColour class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id: colour.cpp,v 1.16 2005/02/06 17:38:29 MBN Exp $ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// //// TODO: make wxColour a ref-counted object, //// so pixel values get shared. #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "colour.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #include "wx/gdicmn.h" #include "wx/colour.h" #include "wx/app.h" #ifdef __VMS__ #pragma message disable nosimpint #endif #include <Xm/Xm.h> #ifdef __VMS__ #pragma message enable nosimpint #endif #include "wx/motif/private.h" IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject) // Colour void wxColour::Init() { m_isInit = false; m_red = m_blue = m_green = 0; m_pixel = -1; } wxColour::wxColour() { Init(); } wxColour::wxColour(const wxColour& col) { *this = col; } wxColour& wxColour::operator =(const wxColour& col) { m_red = col.m_red; m_green = col.m_green; m_blue = col.m_blue; m_isInit = col.m_isInit; m_pixel = col.m_pixel; return *this; } void wxColour::InitFromName(const wxString& name) { if ( wxTheColourDatabase ) { wxColour col = wxTheColourDatabase->Find(name); if ( col.Ok() ) { *this = col; return; } } // leave invalid Init(); } /* static */ wxColour wxColour::CreateByName(const wxString& name) { wxColour col; Display *dpy = wxGlobalDisplay(); WXColormap colormap = wxTheApp->GetMainColormap( dpy ); XColor xcol; if ( XParseColor( dpy, (Colormap)colormap, name.mb_str(), &xcol ) ) { col.m_red = xcol.red & 0xff; col.m_green = xcol.green & 0xff; col.m_blue = xcol.blue & 0xff; col.m_isInit = true; col.m_pixel = -1; } return col; } wxColour::~wxColour() { } void wxColour::Set(unsigned char r, unsigned char g, unsigned char b) { m_red = r; m_green = g; m_blue = b; m_isInit = true; m_pixel = -1; } // Allocate a colour, or nearest colour, using the given display. // If realloc is true, ignore the existing pixel, otherwise just return // the existing one. // Returns the old or allocated pixel. // TODO: can this handle mono displays? If not, we should have an extra // flag to specify whether this should be black or white by default. int wxColour::AllocColour(WXDisplay* display, bool realloc) { if ((m_pixel != -1) && !realloc) return m_pixel; XColor color; color.red = (unsigned short) Red (); color.red |= color.red << 8; color.green = (unsigned short) Green (); color.green |= color.green << 8; color.blue = (unsigned short) Blue (); color.blue |= color.blue << 8; color.flags = DoRed | DoGreen | DoBlue; WXColormap cmap = wxTheApp->GetMainColormap(display); if (!XAllocColor ((Display*) display, (Colormap) cmap, &color)) { m_pixel = wxGetBestMatchingPixel((Display*) display, &color,(Colormap) cmap); return m_pixel; } else { m_pixel = (int) color.pixel; return m_pixel; } } /*------------------------------------------- Markus Emmenegger <mege@iqe.ethz.ch> Find the pixel value with an assigned color closest to the desired color Used if color cell allocation fails As the returned pixel value may be in use by another application, the color might change anytime. But in many cases, that is still better than always using black. -- Chris Breeze <chris@hel.co.uk> Improvements: 1) More efficient calculation of RGB distance of colour cell from the desired colour. There is no need to take the sqrt of 'dist', and since we are only interested in the top 8-bits of R, G and B we can perform integer arithmetic. 2) Attempt to allocate a read-only colour when a close match is found. A read-only colour will not change. 3) Fall back to the closest match if no read-only colours are available. Possible further improvements: 1) Scan the lookup table and sort the colour cells in order of increasing distance from the desired colour. Then attempt to allocate a read-only colour starting from the nearest match. 2) Linear RGB distance is not a particularly good method of colour matching (though it is quick). Converting the colour to HLS and then comparing may give better matching. -------------------------------------------*/ int wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap) { if (cmap == (Colormap) NULL) cmap = (Colormap) wxTheApp->GetMainColormap(display); int numPixVals = XDisplayCells(display, DefaultScreen (display)); int mindist = 256 * 256 * 3; int bestpixel = (int) BlackPixel (display, DefaultScreen (display)); int red = desiredColor->red >> 8; int green = desiredColor->green >> 8; int blue = desiredColor->blue >> 8; const int threshold = 2 * 2 * 3; // allow an error of up to 2 in R,G & B for (int pixelcount = 0; pixelcount < numPixVals; pixelcount++) { XColor matching_color; matching_color.pixel = pixelcount; XQueryColor(display,cmap,&matching_color); int delta_red = red - (matching_color.red >> 8); int delta_green = green - (matching_color.green >> 8); int delta_blue = blue - (matching_color.blue >> 8); int dist = delta_red * delta_red + delta_green * delta_green + delta_blue * delta_blue; if (dist <= threshold) { // try to allocate a read-only colour... if (XAllocColor (display, cmap, &matching_color)) { return matching_color.pixel; } } if (dist < mindist) { bestpixel = pixelcount; mindist = dist; } } return bestpixel; }
26.890351
85
0.619801
Bloodknight
d4f93502df57adfce487eed90f94adcbcd31da73
44,682
cpp
C++
avocadod/Replication/InitialSyncer.cpp
jjzhang166/avocadodb
948d94592c10731857c8617b133bda840b8e833e
[ "BSL-1.0", "Zlib", "Apache-2.0" ]
null
null
null
avocadod/Replication/InitialSyncer.cpp
jjzhang166/avocadodb
948d94592c10731857c8617b133bda840b8e833e
[ "BSL-1.0", "Zlib", "Apache-2.0" ]
null
null
null
avocadod/Replication/InitialSyncer.cpp
jjzhang166/avocadodb
948d94592c10731857c8617b133bda840b8e833e
[ "BSL-1.0", "Zlib", "Apache-2.0" ]
null
null
null
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Jan Steemann //////////////////////////////////////////////////////////////////////////////// #include "InitialSyncer.h" #include "ApplicationFeatures/ApplicationServer.h" #include "Basics/Exceptions.h" #include "Basics/ReadLocker.h" #include "Basics/Result.h" #include "Basics/RocksDBUtils.h" #include "Basics/StaticStrings.h" #include "Basics/StringUtils.h" #include "Basics/VelocyPackHelper.h" #include "Indexes/Index.h" #include "Indexes/IndexIterator.h" #include "Logger/Logger.h" #include "RestServer/DatabaseFeature.h" #include "SimpleHttpClient/SimpleHttpClient.h" #include "SimpleHttpClient/SimpleHttpResult.h" #include "StorageEngine/EngineSelectorFeature.h" #include "StorageEngine/PhysicalCollection.h" #include "StorageEngine/StorageEngine.h" #include "Transaction/Helpers.h" #include "Utils/CollectionGuard.h" #include "Utils/OperationOptions.h" #include "VocBase/LogicalCollection.h" #include "VocBase/ManagedDocumentResult.h" #include "VocBase/voc-types.h" #include "VocBase/vocbase.h" #include <velocypack/Builder.h> #include <velocypack/Iterator.h> #include <velocypack/Slice.h> #include <velocypack/velocypack-aliases.h> #include <cstring> using namespace avocadodb; using namespace avocadodb::basics; using namespace avocadodb::httpclient; using namespace avocadodb::rest; using namespace avocadodb::rocksutils; size_t const InitialSyncer::MaxChunkSize = 10 * 1024 * 1024; InitialSyncer::InitialSyncer( TRI_vocbase_t* vocbase, TRI_replication_applier_configuration_t const* configuration, std::unordered_map<std::string, bool> const& restrictCollections, std::string const& restrictType, bool verbose, bool skipCreateDrop) : Syncer(vocbase, configuration), _progress("not started"), _restrictCollections(restrictCollections), _restrictType(restrictType), _processedCollections(), _batchId(0), _batchUpdateTime(0), _batchTtl(180), _includeSystem(false), _chunkSize(configuration->_chunkSize), _verbose(verbose), _hasFlushed(false), _skipCreateDrop(skipCreateDrop) { if (_chunkSize == 0) { _chunkSize = (uint64_t)2 * 1024 * 1024; // 2 mb } else if (_chunkSize < 128 * 1024) { _chunkSize = 128 * 1024; } _includeSystem = configuration->_includeSystem; } InitialSyncer::~InitialSyncer() { try { sendFinishBatch(); } catch (...) { } } //////////////////////////////////////////////////////////////////////////////// /// @brief run method, performs a full synchronization //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::run(std::string& errorMsg, bool incremental) { if (_client == nullptr || _connection == nullptr || _endpoint == nullptr) { errorMsg = "invalid endpoint"; return TRI_ERROR_INTERNAL; } int res = _vocbase->replicationApplier()->preventStart(); if (res != TRI_ERROR_NO_ERROR) { return res; } TRI_DEFER(_vocbase->replicationApplier()->allowStart()); try { setProgress("fetching master state"); LOG_TOPIC(DEBUG, Logger::REPLICATION) << "client: getting master state"; res = getMasterState(errorMsg); if (res != TRI_ERROR_NO_ERROR) { LOG_TOPIC(DEBUG, Logger::REPLICATION) << "client: got master state: " << res << " " << errorMsg; return res; } LOG_TOPIC(DEBUG, Logger::REPLICATION) << "client: got master state: " << res << " " << errorMsg; if (incremental) { if (_masterInfo._majorVersion == 1 || (_masterInfo._majorVersion == 2 && _masterInfo._minorVersion <= 6)) { LOG_TOPIC(WARN, Logger::REPLICATION) << "incremental replication is " "not supported with a master < " "AvocadoDB 2.7"; incremental = false; } } if (incremental) { res = sendFlush(errorMsg); if (res != TRI_ERROR_NO_ERROR) { return res; } } // create a WAL logfile barrier that prevents WAL logfile collection sendCreateBarrier(errorMsg, _masterInfo._lastLogTick); res = sendStartBatch(errorMsg); if (res != TRI_ERROR_NO_ERROR) { return res; } std::string url = BaseUrl + "/inventory?serverId=" + _localServerIdString + "&batchId=" + std::to_string(_batchId); if (_includeSystem) { url += "&includeSystem=true"; } // send request std::string const progress = "fetching master inventory from " + url; setProgress(progress); std::unique_ptr<SimpleHttpResult> response( _client->retryRequest(rest::RequestType::GET, url, nullptr, 0)); if (response == nullptr || !response->isComplete()) { errorMsg = "could not connect to master at " + _masterInfo._endpoint + ": " + _client->getErrorMessage(); sendFinishBatch(); return TRI_ERROR_REPLICATION_NO_RESPONSE; } TRI_ASSERT(response != nullptr); if (response->wasHttpError()) { res = TRI_ERROR_REPLICATION_MASTER_ERROR; errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": HTTP " + StringUtils::itoa(response->getHttpReturnCode()) + ": " + response->getHttpReturnMessage(); } else { auto builder = std::make_shared<VPackBuilder>(); res = parseResponse(builder, response.get()); if (res != TRI_ERROR_NO_ERROR) { errorMsg = "got invalid response from master at " + std::string(_masterInfo._endpoint) + ": invalid response type for initial data. expecting array"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } VPackSlice const slice = builder->slice(); if (!slice.isObject()) { LOG_TOPIC(DEBUG, Logger::REPLICATION) << "client: InitialSyncer::run - " "inventoryResponse is not an " "object"; res = TRI_ERROR_REPLICATION_INVALID_RESPONSE; errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": invalid JSON"; } else { auto pair = stripObjectIds(slice); res = handleInventoryResponse(pair.first, incremental, errorMsg); } } sendFinishBatch(); if (res != TRI_ERROR_NO_ERROR && errorMsg.empty()) { errorMsg = TRI_errno_string(res); } return res; } catch (avocadodb::basics::Exception const& ex) { sendFinishBatch(); errorMsg = ex.what(); return ex.code(); } catch (std::exception const& ex) { sendFinishBatch(); errorMsg = ex.what(); return TRI_ERROR_INTERNAL; } catch (...) { sendFinishBatch(); errorMsg = "an unknown exception occurred"; return TRI_ERROR_NO_ERROR; } } //////////////////////////////////////////////////////////////////////////////// /// @brief send a WAL flush command //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::sendFlush(std::string& errorMsg) { std::string const url = "/_admin/wal/flush"; std::string const body = "{\"waitForSync\":true,\"waitForCollector\":true," "\"waitForCollectorQueue\":true}"; // send request std::string const progress = "send WAL flush command to url " + url; setProgress(progress); std::unique_ptr<SimpleHttpResult> response(_client->retryRequest( rest::RequestType::PUT, url, body.c_str(), body.size())); if (response == nullptr || !response->isComplete()) { errorMsg = "could not connect to master at " + _masterInfo._endpoint + ": " + _client->getErrorMessage(); return TRI_ERROR_REPLICATION_NO_RESPONSE; } TRI_ASSERT(response != nullptr); if (response->wasHttpError()) { int res = TRI_ERROR_REPLICATION_MASTER_ERROR; errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": HTTP " + StringUtils::itoa(response->getHttpReturnCode()) + ": " + response->getHttpReturnMessage(); return res; } _hasFlushed = true; return TRI_ERROR_NO_ERROR; } //////////////////////////////////////////////////////////////////////////////// /// @brief send a "start batch" command //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::sendStartBatch(std::string& errorMsg) { _batchId = 0; std::string const url = BaseUrl + "/batch" + "?serverId=" + _localServerIdString; std::string const body = "{\"ttl\":" + StringUtils::itoa(_batchTtl) + "}"; // send request std::string const progress = "send batch start command to url " + url; setProgress(progress); std::unique_ptr<SimpleHttpResult> response(_client->retryRequest( rest::RequestType::POST, url, body.c_str(), body.size())); if (response == nullptr || !response->isComplete()) { errorMsg = "could not connect to master at " + _masterInfo._endpoint + ": " + _client->getErrorMessage(); return TRI_ERROR_REPLICATION_NO_RESPONSE; } TRI_ASSERT(response != nullptr); if (response->wasHttpError()) { return TRI_ERROR_REPLICATION_MASTER_ERROR; } auto builder = std::make_shared<VPackBuilder>(); int res = parseResponse(builder, response.get()); if (res != TRI_ERROR_NO_ERROR) { return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } VPackSlice const slice = builder->slice(); if (!slice.isObject()) { return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } std::string const id = VelocyPackHelper::getStringValue(slice, "id", ""); if (id.empty()) { return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } _batchId = StringUtils::uint64(id); _batchUpdateTime = TRI_microtime(); return TRI_ERROR_NO_ERROR; } //////////////////////////////////////////////////////////////////////////////// /// @brief send an "extend batch" command //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::sendExtendBatch() { if (_batchId == 0) { return TRI_ERROR_NO_ERROR; } double now = TRI_microtime(); if (now <= _batchUpdateTime + _batchTtl - 60.0) { // no need to extend the batch yet return TRI_ERROR_NO_ERROR; } std::string const url = BaseUrl + "/batch/" + StringUtils::itoa(_batchId) + "?serverId=" + _localServerIdString; std::string const body = "{\"ttl\":" + StringUtils::itoa(_batchTtl) + "}"; // send request std::string const progress = "send batch extend command to url " + url; setProgress(progress); std::unique_ptr<SimpleHttpResult> response( _client->request(rest::RequestType::PUT, url, body.c_str(), body.size())); if (response == nullptr || !response->isComplete()) { return TRI_ERROR_REPLICATION_NO_RESPONSE; } TRI_ASSERT(response != nullptr); int res = TRI_ERROR_NO_ERROR; if (response->wasHttpError()) { res = TRI_ERROR_REPLICATION_MASTER_ERROR; } else { _batchUpdateTime = TRI_microtime(); } return res; } //////////////////////////////////////////////////////////////////////////////// /// @brief send a "finish batch" command //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::sendFinishBatch() { if (_batchId == 0) { return TRI_ERROR_NO_ERROR; } try { std::string const url = BaseUrl + "/batch/" + StringUtils::itoa(_batchId) + "?serverId=" + _localServerIdString; // send request std::string const progress = "send batch finish command to url " + url; setProgress(progress); std::unique_ptr<SimpleHttpResult> response( _client->retryRequest(rest::RequestType::DELETE_REQ, url, nullptr, 0)); if (response == nullptr || !response->isComplete()) { return TRI_ERROR_REPLICATION_NO_RESPONSE; } TRI_ASSERT(response != nullptr); int res = TRI_ERROR_NO_ERROR; if (response->wasHttpError()) { res = TRI_ERROR_REPLICATION_MASTER_ERROR; } else { _batchId = 0; _batchUpdateTime = 0; } return res; } catch (...) { return TRI_ERROR_INTERNAL; } } //////////////////////////////////////////////////////////////////////////////// /// @brief check whether the initial synchronization should be aborted //////////////////////////////////////////////////////////////////////////////// bool InitialSyncer::checkAborted() { if (application_features::ApplicationServer::isStopping() || (_vocbase->replicationApplier() != nullptr && _vocbase->replicationApplier()->stopInitialSynchronization())) { return true; } return false; } //////////////////////////////////////////////////////////////////////////////// /// @brief apply the data from a collection dump //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::applyCollectionDump(transaction::Methods& trx, std::string const& collectionName, SimpleHttpResult* response, uint64_t& markersProcessed, std::string& errorMsg) { std::string const invalidMsg = "received invalid JSON data for collection " + collectionName; StringBuffer& data = response->getBody(); char const* p = data.begin(); char const* end = p + data.length(); // buffer must end with a NUL byte TRI_ASSERT(*end == '\0'); auto builder = std::make_shared<VPackBuilder>(); while (p < end) { char const* q = strchr(p, '\n'); if (q == nullptr) { q = end; } if (q - p < 2) { // we are done return TRI_ERROR_NO_ERROR; } TRI_ASSERT(q <= end); try { builder->clear(); VPackParser parser(builder); parser.parse(p, static_cast<size_t>(q - p)); } catch (...) { // TODO: improve error reporting return TRI_ERROR_OUT_OF_MEMORY; } p = q + 1; VPackSlice const slice = builder->slice(); if (!slice.isObject()) { errorMsg = invalidMsg; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } TRI_replication_operation_e type = REPLICATION_INVALID; std::string key; std::string rev; VPackSlice doc; for (auto const& it : VPackObjectIterator(slice)) { std::string const attributeName(it.key.copyString()); if (attributeName == "type") { if (it.value.isNumber()) { type = static_cast<TRI_replication_operation_e>( it.value.getNumber<int>()); } } else if (attributeName == "data") { if (it.value.isObject()) { doc = it.value; } } } if (!doc.isNone()) { VPackSlice value = doc.get(StaticStrings::KeyString); if (value.isString()) { key = value.copyString(); } value = doc.get(StaticStrings::RevString); if (value.isString()) { rev = value.copyString(); } } // key must not be empty, but doc can be empty if (key.empty()) { errorMsg = invalidMsg; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } ++markersProcessed; VPackBuilder oldBuilder; oldBuilder.openObject(); oldBuilder.add(StaticStrings::KeyString, VPackValue(key)); if (!rev.empty()) { oldBuilder.add(StaticStrings::RevString, VPackValue(rev)); } oldBuilder.close(); VPackSlice const old = oldBuilder.slice(); int res = applyCollectionDumpMarker(trx, collectionName, type, old, doc, errorMsg); if (res != TRI_ERROR_NO_ERROR) { return res; } } // reached the end return TRI_ERROR_NO_ERROR; } //////////////////////////////////////////////////////////////////////////////// /// @brief incrementally fetch data from a collection //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::handleCollectionDump(avocadodb::LogicalCollection* col, std::string const& cid, std::string const& collectionName, TRI_voc_tick_t maxTick, std::string& errorMsg) { std::string appendix; if (_hasFlushed) { appendix = "&flush=false"; } else { // only flush WAL once appendix = "&flush=true&flushWait=15"; _hasFlushed = true; } uint64_t chunkSize = _chunkSize; TRI_ASSERT(_batchId); // should not be equal to 0 std::string const baseUrl = BaseUrl + "/dump?collection=" + cid + "&batchId=" + std::to_string(_batchId) + appendix; TRI_voc_tick_t fromTick = 0; int batch = 1; uint64_t bytesReceived = 0; uint64_t markersProcessed = 0; while (true) { if (checkAborted()) { return TRI_ERROR_REPLICATION_APPLIER_STOPPED; } sendExtendBatch(); sendExtendBarrier(); std::string url = baseUrl + "&from=" + StringUtils::itoa(fromTick); if (maxTick > 0) { url += "&to=" + StringUtils::itoa(maxTick + 1); } url += "&serverId=" + _localServerIdString; url += "&chunkSize=" + StringUtils::itoa(chunkSize); url += "&includeSystem=" + std::string(_includeSystem ? "true" : "false"); std::string const typeString = (col->type() == TRI_COL_TYPE_EDGE ? "edge" : "document"); // send request std::string const progress = "fetching master collection dump for collection '" + collectionName + "', type: " + typeString + ", id " + cid + ", batch " + StringUtils::itoa(batch) + ", markers processed: " + StringUtils::itoa(markersProcessed) + ", bytes received: " + StringUtils::itoa(bytesReceived); setProgress(progress); // use async mode for first batch auto headers = createHeaders(); if (batch == 1) { headers["X-Avocado-Async"] = "store"; } std::unique_ptr<SimpleHttpResult> response(_client->retryRequest( rest::RequestType::GET, url, nullptr, 0, headers)); if (response == nullptr || !response->isComplete()) { errorMsg = "could not connect to master at " + _masterInfo._endpoint + ": " + _client->getErrorMessage(); return TRI_ERROR_REPLICATION_NO_RESPONSE; } TRI_ASSERT(response != nullptr); if (response->wasHttpError()) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": HTTP " + StringUtils::itoa(response->getHttpReturnCode()) + ": " + response->getHttpReturnMessage(); return TRI_ERROR_REPLICATION_MASTER_ERROR; } // use async mode for first batch if (batch == 1) { bool found = false; std::string jobId = response->getHeaderField(StaticStrings::AsyncId, found); if (!found) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": could not find 'X-Avocado-Async' header"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } double const startTime = TRI_microtime(); // wait until we get a responsable response while (true) { sendExtendBatch(); sendExtendBarrier(); std::string const jobUrl = "/_api/job/" + jobId; response.reset( _client->request(rest::RequestType::PUT, jobUrl, nullptr, 0)); if (response != nullptr && response->isComplete()) { if (response->hasHeaderField("x-avocado-async-id")) { // got the actual response break; } if (response->getHttpReturnCode() == 404) { // unknown job, we can abort errorMsg = "job not found on master at " + _masterInfo._endpoint; return TRI_ERROR_REPLICATION_NO_RESPONSE; } } double waitTime = TRI_microtime() - startTime; if (static_cast<uint64_t>(waitTime * 1000.0 * 1000.0) >= _configuration._initialSyncMaxWaitTime) { errorMsg = "timed out waiting for response from master at " + _masterInfo._endpoint; return TRI_ERROR_REPLICATION_NO_RESPONSE; } double sleepTime; if (waitTime < 5.0) { sleepTime = 0.25; } else if (waitTime < 20.0) { sleepTime = 0.5; } else if (waitTime < 60.0) { sleepTime = 1.0; } else { sleepTime = 2.0; } if (checkAborted()) { return TRI_ERROR_REPLICATION_APPLIER_STOPPED; } this->sleep(static_cast<uint64_t>(sleepTime * 1000.0 * 1000.0)); } // fallthrough here in case everything went well } if (response->hasContentLength()) { bytesReceived += response->getContentLength(); } Result res; bool checkMore = false; bool found; TRI_voc_tick_t tick; std::string header = response->getHeaderField(TRI_REPLICATION_HEADER_CHECKMORE, found); if (found) { checkMore = StringUtils::boolean(header); res = TRI_ERROR_NO_ERROR; if (checkMore) { header = response->getHeaderField(TRI_REPLICATION_HEADER_LASTINCLUDED, found); if (found) { tick = StringUtils::uint64(header); if (tick > fromTick) { fromTick = tick; } else { // we got the same tick again, this indicates we're at the end checkMore = false; } } } } if (!found) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": required header is missing"; res.reset(TRI_ERROR_REPLICATION_INVALID_RESPONSE, errorMsg); } if (res.ok()) { SingleCollectionTransaction trx( transaction::StandaloneContext::Create(_vocbase), col->cid(), AccessMode::Type::EXCLUSIVE); res = trx.begin(); if (!res.ok()) { errorMsg = std::string("unable to start transaction (") + std::string(__FILE__) + std::string(":") + std::to_string(__LINE__) + std::string("): ") + res.errorMessage(); res.reset(res.errorNumber(), errorMsg); return res.errorNumber(); } trx.pinData(col->cid()); // will throw when it fails if (res.ok()) { res = applyCollectionDump(trx, collectionName, response.get(), markersProcessed, errorMsg); res = trx.finish(res.errorNumber()); } } if (!res.ok()) { return res.errorNumber(); } if (!checkMore || fromTick == 0) { // done return res.errorNumber(); } // increase chunk size for next fetch if (chunkSize < MaxChunkSize) { chunkSize = static_cast<uint64_t>(chunkSize * 1.5); if (chunkSize > MaxChunkSize) { chunkSize = MaxChunkSize; } } batch++; } TRI_ASSERT(false); return TRI_ERROR_INTERNAL; } //////////////////////////////////////////////////////////////////////////////// /// @brief incrementally fetch data from a collection //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::handleCollectionSync(avocadodb::LogicalCollection* col, std::string const& cid, std::string const& collectionName, TRI_voc_tick_t maxTick, std::string& errorMsg) { sendExtendBatch(); sendExtendBarrier(); std::string const baseUrl = BaseUrl + "/keys"; std::string url = baseUrl + "?collection=" + cid + "&to=" + std::to_string(maxTick) + "&batchId=" + std::to_string(_batchId); std::string progress = "fetching collection keys for collection '" + collectionName + "' from " + url; setProgress(progress); // send an initial async request to collect the collection keys on the other // side // sending this request in a blocking fashion may require very long to // complete, // so we're sending the x-avocado-async header here auto headers = createHeaders(); headers["X-Avocado-Async"] = "store"; std::unique_ptr<SimpleHttpResult> response( _client->retryRequest(rest::RequestType::POST, url, nullptr, 0, headers)); if (response == nullptr || !response->isComplete()) { errorMsg = "could not connect to master at " + _masterInfo._endpoint + ": " + _client->getErrorMessage(); return TRI_ERROR_REPLICATION_NO_RESPONSE; } TRI_ASSERT(response != nullptr); if (response->wasHttpError()) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": HTTP " + StringUtils::itoa(response->getHttpReturnCode()) + ": " + response->getHttpReturnMessage(); return TRI_ERROR_REPLICATION_MASTER_ERROR; } bool found = false; std::string jobId = response->getHeaderField(StaticStrings::AsyncId, found); if (!found) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": could not find 'X-Avocado-Async' header"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } double const startTime = TRI_microtime(); while (true) { sendExtendBatch(); sendExtendBarrier(); std::string const jobUrl = "/_api/job/" + jobId; response.reset( _client->request(rest::RequestType::PUT, jobUrl, nullptr, 0)); if (response != nullptr && response->isComplete()) { if (response->hasHeaderField("x-avocado-async-id")) { // job is done, got the actual response break; } if (response->getHttpReturnCode() == 404) { // unknown job, we can abort errorMsg = "job not found on master at " + _masterInfo._endpoint; return TRI_ERROR_REPLICATION_NO_RESPONSE; } } double waitTime = TRI_microtime() - startTime; if (static_cast<uint64_t>(waitTime * 1000.0 * 1000.0) >= _configuration._initialSyncMaxWaitTime) { errorMsg = "timed out waiting for response from master at " + _masterInfo._endpoint; return TRI_ERROR_REPLICATION_NO_RESPONSE; } double sleepTime; if (waitTime < 5.0) { sleepTime = 0.25; } else if (waitTime < 20.0) { sleepTime = 0.5; } else if (waitTime < 60.0) { sleepTime = 1.0; } else { sleepTime = 2.0; } if (checkAborted()) { return TRI_ERROR_REPLICATION_APPLIER_STOPPED; } this->sleep(static_cast<uint64_t>(sleepTime * 1000.0 * 1000.0)); } auto builder = std::make_shared<VPackBuilder>(); int res = parseResponse(builder, response.get()); if (res != TRI_ERROR_NO_ERROR) { errorMsg = "got invalid response from master at " + std::string(_masterInfo._endpoint) + ": response is no object"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } VPackSlice const slice = builder->slice(); if (!slice.isObject()) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": response is no object"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } VPackSlice const id = slice.get("id"); if (!id.isString()) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": response does not contain valid 'id' attribute"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } auto shutdown = [&]() -> void { url = baseUrl + "/" + id.copyString(); std::string progress = "deleting remote collection keys object for collection '" + collectionName + "' from " + url; setProgress(progress); // now delete the keys we ordered std::unique_ptr<SimpleHttpResult> response( _client->retryRequest(rest::RequestType::DELETE_REQ, url, nullptr, 0)); }; TRI_DEFER(shutdown()); VPackSlice const count = slice.get("count"); if (!count.isNumber()) { errorMsg = "got invalid response from master at " + _masterInfo._endpoint + ": response does not contain valid 'count' attribute"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } if (count.getNumber<size_t>() <= 0) { // remote collection has no documents. now truncate our local collection SingleCollectionTransaction trx( transaction::StandaloneContext::Create(_vocbase), col->cid(), AccessMode::Type::EXCLUSIVE); Result res = trx.begin(); if (!res.ok()) { errorMsg = std::string("unable to start transaction (") + std::string(__FILE__) + std::string(":") + std::to_string(__LINE__) + std::string("): ") + res.errorMessage(); res.reset(res.errorNumber(), errorMsg); return res.errorNumber(); } OperationOptions options; if (!_leaderId.empty()) { options.isSynchronousReplicationFrom = _leaderId; } OperationResult opRes = trx.truncate(collectionName, options); if (!opRes.successful()) { errorMsg = "unable to truncate collection '" + collectionName + "': " + TRI_errno_string(opRes.code); return opRes.code; } res = trx.finish(opRes.code); return res.errorNumber(); } // now we can fetch the complete chunk information from the master try { res = EngineSelectorFeature::ENGINE->handleSyncKeys( *this, col, id.copyString(), cid, collectionName, maxTick, errorMsg); } catch (avocadodb::basics::Exception const& ex) { res = ex.code(); } catch (std::exception const& ex) { errorMsg = ex.what(); res = TRI_ERROR_INTERNAL; } catch (...) { res = TRI_ERROR_INTERNAL; } return res; } //////////////////////////////////////////////////////////////////////////////// /// @brief incrementally fetch data from a collection //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @brief changes the properties of a collection, based on the VelocyPack /// provided //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::changeCollection(avocadodb::LogicalCollection* col, VPackSlice const& slice) { avocadodb::CollectionGuard guard(_vocbase, col->cid()); bool doSync = application_features::ApplicationServer::getFeature<DatabaseFeature>( "Database") ->forceSyncProperties(); return guard.collection()->updateProperties(slice, doSync).errorNumber(); } //////////////////////////////////////////////////////////////////////////////// /// @brief determine the number of documents in a collection //////////////////////////////////////////////////////////////////////////////// int64_t InitialSyncer::getSize(avocadodb::LogicalCollection* col) { SingleCollectionTransaction trx( transaction::StandaloneContext::Create(_vocbase), col->cid(), AccessMode::Type::READ); Result res = trx.begin(); if (!res.ok()) { return -1; } auto document = trx.documentCollection(); return static_cast<int64_t>(document->numberDocuments(&trx)); } //////////////////////////////////////////////////////////////////////////////// /// @brief handle the information about a collection //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::handleCollection(VPackSlice const& parameters, VPackSlice const& indexes, bool incremental, std::string& errorMsg, sync_phase_e phase) { if (checkAborted()) { return TRI_ERROR_REPLICATION_APPLIER_STOPPED; } if (!parameters.isObject() || !indexes.isArray()) { return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } sendExtendBatch(); sendExtendBarrier(); std::string const masterName = VelocyPackHelper::getStringValue(parameters, "name", ""); TRI_voc_cid_t const cid = VelocyPackHelper::extractIdValue(parameters); if (cid == 0) { errorMsg = "collection id is missing in response"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } VPackSlice const type = parameters.get("type"); if (!type.isNumber()) { errorMsg = "collection type is missing in response"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } std::string const typeString = (type.getNumber<int>() == 3 ? "edge" : "document"); std::string const collectionMsg = "collection '" + masterName + "', type " + typeString + ", id " + StringUtils::itoa(cid); // phase handling if (phase == PHASE_VALIDATE) { // validation phase just returns ok if we got here (aborts above if data is // invalid) _processedCollections.emplace(cid, masterName); return TRI_ERROR_NO_ERROR; } // drop and re-create collections locally // ------------------------------------------------------------------------------------- if (phase == PHASE_DROP_CREATE) { if (!incremental) { // first look up the collection by the cid avocadodb::LogicalCollection* col = getCollectionByIdOrName(cid, masterName); if (col != nullptr) { bool truncate = false; if (col->name() == TRI_COL_NAME_USERS) { // better not throw away the _users collection. otherwise it is gone // and this may be a problem if the // server crashes in-between. truncate = true; } if (truncate) { // system collection setProgress("truncating " + collectionMsg); SingleCollectionTransaction trx( transaction::StandaloneContext::Create(_vocbase), col->cid(), AccessMode::Type::EXCLUSIVE); Result res = trx.begin(); if (!res.ok()) { errorMsg = "unable to truncate " + collectionMsg + ": " + res.errorMessage(); res.reset(res.errorNumber(), errorMsg); return res.errorNumber(); } OperationOptions options; if (!_leaderId.empty()) { options.isSynchronousReplicationFrom = _leaderId; } OperationResult opRes = trx.truncate(col->name(), options); if (!opRes.successful()) { errorMsg = "unable to truncate " + collectionMsg + ": " + TRI_errno_string(opRes.code); return opRes.code; } res = trx.finish(opRes.code); if (!res.ok()) { errorMsg = "unable to truncate " + collectionMsg + ": " + res.errorMessage(); return res.errorNumber(); } } else { // regular collection if (_skipCreateDrop) { setProgress("dropping " + collectionMsg + " skipped because of configuration"); return TRI_ERROR_NO_ERROR; } setProgress("dropping " + collectionMsg); int res = _vocbase->dropCollection(col, true, -1.0); if (res != TRI_ERROR_NO_ERROR) { errorMsg = "unable to drop " + collectionMsg + ": " + TRI_errno_string(res); return res; } } } } avocadodb::LogicalCollection* col = nullptr; if (incremental) { col = getCollectionByIdOrName(cid, masterName); if (col != nullptr) { // collection is already present std::string const progress = "checking/changing parameters of " + collectionMsg; setProgress(progress.c_str()); return changeCollection(col, parameters); } } std::string progress = "creating " + collectionMsg; if (_skipCreateDrop) { progress += " skipped because of configuration"; setProgress(progress.c_str()); return TRI_ERROR_NO_ERROR; } setProgress(progress.c_str()); int res = createCollection(parameters, &col); if (res != TRI_ERROR_NO_ERROR) { errorMsg = "unable to create " + collectionMsg + ": " + TRI_errno_string(res); return res; } return TRI_ERROR_NO_ERROR; } // sync collection data // ------------------------------------------------------------------------------------- else if (phase == PHASE_DUMP) { std::string const progress = "dumping data for " + collectionMsg; setProgress(progress.c_str()); avocadodb::LogicalCollection* col = getCollectionByIdOrName(cid, masterName); if (col == nullptr) { errorMsg = "cannot dump: " + collectionMsg + " not found"; return TRI_ERROR_AVOCADO_COLLECTION_NOT_FOUND; } Result res; { READ_LOCKER(readLocker, _vocbase->_inventoryLock); if (incremental && getSize(col) > 0) { res = handleCollectionSync(col, StringUtils::itoa(cid), masterName, _masterInfo._lastLogTick, errorMsg); } else { res = handleCollectionDump(col, StringUtils::itoa(cid), masterName, _masterInfo._lastLogTick, errorMsg); } if (res.ok()) { // now create indexes TRI_ASSERT(indexes.isArray()); VPackValueLength const n = indexes.length(); if (n > 0) { sendExtendBatch(); sendExtendBarrier(); std::string const progress = "creating " + std::to_string(n) + " index(es) for " + collectionMsg; setProgress(progress); try { SingleCollectionTransaction trx( transaction::StandaloneContext::Create(_vocbase), col->cid(), AccessMode::Type::EXCLUSIVE); res = trx.begin(); if (!res.ok()) { errorMsg = std::string("unable to start transaction (") + std::string(__FILE__) + std::string(":") + std::to_string(__LINE__) + std::string("): ") + res.errorMessage(); res.reset(res.errorNumber(), errorMsg); return res.errorNumber(); } trx.pinData(col->cid()); // will throw when it fails LogicalCollection* document = trx.documentCollection(); TRI_ASSERT(document != nullptr); auto physical = document->getPhysical(); TRI_ASSERT(physical != nullptr); for (auto const& idxDef : VPackArrayIterator(indexes)) { std::shared_ptr<avocadodb::Index> idx; if (idxDef.isObject()) { VPackSlice const type = idxDef.get("type"); if (type.isString()) { std::string const progress = "creating index of type " + type.copyString() + " for " + collectionMsg; setProgress(progress); } } res = physical->restoreIndex(&trx, idxDef, idx); if (!res.ok()) { errorMsg = "could not create index: " + res.errorMessage(); res.reset(res.errorNumber(), errorMsg); break; } } res = trx.finish(res); } catch (avocadodb::basics::Exception const& ex) { res = ex.code(); } catch (...) { res = TRI_ERROR_INTERNAL; } } } } return res.errorNumber(); } // we won't get here TRI_ASSERT(false); return TRI_ERROR_INTERNAL; } //////////////////////////////////////////////////////////////////////////////// /// @brief handle the inventory response of the master //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::handleInventoryResponse(VPackSlice const& slice, bool incremental, std::string& errorMsg) { VPackSlice const data = slice.get("collections"); if (!data.isArray()) { errorMsg = "collections section is missing from response"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } std::vector<std::pair<VPackSlice, VPackSlice>> collections; for (auto const& it : VPackArrayIterator(data)) { if (!it.isObject()) { errorMsg = "collection declaration is invalid in response"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } VPackSlice const parameters = it.get("parameters"); if (!parameters.isObject()) { errorMsg = "collection parameters declaration is invalid in response"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } VPackSlice const indexes = it.get("indexes"); if (!indexes.isArray()) { errorMsg = "collection indexes declaration is invalid in response"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } std::string const masterName = VelocyPackHelper::getStringValue(parameters, "name", ""); if (masterName.empty()) { errorMsg = "collection name is missing in response"; return TRI_ERROR_REPLICATION_INVALID_RESPONSE; } if (TRI_ExcludeCollectionReplication(masterName.c_str(), _includeSystem)) { continue; } if (VelocyPackHelper::getBooleanValue(parameters, "deleted", false)) { // we don't care about deleted collections continue; } if (!_restrictType.empty()) { auto const it = _restrictCollections.find(masterName); bool found = (it != _restrictCollections.end()); if (_restrictType == "include" && !found) { // collection should not be included continue; } else if (_restrictType == "exclude" && found) { // collection should be excluded continue; } } collections.emplace_back(parameters, indexes); } int res; // STEP 1: validate collection declarations from master // ---------------------------------------------------------------------------------- // iterate over all collections from the master... res = iterateCollections(collections, incremental, errorMsg, PHASE_VALIDATE); if (res != TRI_ERROR_NO_ERROR) { return res; } // STEP 2: drop and re-create collections locally if they are also present on // the master // ------------------------------------------------------------------------------------ res = iterateCollections(collections, incremental, errorMsg, PHASE_DROP_CREATE); if (res != TRI_ERROR_NO_ERROR) { return res; } // STEP 3: sync collection data from master and create initial indexes // ---------------------------------------------------------------------------------- return iterateCollections(collections, incremental, errorMsg, PHASE_DUMP); } //////////////////////////////////////////////////////////////////////////////// /// @brief iterate over all collections from an array and apply an action //////////////////////////////////////////////////////////////////////////////// int InitialSyncer::iterateCollections( std::vector<std::pair<VPackSlice, VPackSlice>> const& collections, bool incremental, std::string& errorMsg, sync_phase_e phase) { std::string phaseMsg("starting phase " + translatePhase(phase) + " with " + std::to_string(collections.size()) + " collections"); setProgress(phaseMsg); for (auto const& collection : collections) { VPackSlice const parameters = collection.first; VPackSlice const indexes = collection.second; errorMsg = ""; int res = handleCollection(parameters, indexes, incremental, errorMsg, phase); if (res != TRI_ERROR_NO_ERROR) { return res; } } // all ok return TRI_ERROR_NO_ERROR; }
31.444053
182
0.573251
jjzhang166
d4fb7098083ee0f3440c9361171afbb35927a570
8,970
hpp
C++
dsa/include/dsa/list.hpp
Abstract-Everything/dsa
fcbc0f4fa1eb3493f0e1b8f05d7f159ea6f2342c
[ "Unlicense" ]
null
null
null
dsa/include/dsa/list.hpp
Abstract-Everything/dsa
fcbc0f4fa1eb3493f0e1b8f05d7f159ea6f2342c
[ "Unlicense" ]
null
null
null
dsa/include/dsa/list.hpp
Abstract-Everything/dsa
fcbc0f4fa1eb3493f0e1b8f05d7f159ea6f2342c
[ "Unlicense" ]
null
null
null
#ifndef DSA_LIST_HPP #define DSA_LIST_HPP #include <dsa/allocator_traits.hpp> #include <dsa/default_allocator.hpp> #include <dsa/node.hpp> #include <cstddef> #include <memory> namespace dsa { namespace detail { template<typename Satellite_t, template<typename> typename Allocator_Base> class List_Node { private: friend class Node_Traits<List_Node>; using Alloc_Traits = Allocator_Traits<Allocator_Base<List_Node>>; using Allocator = typename Alloc_Traits::Allocator; using Pointer = typename Alloc_Traits::Pointer; using Const_Pointer = typename Alloc_Traits::Const_Pointer; using Satellite_Alloc_Traits = Allocator_Traits<Allocator_Base<Satellite_t>>; using Satellite = typename Satellite_Alloc_Traits::Value; using Satellite_Pointer = typename Satellite_Alloc_Traits::Reference; using Satellite_Const_Pointer = typename Satellite_Alloc_Traits::Const_Reference; using Satellite_Reference = typename Satellite_Alloc_Traits::Reference; using Satellite_Const_Reference = typename Satellite_Alloc_Traits::Const_Reference; template<bool Is_Const> class Iterator_Detail { private: using Node_Pointer = std::conditional_t< Is_Const, typename List_Node::Const_Pointer, typename List_Node::Pointer>; using Pointer = std::conditional_t< Is_Const, typename List_Node::Satellite_Const_Pointer, typename List_Node::Satellite_Pointer>; using Reference = std::conditional_t< Is_Const, typename List_Node::Satellite_Const_Reference, typename List_Node::Satellite_Reference>; public: explicit Iterator_Detail(Node_Pointer node) : m_node(node) { } Iterator_Detail operator++() { m_node = m_node->m_next; Iterator_Detail iterator(m_node); return iterator; } bool operator==(Iterator_Detail const &iterator) const { return m_node == iterator.m_node; } bool operator!=(Iterator_Detail const &iterator) const { return !this->operator==(iterator); } Reference operator*() const { return m_node->m_satellite; } Pointer operator->() const { return m_node->m_satellite; } private: Node_Pointer m_node; }; public: using Iterator = Iterator_Detail<false>; using Const_Iterator = Iterator_Detail<true>; Satellite m_satellite; Pointer m_next; void initialise() { m_next = nullptr; } }; } // namespace detail // ToDo: Use iterators to make insertion/ deletion constant time /** * @brief Holds a set of non contigious elements in a singly linked list. * * @ingroup containers * * @tparam Value_t: The type of element to store * @tparam Pointer_Base: The type of pointer used to refer to memory * @tparam Allocator_Base: The type of allocator used for memory management * */ template<typename Value_t, template<typename> typename Allocator_Base = Default_Allocator> class List { private: using Node = detail::List_Node<Value_t, Allocator_Base>; using Node_Traits = detail::Node_Traits<Node>; using Node_Allocator = typename Node_Traits::Allocator; using Node_Pointer = typename Node_Traits::Pointer; using Node_Const_Pointer = typename Node_Traits::Const_Pointer; using Alloc_Traits = Allocator_Traits<Allocator_Base<Value_t>>; public: using Allocator = typename Alloc_Traits::Allocator; using Value = typename Alloc_Traits::Value; using Pointer = typename Alloc_Traits::Pointer; using Const_Pointer = typename Alloc_Traits::Const_Pointer; using Iterator = typename Node::Iterator; using Const_Iterator = typename Node::Const_Iterator; /** * @brief Constructs an empty list */ explicit List(const Allocator &allocator = Allocator{}) : m_allocator(allocator) { } /** * @brief Constructs a list filled with the given values */ List( std::initializer_list<Value_t> values, const Allocator &allocator = Allocator()) : m_allocator(allocator) { Node_Pointer *next = &m_head; for (auto value : values) { Node_Pointer &to = *next; to = Node_Traits::create_node(m_allocator, value); next = &to->m_next; } } ~List() { clear(); } List(List const &list) : m_allocator(list.m_allocator) { Node_Pointer from = list.m_head; Node_Pointer *next = &m_head; while (from != nullptr) { Node_Pointer &to = *next; to = Node_Traits::create_node( m_allocator, from->m_satellite); next = &to->m_next; from = from->m_next; } } friend void swap(List &lhs, List &rhs) { using std::swap; swap(lhs.m_allocator, rhs.m_allocator); swap(lhs.m_head, rhs.m_head); } List(List &&list) noexcept : m_allocator(list.m_allocator) { swap(*this, list); } List &operator=(List list) noexcept { swap(*this, list); return *this; } [[nodiscard]] Iterator begin() { return Iterator(m_head); } [[nodiscard]] Const_Iterator begin() const { return Const_Iterator(m_head); } [[nodiscard]] Iterator end() { return Iterator(nullptr); } [[nodiscard]] Const_Iterator end() const { return Const_Iterator(nullptr); } [[nodiscard]] Value &operator[](std::size_t index) { return at(index)->m_satellite; } [[nodiscard]] const Value &operator[](std::size_t index) const { return at(index)->m_satellite; } /** * @brief Gets the number of elements currently in the list. * Note: This operation is not constant as the size is not cached */ [[nodiscard]] std::size_t size() const { std::size_t list_size = 0; Node_Pointer node = m_head; while (node != nullptr) { node = node->m_next; list_size++; } return list_size; } /** * @brief Gets the first element in the list. This is undefined * behaviour if the list is empty */ [[nodiscard]] Value &front() { return m_head->m_satellite; } /** * @brief Gets the first element in the list. This is undefined * behaviour if the list is empty */ [[nodiscard]] const Value &front() const { return m_head->m_satellite; } /** * @brief Returns true if the list contains no elements */ [[nodiscard]] bool empty() const { return m_head == nullptr; } /** * @brief Clears all elements from the list */ void clear() { Node_Pointer node = m_head; while (node != nullptr) { Node_Pointer next = node->m_next; Node_Traits::destroy_node(m_allocator, node); node = next; } m_head = nullptr; } /** * @brief Inserts the given value at the front of the list */ void prepend(Value value) { insert(0, std::move(value)); } /** * @brief Inserts the given value at the given index. The behaviour is * undefined if the index is outside of the range: [0, size()] */ void insert(std::size_t index, Value value) { Node_Pointer node = Node_Traits::create_node(m_allocator, std::move(value)); if (index == 0) { node->m_next = m_head; m_head = node; return; } Node_Pointer previous = at(index - 1); node->m_next = previous->m_next; previous->m_next = node; } /** * @brief Erases the value at the front of the list. The behaviour is * undefined if the list is empty */ void detatch_front() { erase(0); } /** * @brief Erases the value at the given index. The behaviour is * undefined if the index is outside of the list size. */ void erase(std::size_t index) { if (index == 0) { Node_Pointer remove = m_head; m_head = m_head->m_next; Node_Traits::destroy_node(m_allocator, remove); return; } Node_Pointer previous = at(index - 1); Node_Pointer remove = previous->m_next; previous->m_next = remove->m_next; Node_Traits::destroy_node(m_allocator, remove); } friend bool operator==(List const &lhs, List const &rhs) noexcept { Node_Pointer lhs_node = lhs.m_head; Node_Pointer rhs_node = rhs.m_head; while (lhs_node != nullptr && rhs_node != nullptr) { if (lhs_node->m_satellite != rhs_node->m_satellite) { return false; } lhs_node = lhs_node->m_next; rhs_node = rhs_node->m_next; } return lhs_node == nullptr && rhs_node == nullptr; } friend bool operator!=(List const &lhs, List const &rhs) noexcept { return !(lhs == rhs); } private: Node_Allocator m_allocator; Node_Pointer m_head = nullptr; /** * @brief Gets the node at the given index. The behaviour is undefined * if the index is outside of the list range */ Node_Pointer at(std::size_t index) { Node_Pointer node = m_head; for (std::size_t i = 0; i < index; ++i) { node = node->m_next; } return node; } /** * @brief Gets the node at the given index. The behaviour is undefined * if the index is outside of the list range */ Node_Const_Pointer at(std::size_t index) const { Node_Const_Pointer node = m_head; for (std::size_t i = 0; i < index; ++i) { node = node->m_next; } return node; } }; } // namespace dsa #endif
22.039312
90
0.676589
Abstract-Everything
be0245983274bff9a89bcd08c0d1c92801c36854
1,078
hpp
C++
api/hw/async_device.hpp
jaeh/IncludeOS
1cc2bcf36758ff5ef3099e0c0c1ee55f0bb1de02
[ "Apache-2.0" ]
3,673
2015-12-01T22:14:02.000Z
2019-03-22T03:07:20.000Z
api/hw/async_device.hpp
jaeh/IncludeOS
1cc2bcf36758ff5ef3099e0c0c1ee55f0bb1de02
[ "Apache-2.0" ]
960
2015-12-01T20:40:36.000Z
2019-03-22T13:21:21.000Z
api/hw/async_device.hpp
jaeh/IncludeOS
1cc2bcf36758ff5ef3099e0c0c1ee55f0bb1de02
[ "Apache-2.0" ]
357
2015-12-02T09:32:50.000Z
2019-03-22T09:32:34.000Z
#pragma once #include <kernel/events.hpp> #include <hw/usernet.hpp> #include <deque> namespace hw { template <typename Driver> class Async_device { public: using transmit_func = delegate<void(net::Packet_ptr)>; void connect(Async_device& other) { this->set_transmit({&other, &Async_device::receive}); } Async_device (Driver& nic) : m_nic(nic) { this->event_id = Events::get().subscribe( [this] { while(! queue.empty()) { this->driver_receive(std::move(queue.front())); queue.pop_front(); } this->m_nic.signal_tqa(); }); } void receive(net::Packet_ptr pckt) { queue.push_back(std::move(pckt)); Events::get().trigger_event(event_id); } void set_transmit(transmit_func func) { this->m_nic.set_transmit_forward(std::move(func)); } auto& nic() { return this->m_nic; } private: inline void driver_receive(net::Packet_ptr packet) { this->m_nic.receive(std::move(packet)); } Driver& m_nic; int event_id = 0; std::deque<net::Packet_ptr> queue; }; } // hw
20.339623
57
0.634508
jaeh
be0518e58275bdfe1937a19b1b9de2bc8fa5f8de
2,174
cpp
C++
leetcode/l5169.cpp
Victrid/Atlas
da25d50424790e571f29b66fc815245c1093798c
[ "MIT" ]
1
2020-01-19T16:00:07.000Z
2020-01-19T16:00:07.000Z
leetcode/l5169.cpp
Victrid/Atlas
da25d50424790e571f29b66fc815245c1093798c
[ "MIT" ]
null
null
null
leetcode/l5169.cpp
Victrid/Atlas
da25d50424790e571f29b66fc815245c1093798c
[ "MIT" ]
null
null
null
#include "lc.hpp" class Solution { public: struct Date { int year; int month; int day; Date(string a) { year = stoi(a.substr(0, 4)); month = stoi(a.substr(5, 2)); day = stoi(a.substr(8, 2)); } Date() {} }; int days(Date a, Date b) { int day1 = 0; Date temp; int monthdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; if ((a.year < b.year) || ((a.year == b.year) && (a.month < b.month)) || ((a.year == b.year) && (a.month == b.month) && (a.day < b.day))) { temp = a; a = b; b = temp; } if (a.year != b.year) { day1 += (a.year - b.year - 1) * 365; day1 += ((((a.year - 1) / 4) - ((a.year - 1) / 100) + ((a.year - 1) / 400)) - (((b.year - 1) / 4) - ((b.year - 1) / 100) + ((b.year - 1) / 400))); for (int i = b.month; i <= 12; i++) { day1 += monthdays[i - 1]; } day1 -= b.day; for (int i = a.month - 1; i >= 1; i--) { day1 += monthdays[i - 1]; } day1 += a.day; if (((b.year % 4 == 0 && b.year % 100 != 0) || (b.year % 400 == 0)) && (b.month > 2)) day1 -= 1; if (((a.year % 4 == 0 && a.year % 100 != 0) || (a.year % 400 == 0)) && (a.month > 2)) day1 += 1; } else { for (int i = b.month; i < a.month; i++) { day1 += monthdays[i - 1]; } day1 += a.day; day1 -= b.day; if (b.month == 2 && b.day == 29) day1++; if (((a.year % 4 == 0 && a.year % 100 != 0) || (a.year % 400 == 0)) && (b.month <= 2 && b.day != 29 && a.month > 2)) { day1++; } } return day1; } int daysBetweenDates(string date1, string date2) { Date d1(date1); Date d2(date2); return days(d1,d2); } }; int main(){ string a = "1972-02-10"; string b = "2020-11-07"; Solution Sol; cout << Sol.daysBetweenDates(a,b); return 0; }
32.447761
158
0.371665
Victrid
be07518bfce95bf1c817cc74f89b6d26f1ffcd22
35,659
cpp
C++
Interframe EZBC/EZBC0a/src/dwt_bitplane_dec_cxt_AC.cpp
Dongcunhui/Wavelet-Based-Learned-Scalable-Video-Coding
7142addafac9ce58e7e273b68bd0b83a01fc0ce4
[ "MIT" ]
1
2022-01-26T01:22:29.000Z
2022-01-26T01:22:29.000Z
Interframe EZBC/EZBC0a/src/dwt_bitplane_dec_cxt_AC.cpp
Dongcunhui/WL-SVC
7142addafac9ce58e7e273b68bd0b83a01fc0ce4
[ "MIT" ]
null
null
null
Interframe EZBC/EZBC0a/src/dwt_bitplane_dec_cxt_AC.cpp
Dongcunhui/WL-SVC
7142addafac9ce58e7e273b68bd0b83a01fc0ce4
[ "MIT" ]
null
null
null
/* ========================================================================= */ /* Description: menber functions for class DecSubband with contex modeling */ /* Author: Shih-Ta Hsiang */ /* Version: v0.a */ /* Last Revised: Aug. 15, 2000 */ /* ========================================================================= */ #include <math.h> #include <assert.h> #include <string.h> #include "dwt_bitplane_dec.h" //----------------------------------------------------------------------------- // decode_LIP_cxt_AC() //----------------------------------------------------------------------------- void DecSubband::decode_LIP_cxt_AC( ) { std_short r, c; std_int cur_coord; PEL_CXT_TYPE *cxt_sp; std_int *LIP_cur, *LIP_end, *LIP_old_end; std_int *LSP_end = node_list.LSP_end; // std_int *LSP = node_list.LSP; std_int *LIP = node_list.LIP; PEL_CXT_TYPE **base_cxt = cxt_qtree.base_cxt; std_short row_gap = base_cxt[1] - base_cxt[0]; MODEL_TYPE *LIP_models = cxt_qtree.cxt_models + cxt_qtree.LIP_offset; std_byte *cxt_tab = cxt_qtree.LIP_tab; //sign related data........ MODEL_TYPE *sign_models = cxt_qtree.cxt_models + cxt_qtree.sign_offset; SUB_COEFF_TYPE *sign_cxt_tab = cxt_qtree.sign_tab; SIGN_CXT_TYPE *sign_cxt_sp, **base_sign_cxt = cxt_qtree.base_sign_cxt; std_short sign_cxt_row_gap = base_sign_cxt[1] - base_sign_cxt[0]; SUB_COEFF_TYPE sign_predict, sign_bit; //interband related data #ifdef INTERBANDS int cd_base_cxt_row_gap; PEL_CXT_TYPE *cd_base_cxt_sp, **cd_base_cxt; NODE_CXT_TYPE *cd_cxt_node_sp, **cd_cxt_node; if( child_cxt_qtree ) { cd_base_cxt = child_cxt_qtree->base_cxt; cd_base_cxt_row_gap = cd_base_cxt[1] - cd_base_cxt[0]; cd_cxt_node = child_cxt_qtree->cxt_nodes[1]; } #endif #ifdef INITIALIZE_LIP_MODELS_FROM_PAR MODEL_TYPE *par_LIP_models; if( ( bit_idx == max_bit_idx - 1 ) && ( par_cxt_qtree ) ) { assert( cxt_qtree.LIP_cxts == par_cxt_qtree->LIP_cxts ); par_LIP_models = par_cxt_qtree->cxt_models + par_cxt_qtree->LIP_offset; for( int i = cxt_qtree.LIP_cxts - 1; i >= 0; LIP_models[i].reset( par_LIP_models[i] ), LIP_models[i--].taub_scale( ) ); } #endif LIP_cur = LIP_end = LIP + node_list.LIP_sz; LIP_old_end = node_list.LIP_end; while( LIP_cur != LIP_old_end ) { cur_coord = *( --LIP_cur ); r = cur_coord >> 16; c = cur_coord & 0xFFFF; cxt_sp = base_cxt[r] + c; if( sub_decoder->decode_symbol( LIP_models[cxt_tab[*cxt_sp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif if( ++LSP_end == LIP_old_end ) //LSP_pos runs beyond the end of the LSP *( LIP_cur++ ) = *( LIP_old_end++ ); *LSP_end = cur_coord; base_coeff[r][c] |= bit_idx_mask; UPDATE_CXT( cxt_sp, row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_base_cxt_sp = cd_base_cxt[r << 1] + ( c << 1 ); UPDATE_4_CD_NODES( cd_base_cxt_sp, cd_base_cxt_row_gap ); cd_cxt_node_sp = cd_cxt_node[r] + c; UPDATE_1_CD_NODE( cd_cxt_node_sp ); } #endif sign_cxt_sp = base_sign_cxt[r] + c; sign_predict = sign_cxt_tab[*sign_cxt_sp & SIGN_CXT_MASK]; sign_bit = sub_decoder-> decode_symbol( sign_models[sign_predict & SIGN_CXT_MASK] ) ? ( sign_predict & SIGN_BIT ) ^ SIGN_BIT : sign_predict & SIGN_BIT; if( sign_bit ) base_coeff[r][c] |= SIGN_BIT; UPDATE_SIGN_CXT( sign_cxt_sp, sign_cxt_row_gap, sign_bit ); } else *( --LIP_end ) = cur_coord; #ifdef TEST_CODING_RATE if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { node_list.LSP_end = LSP_end; return; } #endif } node_list.LSP_end = LSP_end; node_list.LIP_end = LIP_end; #ifdef LSP_BIT_IDX node_list.LSP_ids[bit_idx][0] = LSP_end; #endif } //----------------------------------------------------------------------------- // decode_sig_leaf_cxt_AC() //----------------------------------------------------------------------------- void DecSubband:: //bool DecSubband:: decode_sig_leaf_cxt_AC( std_int cur_coord ) { // std_short dim_r = qtree.dims[0].r; // std_short dim_c = qtree.dims[0].c; std_short row_gap = base_coeff[1] - base_coeff[0]; std_short cxt_row_gap = cxt_qtree. base_cxt[1] - cxt_qtree. base_cxt[0]; std_short r = ( cur_coord >> 16 ) << 1; std_short c = ( cur_coord & 0xFFFF ) << 1; SUB_COEFF_TYPE * sp = base_coeff[r] + c; PEL_CXT_TYPE * cp, * cxt_sp = cxt_qtree. base_cxt[r] + c; MODEL_TYPE * sig_models = cxt_qtree. cxt_models + cxt_qtree. sig_offsets[0]; std_byte * cxt_tab = cxt_qtree. sig_tabs[0]; //sign related data........ MODEL_TYPE * sign_models = cxt_qtree. cxt_models + cxt_qtree. sign_offset; SUB_COEFF_TYPE * sign_cxt_tab = cxt_qtree. sign_tab; SIGN_CXT_TYPE ** base_sign_cxt = cxt_qtree. base_sign_cxt; SIGN_CXT_TYPE * sign_cp, * sign_cxt_sp = base_sign_cxt[r] + c; std_short sign_cxt_row_gap = base_sign_cxt[1] - base_sign_cxt[0]; SUB_COEFF_TYPE sign_predict, sign_bit; //interband related data #ifdef INTERBANDS int cd_base_cxt_row_gap, cd_cxt_node_row_gap; PEL_CXT_TYPE * cd_base_cp, * cd_base_cxt_sp, ** cd_base_cxt; NODE_CXT_TYPE * cd_node_cp, * cd_cxt_node_sp, ** cd_cxt_node; if( child_cxt_qtree ) { cd_base_cxt = child_cxt_qtree->base_cxt; cd_base_cxt_row_gap = cd_base_cxt[1] - cd_base_cxt[0]; cd_base_cxt_sp = cd_base_cxt[r << 1] + ( c << 1 ); cd_cxt_node = child_cxt_qtree->cxt_nodes[1]; cd_cxt_node_row_gap = cd_cxt_node[1] - cd_cxt_node[0]; cd_cxt_node_sp = cd_cxt_node[r] + c; } #endif int nbits = 0; cur_coord <<= 1; if( sub_decoder->decode_symbol( sig_models[cxt_tab[*cxt_sp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif *sp |= bit_idx_mask; UPDATE_CXT( cxt_sp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { UPDATE_4_CD_NODES( cd_base_cxt_sp, cd_base_cxt_row_gap ); UPDATE_1_CD_NODE( cd_cxt_node_sp ); } #endif sign_predict = sign_cxt_tab[*sign_cxt_sp & SIGN_CXT_MASK]; sign_bit = sub_decoder-> decode_symbol( sign_models[sign_predict & SIGN_CXT_MASK] ) ? ( sign_predict & SIGN_BIT ) ^ SIGN_BIT : sign_predict & SIGN_BIT; if( sign_bit ) *sp |= SIGN_BIT; UPDATE_SIGN_CXT( sign_cxt_sp, sign_cxt_row_gap, sign_bit ); *++node_list.LSP_end = cur_coord; nbits++; } else { *--node_list.LIP_end = cur_coord; } #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif cp = cxt_sp + 1; if( !( *cp & OUT_OF_BOUNDS ) ) { if( sub_decoder->decode_symbol( sig_models[cxt_tab[*cp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif sp[1] |= bit_idx_mask; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_base_cp = cd_base_cxt_sp + 2; UPDATE_4_CD_NODES( cd_base_cp, cd_base_cxt_row_gap ); cd_node_cp = cd_cxt_node_sp + 1; UPDATE_1_CD_NODE( cd_node_cp ); } #endif sign_cp = sign_cxt_sp + 1; sign_predict = sign_cxt_tab[*sign_cp & SIGN_CXT_MASK]; sign_bit = sub_decoder-> decode_symbol( sign_models[sign_predict & SIGN_CXT_MASK] ) ? ( sign_predict & SIGN_BIT ) ^ SIGN_BIT : sign_predict & SIGN_BIT; if( sign_bit ) sp[1] |= SIGN_BIT; UPDATE_SIGN_CXT( sign_cp, sign_cxt_row_gap, sign_bit ); *++node_list.LSP_end = cur_coord | 0x1; nbits++; } else { *--node_list.LIP_end = cur_coord | 0x1; } #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } cp = cxt_sp + cxt_row_gap; if( !( *cp & OUT_OF_BOUNDS ) ) { if( sub_decoder->decode_symbol( sig_models[cxt_tab[*cp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif sp[row_gap] |= bit_idx_mask; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_base_cp = cd_base_cxt_sp + ( cd_base_cxt_row_gap << 1 ); UPDATE_4_CD_NODES( cd_base_cp, cd_base_cxt_row_gap ); cd_node_cp = cd_cxt_node_sp + cd_cxt_node_row_gap; UPDATE_1_CD_NODE( cd_node_cp ); } #endif sign_cp = sign_cxt_sp + sign_cxt_row_gap; sign_predict = sign_cxt_tab[*sign_cp & SIGN_CXT_MASK]; sign_bit = sub_decoder-> decode_symbol( sign_models[sign_predict & SIGN_CXT_MASK] ) ? ( sign_predict & SIGN_BIT ) ^ SIGN_BIT : sign_predict & SIGN_BIT; if( sign_bit ) sp[row_gap] |= SIGN_BIT; UPDATE_SIGN_CXT( sign_cp, sign_cxt_row_gap, sign_bit ); *++node_list.LSP_end = cur_coord | 0x10000; nbits++; } else { *--node_list.LIP_end = cur_coord | 0x10000; } #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } cp = cxt_sp + cxt_row_gap + 1; if( !( *cp & OUT_OF_BOUNDS ) ) { if( nbits ) { if( sub_decoder->decode_symbol( sig_models[cxt_tab[*cp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE // June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif sp[row_gap + 1] |= bit_idx_mask; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_base_cp = cd_base_cxt_sp + ( cd_base_cxt_row_gap << 1 ) + 2; UPDATE_4_CD_NODES( cd_base_cp, cd_base_cxt_row_gap ); cd_node_cp = cd_cxt_node_sp + cd_cxt_node_row_gap + 1; UPDATE_1_CD_NODE( cd_node_cp ); } #endif sign_cp = sign_cxt_sp + sign_cxt_row_gap + 1; sign_predict = sign_cxt_tab[*sign_cp & SIGN_CXT_MASK]; sign_bit = sub_decoder-> decode_symbol( sign_models[sign_predict & SIGN_CXT_MASK] ) ? ( sign_predict & SIGN_BIT ) ^ SIGN_BIT : sign_predict & SIGN_BIT; if( sign_bit ) sp[row_gap + 1] |= SIGN_BIT; UPDATE_SIGN_CXT( sign_cp, sign_cxt_row_gap, sign_bit ); *++node_list.LSP_end = cur_coord | 0x10001; } else { *--node_list.LIP_end = cur_coord | 0x10001; } } else { sp[row_gap + 1] |= bit_idx_mask; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_base_cp = cd_base_cxt_sp + ( cd_base_cxt_row_gap << 1 ) + 2; UPDATE_4_CD_NODES( cd_base_cp, cd_base_cxt_row_gap ); cd_node_cp = cd_cxt_node_sp + cd_cxt_node_row_gap + 1; UPDATE_1_CD_NODE( cd_node_cp ); } #endif sign_cp = sign_cxt_sp + sign_cxt_row_gap + 1; sign_predict = sign_cxt_tab[*sign_cp & SIGN_CXT_MASK]; sign_bit = sub_decoder-> decode_symbol( sign_models[sign_predict & SIGN_CXT_MASK] ) ? ( sign_predict & SIGN_BIT ) ^ SIGN_BIT : sign_predict & SIGN_BIT; if( sign_bit ) sp[row_gap + 1] |= SIGN_BIT; UPDATE_SIGN_CXT( sign_cp, sign_cxt_row_gap, sign_bit ); *++node_list.LSP_end = cur_coord | 0x10001; } } return; } //----------------------------------------------------------------------------- // decode_sig_node_cxt_AC() //----------------------------------------------------------------------------- void DecSubband::decode_sig_node_cxt_AC( std_int cur_coord, int lev ) { std_short cxt_row_gap = cxt_qtree.cxt_nodes[lev][1] - cxt_qtree.cxt_nodes[lev][0]; std_short r = ( cur_coord >> 16 ) << 1; std_short c = ( cur_coord & 0xFFFF ) << 1; NODE_CXT_TYPE *cp, *cxt_sp = cxt_qtree.cxt_nodes[lev][r] + c; MODEL_TYPE *sig_models = cxt_qtree.cxt_models + cxt_qtree.sig_offsets[lev]; std_byte *sig_cxt_tab = cxt_qtree.sig_tabs[lev]; //new stuffs std_int coord_buf[4]; #ifdef INTERBANDS int cd_cxt_node_row_gap; NODE_CXT_TYPE *cd_node_cp, *cd_cxt_node_sp, **cd_cxt_node; if( child_cxt_qtree ) { cd_cxt_node = child_cxt_qtree->cxt_nodes[lev + 1]; cd_cxt_node_row_gap = cd_cxt_node[1] - cd_cxt_node[0]; cd_cxt_node_sp = cd_cxt_node[r] + c; } #endif int nbits = 0; cur_coord <<= 1; if( sub_decoder-> decode_symbol( sig_models[sig_cxt_tab[*cxt_sp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif coord_buf[nbits++] = cur_coord; UPDATE_CXT( cxt_sp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { UPDATE_1_CD_NODE( cd_cxt_node_sp ); } #endif //nbits++; } else *( ++node_list.LIS_end[lev] ) = cur_coord; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif cp = cxt_sp + 1; if( !( *cp & OUT_OF_BOUNDS ) ) { if( sub_decoder->decode_symbol( sig_models[sig_cxt_tab[*cp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif coord_buf[nbits++] = cur_coord | 0x1; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_node_cp = cd_cxt_node_sp + 1; UPDATE_1_CD_NODE( cd_node_cp ); } #endif } else *( ++node_list.LIS_end[lev] ) = cur_coord | 0x1; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } cp = cxt_sp + cxt_row_gap; if( !( *cp & OUT_OF_BOUNDS ) ) { if( sub_decoder->decode_symbol( sig_models[sig_cxt_tab[*cp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif coord_buf[nbits++] = cur_coord | 0x10000; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_node_cp = cd_cxt_node_sp + cd_cxt_node_row_gap; UPDATE_1_CD_NODE( cd_node_cp ); } #endif } else *( ++node_list.LIS_end[lev] ) = cur_coord | 0x10000; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } cp = cxt_sp + cxt_row_gap + 1; if( !( *cp & OUT_OF_BOUNDS ) ) { if( nbits ) { if( sub_decoder-> decode_symbol( sig_models[sig_cxt_tab[*cp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif coord_buf[nbits++] = cur_coord | 0x10001; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_node_cp = cd_cxt_node_sp + cd_cxt_node_row_gap + 1; UPDATE_1_CD_NODE( cd_node_cp ); } #endif } else *( ++node_list.LIS_end[lev] ) = cur_coord | 0x10001; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } else { coord_buf[nbits++] = cur_coord | 0x10001; UPDATE_CXT( cp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_node_cp = cd_cxt_node_sp + cd_cxt_node_row_gap + 1; UPDATE_1_CD_NODE( cd_node_cp ); } #endif } } #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif while( nbits ) { ( ++node_list.LIS_stack_top )->node = coord_buf[--nbits]; node_list.LIS_stack_top->level = lev; } } //----------------------------------------------------------------------------- // decode_LIS_leaves_cxt_AC(void) //----------------------------------------------------------------------------- void DecSubband::decode_LIS_leaves_cxt_AC( void ) { int i; std_short r, c; std_int cur_coord, *LIS_cur, *LIS_end, *LIS_end_old; NODE_CXT_TYPE *cxt_sp; NODE_CXT_TYPE **cxt_nodes = cxt_qtree.cxt_nodes[1]; std_short cxt_row_gap = cxt_nodes[1] - cxt_nodes[0]; MODEL_TYPE *leaf_models = cxt_qtree.cxt_models + cxt_qtree.node_offsets[1]; std_byte *leaf_cxt_tab = cxt_qtree.node_tabs[1]; #ifdef INTERBANDS NODE_CXT_TYPE *cd_cxt_node_sp, **cd_cxt_node; if( child_cxt_qtree ) { cd_cxt_node = child_cxt_qtree->cxt_nodes[2]; } #endif #ifdef SCALE_SIGN_MODELS_AT_LEVEL_ENDS MODEL_TYPE *sign_models = cxt_qtree.cxt_models + cxt_qtree.sign_offset; for( i = cxt_qtree.sign_cxts - 1; i >= 0; sign_models[i--].taub_scale( ) ); #endif #ifdef INITIALIZE_NODE_MODELS_FROM_PAR if( ( bit_idx == max_bit_idx - 1 ) && ( par_cxt_qtree ) ) { MODEL_TYPE *par_leaf_models; assert( cxt_qtree.node_cxts[1] == par_cxt_qtree->node_cxts[1] ); par_leaf_models = par_cxt_qtree->cxt_models + par_cxt_qtree->node_offsets[1]; for( i = cxt_qtree.node_cxts[1] - 1; i >= 0; leaf_models[i].reset( par_leaf_models[i] ), leaf_models[i--].taub_scale( ) ); } #endif LIS_cur = LIS_end = node_list.LIS[1] - 1; LIS_end_old = node_list.LIS_end[1]; for( ; LIS_cur < LIS_end_old; ) { cur_coord = *( ++LIS_cur ); r = cur_coord >> 16; c = cur_coord & 0xFFFF; cxt_sp = cxt_nodes[r] + c; if( sub_decoder-> decode_symbol( leaf_models[leaf_cxt_tab[*cxt_sp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif ( this->*decode_sig_leaf ) ( cur_coord ); #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif UPDATE_CXT( cxt_sp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_cxt_node_sp = cd_cxt_node[r] + c; UPDATE_1_CD_NODE( cd_cxt_node_sp ); } #endif } else *++LIS_end = cur_coord; #ifdef TEST_CODING_RATE if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } node_list.LIS_end[1] = LIS_end; #ifdef LSP_BIT_IDX node_list.LSP_ids[bit_idx][1] = node_list.LSP_end; #endif } //----------------------------------------------------------------------------- // decode_cur_qtree_level_cxt_AC(void) //----------------------------------------------------------------------------- void DecSubband::decode_cur_qtree_level_cxt_AC( void ) { assert( cur_lev < qtree.depth ); int i; std_short r, c; std_int cur_coord, *pLIS_cur, *pLIS_end, *pLIS_end_old; //, *cLIS_end NODE_CXT_TYPE *cxt_sp, **cxt_nodes = cxt_qtree.cxt_nodes[cur_lev]; std_short cxt_row_gap = cxt_nodes[1] - cxt_nodes[0]; MODEL_TYPE *node_models = cxt_qtree.cxt_models + cxt_qtree.node_offsets[cur_lev]; std_byte *node_cxt_tab = cxt_qtree.node_tabs[cur_lev]; #ifdef INTERBANDS NODE_CXT_TYPE *cd_cxt_node_sp, **cd_cxt_node; if( child_cxt_qtree ) { cd_cxt_node = child_cxt_qtree->cxt_nodes[cur_lev + 1]; } #endif #ifdef SCALE_SIGN_MODELS_AT_LEVEL_ENDS MODEL_TYPE *sign_models = cxt_qtree.cxt_models + cxt_qtree.sign_offset; for( i = cxt_qtree.sign_cxts - 1; i >= 0; sign_models[i--].taub_scale( ) ); #endif pLIS_cur = pLIS_end = node_list.LIS[cur_lev] - 1; pLIS_end_old = node_list.LIS_end[cur_lev]; while( pLIS_cur < pLIS_end_old ) { cur_coord = *( ++pLIS_cur ); r = cur_coord >> 16; c = cur_coord & 0xFFFF; cxt_sp = cxt_nodes[r] + c; if( sub_decoder-> decode_symbol( node_models[node_cxt_tab[*cxt_sp & ZC_MASK]] ) ) { #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif UPDATE_CXT( cxt_sp, cxt_row_gap ); #ifdef INTERBANDS if( child_cxt_qtree ) { cd_cxt_node_sp = cd_cxt_node[r] + c; UPDATE_1_CD_NODE( cd_cxt_node_sp ); } #endif ( this->*decode_sig_node ) ( cur_coord, cur_lev - 1 ); #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif decode_LIS_stack( ); #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } else *++pLIS_end = cur_coord; #ifdef TEST_CODING_RATE if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) return; #endif } node_list.LIS_end[cur_lev] = pLIS_end; #ifdef LSP_BIT_IDX node_list.LSP_ids[bit_idx][cur_lev] = node_list.LSP_end; #endif cur_lev++; } //----------------------------------------------------------------------------- // decode_LSP_cxt_AC() //----------------------------------------------------------------------------- void DecSubband::decode_LSP_cxt_AC( ) { std_short r, c; std_int *last, *sp, LSP_offset; SUB_COEFF_TYPE mag; std_int LSP_plane = node_list.LSP_plane; std_int *LSP_mark = node_list.LSP_mark; MODEL_TYPE *LSP_models = cxt_qtree.cxt_models + cxt_qtree.LSP_offset; #ifdef LSP_LUT std_byte *LSP_cxt_tab = cxt_qtree.LSP_tab; #endif PEL_CXT_TYPE **base_cxt = cxt_qtree.base_cxt; LSP_mark[LSP_plane] = node_list.LSP_end - node_list.LSP; if( LSP_plane ) { last = node_list.LSP + LSP_mark[LSP_plane - 1]; // for (sp = node_list.LSP; sp <= last; sp++){ for( sp = last; sp >= node_list.LSP; sp-- ) { r = *sp >> 16; c = *sp & 0xFFFF; mag = ( base_coeff[r][c] & MAG_MASK ) >> bit_idx; LSP_offset = 0; #ifdef LSP_LUT if( mag < 4 ) { LSP_offset = LSP_cxt_tab[base_cxt[r][c]] + 1; } #else if( mag < 4 ) { if( base_cxt[r][c] & 0x0FFF ) LSP_offset++; } else LSP_offset += 2; #endif // if(sub_decoder->decode_symbol(*LSP_models)) if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif } } ++( node_list.LSP_plane ); LSP_break_pt = node_list.LSP; } //----------------------------------------------------------------------------- // decode_LSP_cxt_AC_and_bit_idx() //----------------------------------------------------------------------------- void DecSubband::decode_LSP_cxt_AC_and_bit_idx( ) { std_short r, c; std_int *last, *sp, LSP_offset; std_int LSP_plane = node_list.LSP_plane; std_int *LSP_mark = node_list.LSP_mark; std_int **LSP_bit_idx_marks = node_list.LSP_bit_idx_marks; std_int ***LSP_ids = node_list.LSP_ids; int i, depth = qtree.depth; MODEL_TYPE *LSP_models = cxt_qtree.cxt_models + cxt_qtree.LSP_offset; #ifdef LSP_LUT std_byte *LSP_cxt_tab = cxt_qtree.LSP_tab; #endif PEL_CXT_TYPE **base_cxt = cxt_qtree.base_cxt; LSP_mark[LSP_plane] = node_list.LSP_end - node_list.LSP; LSP_bit_idx_marks[bit_idx] = node_list.LSP_end; //new stuffs #ifdef INITIALIZE_LSP_MODELS_FROM_PAR MODEL_TYPE *par_LSP_models; if( ( bit_idx == max_bit_idx - 1 ) && ( par_cxt_qtree ) ) { assert( cxt_qtree.LSP_cxts == par_cxt_qtree->LSP_cxts ); par_LSP_models = par_cxt_qtree->cxt_models + par_cxt_qtree->LSP_offset; for( i = cxt_qtree.LSP_cxts - 1; i >= 0; LSP_models[i].reset( par_LSP_models[i] ), LSP_models[i--].taub_scale( ) ); } #endif #ifdef LSP_LUT int LSP_lev, LSP_set_offset; if( bit_idx < max_bit_idx ) { #ifdef MERGE_HIGH_IDX_SETS_OF_TOP_LSP_PLANE LSP_lev = depth - 1; #ifdef MERGE_ALL_LSP_PLANES LSP_set_offset = 0; #else LSP_set_offset = 20; #endif #else LSP_lev = ( depth < 6 ) ? ( depth - 1 ) : 5; #endif for( sp = LSP_bit_idx_marks[bit_idx + 1]; LSP_lev > 1; LSP_lev-- ) { #ifndef MERGE_HIGH_IDX_SETS_OF_TOP_LSP_PLANE LSP_set_offset = LSP_lev * 10; #endif for( last = LSP_ids[bit_idx + 1][LSP_lev - 1]; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; LSP_offset = LSP_set_offset + LSP_cxt_tab[base_cxt[r][c]]; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } /* June15 #ifdef TEST_CODING_RATE if(sub_decoder->bytes_used() > sub_decoder->byte_budget){ LSP_break_pt = sp + 1; return; } #endif */ #ifdef SCALE_AT_LSP_BREAK_PTS for( i = cxt_qtree.LSP_cxts - 1; i >= 0; LSP_models[i--].taub_scale( ) ); #endif } if( bit_idx < max_bit_idx - 1 ) { //from leaves last = LSP_ids[bit_idx + 1][0]; #ifndef MERGE_SETS_OF_TOP_LSP_PLANE LSP_set_offset = 10; #else //for(i = cxt_qtree.LSP_cxts - 1; i >= 0; LSP_models[i--].taub_scale()); #endif for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; LSP_offset = LSP_set_offset + LSP_cxt_tab[base_cxt[r][c]]; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } /* June15 #ifdef TEST_CODING_RATE if(sub_decoder->bytes_used() > sub_decoder->byte_budget){ LSP_break_pt = sp + 1; return; } #endif */ #ifdef MERGE_SETS_0_1_OF_TOP_PLANE #ifdef SCALE_AT_LSP_BREAK_PTS for( i = cxt_qtree.LSP_cxts - 1; i >= 0; LSP_models[i--].taub_scale( ) ); #endif #else LSP_set_offset = 0; #endif last = LSP_bit_idx_marks[bit_idx + 2]; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; LSP_offset = LSP_set_offset + LSP_cxt_tab[base_cxt[r][c]]; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } /* June15 #ifdef TEST_CODING_RATE if(sub_decoder->bytes_used() > sub_decoder->byte_budget){ LSP_break_pt = sp + 1; return; } #endif */ } } if( bit_idx < max_bit_idx - 1 ) { #ifdef SEPARATE_SETS_OF_PLANE_1 #ifndef MERGE_LSP_PLANE_1 LSP_set_offset = 60; #else #ifdef SCALE_AT_LSP_BREAK_PTS for( i = cxt_qtree.LSP_cxts - 1; i >= 0; LSP_models[i--].taub_scale( ) ); #endif #endif //MERGE_LSP_PLANE_1 LSP_lev = depth - 1; for( ; LSP_lev >= 0; LSP_lev-- ) { if( LSP_lev ) last = LSP_ids[bit_idx + 2][LSP_lev - 1]; else last = ( bit_idx == max_bit_idx - 2 ) ? node_list.LSP - 1 : LSP_bit_idx_marks[bit_idx + 3]; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; LSP_offset = LSP_set_offset + LSP_cxt_tab[base_cxt[r][c]]; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } /* June15 #ifdef TEST_CODING_RATE if(sub_decoder->bytes_used() > sub_decoder->byte_budget){ LSP_break_pt = sp + 1; return; } #endif */ for( i = cxt_qtree.LSP_cxts - 1; i >= 0; LSP_models[i--].taub_scale( ) ); } #else //SEPARATE_SETS_OF_PLANE_1 last = ( bit_idx == max_bit_idx - 2 ) ? node_list.LSP - 1 : LSP_bit_idx_marks[bit_idx + 3]; LSP_set_offset = 60; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; LSP_offset = LSP_set_offset + LSP_cxt_tab[base_cxt[r][c]]; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } /* June15 #ifdef TEST_CODING_RATE if(sub_decoder->bytes_used() > sub_decoder->byte_budget){ LSP_break_pt = sp + 1; return; } #endif */ #endif } if( bit_idx < max_bit_idx - 2 ) { #ifndef MERGE_LOWER_LSP_PLANE LSP_set_offset = 70; #else #ifdef SCALE_AT_LSP_BREAK_PTS for( i = cxt_qtree.LSP_cxts - 1; i >= 0; LSP_models[i--].taub_scale( ) ); #endif #endif last = node_list.LSP - 1; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; LSP_offset = LSP_set_offset + LSP_cxt_tab[base_cxt[r][c]]; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } /* June15 #ifdef TEST_CODING_RATE if(sub_decoder->bytes_used() > sub_decoder->byte_budget){ LSP_break_pt = sp + 1; return; } #endif */ } #else int LSP_lev; if( bit_idx < max_bit_idx ) { LSP_lev = ( depth < 6 ) ? ( depth - 1 ) : 5; for( sp = LSP_bit_idx_marks[bit_idx + 1]; LSP_lev > 1; LSP_lev-- ) { LSP_offset = LSP_lev; for( last = LSP_ids[bit_idx + 1][LSP_lev - 1]; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } } if( bit_idx < max_bit_idx - 1 ) { //from leaves last = LSP_ids[bit_idx + 1][0]; LSP_offset = 1; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } last = LSP_bit_idx_marks[bit_idx + 2]; LSP_offset = 0; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } } } if( bit_idx < max_bit_idx - 1 ) { last = ( bit_idx == max_bit_idx - 2 ) ? node_list.LSP - 1 : LSP_bit_idx_marks[bit_idx + 3]; LSP_offset = 10; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } } if( bit_idx < max_bit_idx - 2 ) { last = node_list.LSP - 1; LSP_offset = 11; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } } //3 seperate levs......................................... #ifdef 3LEVS_AC0 if( bit_idx < max_bit_idx ) { last = ( bit_idx == max_bit_idx - 1 ) ? node_list.LSP - 1 : LSP_bit_idx_marks[bit_idx + 2]; LSP_offset = 0; for( sp = LSP_bit_idx_marks[bit_idx + 1]; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } } if( bit_idx < max_bit_idx - 1 ) { last = ( bit_idx == max_bit_idx - 2 ) ? node_list.LSP - 1 : LSP_bit_idx_marks[bit_idx + 3]; LSP_offset = 1; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } } if( bit_idx < max_bit_idx - 2 ) { last = node_list.LSP - 1; LSP_offset = 2; for( ; sp > last; sp-- ) { //decoding unit................................. r = *sp >> 16; c = *sp & 0xFFFF; if( sub_decoder->decode_symbol( LSP_models[LSP_offset] ) ) base_coeff[r][c] |= bit_idx_mask; #ifdef TEST_CODING_RATE //June15 if( sub_decoder->bytes_used( ) > sub_decoder->byte_budget ) { LSP_break_pt = sp + 1; return; } #endif //end of decoding unit................................. } } #endif //3LEVS_AC0 #endif //LSP_LUT ++( node_list.LSP_plane ); LSP_break_pt = node_list.LSP; }
25.896151
80
0.577975
Dongcunhui
be086d36f62e2133d6d3e1b813edcb319ee5f62b
20,839
hpp
C++
src/cppmat/map_diagonal_matrix.hpp
tdegeus/cppmatrix
a6738a2c8be4c6e83b499b54bd874a3d3ee05000
[ "MIT" ]
6
2017-05-05T15:44:36.000Z
2019-01-19T09:58:47.000Z
src/cppmat/map_diagonal_matrix.hpp
tdegeus/cppmatrix
a6738a2c8be4c6e83b499b54bd874a3d3ee05000
[ "MIT" ]
32
2017-08-31T08:04:09.000Z
2019-10-21T15:42:01.000Z
src/cppmat/map_diagonal_matrix.hpp
tdegeus/cppmatrix
a6738a2c8be4c6e83b499b54bd874a3d3ee05000
[ "MIT" ]
2
2018-08-03T09:08:32.000Z
2022-01-25T07:38:25.000Z
/* ================================================================================================= (c - MIT) T.W.J. de Geus (Tom) | tom@geus.me | www.geus.me | github.com/tdegeus/cppmat ================================================================================================= */ #ifndef CPPMAT_MAP_DIAGONAL_MATRIX_HPP #define CPPMAT_MAP_DIAGONAL_MATRIX_HPP // ------------------------------------------------------------------------------------------------- #include "cppmat.h" // ------------------------------------------------------------------------------------------------- namespace cppmat { namespace view { namespace diagonal { // ================================================================================================= // return size without constructing // ================================================================================================= template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::Size() { return N; } // ================================================================================================= // constructors // ================================================================================================= template<typename X, size_t M, size_t N> inline matrix<X,M,N>::matrix() { mZero[0] = static_cast<X>(0); } // ================================================================================================= // constructors: map external pointer // ================================================================================================= template<typename X, size_t M, size_t N> inline matrix<X,M,N>::matrix(const X *A) { mZero[0] = static_cast<X>(0); mData = A; } // ================================================================================================= // named constructors // ================================================================================================= template<typename X, size_t M, size_t N> inline matrix<X,M,N> matrix<X,M,N>::Map(const X *D) { matrix<X,M,N> out; out.setMap(D); return out; } // ================================================================================================= // return plain storage as vector // ================================================================================================= template<typename X, size_t M, size_t N> template<typename U, typename V> inline matrix<X,M,N>::operator std::vector<U> () const { std::vector<U> out(mSize); for ( size_t i = 0 ; i < mSize ; ++i ) out[i] = static_cast<U>(mData[i]); return out; } // ================================================================================================= // modify bounds check // ================================================================================================= template<typename X, size_t M, size_t N> inline void matrix<X,M,N>::setPeriodic(bool periodic) { mPeriodic = periodic; } // ================================================================================================= // get dimensions // ================================================================================================= template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::size() const { return mSize; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::rank() const { return mRank; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::shape(int i) const { // check axis: (0,1,...,rank-1) or (-1,-2,...,-rank) Assert( i < static_cast<int>(mRank) ); Assert( i >= -1 * static_cast<int>(mRank) ); // return shape return N; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::shape(size_t i) const { // check axis: (0,1,...,rank-1) Assert( i < mRank ); // return shape return N; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline std::vector<size_t> matrix<X,M,N>::shape() const { std::vector<size_t> shape(mRank); std::fill(shape.begin(), shape.end(), N); return shape; } // ================================================================================================= // get dimensions using a different return type // ================================================================================================= template<typename X, size_t M, size_t N> template<typename U> inline U matrix<X,M,N>::size() const { return static_cast<U>(size()); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename U> inline U matrix<X,M,N>::rank() const { return static_cast<U>(rank()); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename U> inline U matrix<X,M,N>::shape(int i) const { return static_cast<U>(shape(i)); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename U> inline U matrix<X,M,N>::shape(size_t i) const { return static_cast<U>(shape(i)); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename U> inline std::vector<U> matrix<X,M,N>::shape() const { std::vector<size_t> A = shape(); std::vector<U> B(A.size()); std::copy(A.begin(), A.end(), B.begin()); return B; } // ================================================================================================= // index operators : operator[...] // ================================================================================================= template<typename X, size_t M, size_t N> inline const X& matrix<X,M,N>::operator[](size_t i) const { Assert( i < mSize ); return mData[i]; } // ================================================================================================= // index operators : operator(...) // ================================================================================================= template<typename X, size_t M, size_t N> inline const X& matrix<X,M,N>::operator()(int a, int b) const { int n = static_cast<int>(N); Assert( ( a < n && a >= -n ) or mPeriodic ); Assert( ( b < n && b >= -n ) or mPeriodic ); if ( a != b ) return mZero[0]; size_t A = static_cast<size_t>( (n+(a%n)) % n ); return mData[A]; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename T, typename S> inline const X& matrix<X,M,N>::operator()(T a, T b) const { Assert( a < N ); Assert( b < N ); if (a == b) return mData[a]; else return mZero[0]; } // ================================================================================================= // index operators : compress(...) // ================================================================================================= template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::compress(int a, int b) const { Assert( a == b ); int n = static_cast<int>(N); Assert( ( a < n && a >= -n ) or mPeriodic ); size_t A = static_cast<size_t>( (n+(a%n)) % n ); return A; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename T, typename S> inline size_t matrix<X,M,N>::compress(T a, T b) const { Assert( a < N ); Assert( b < N ); Assert( a == b ); return a; } // ================================================================================================= // index operators : decompress(...) // ================================================================================================= template<typename X, size_t M, size_t N> inline std::vector<size_t> matrix<X,M,N>::decompress(size_t i) const { // check input Assert( i < mSize ); // allocate matrix-index std::vector<size_t> idx(mRank); // reconstruct std::fill(idx.begin(), idx.end(), i); return idx; } // ================================================================================================= // midpoint // ================================================================================================= template<typename X, size_t M, size_t N> inline std::vector<size_t> matrix<X,M,N>::midpoint() const { // get shape std::vector<size_t> mid = shape(); // check odd-sized for ( auto &i : mid ) if ( i%2 == 0 ) throw std::domain_error("cppmat::matrix<X,M,N>::midpoint: Must be odd shaped"); // midpoint for ( auto &i : mid ) i = (i-1)/2; return mid; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::midpoint(size_t axis) const { // get shape size_t mid = shape(axis); // check odd-sized if ( mid%2 == 0 ) throw std::domain_error("cppmat::matrix<X,M,N>::midpoint: Must be odd shaped"); // midpoint mid = (mid-1)/2; return mid; } // ================================================================================================= // pointer to data // ================================================================================================= template<typename X, size_t M, size_t N> inline const X* matrix<X,M,N>::data() const { return mData; } // ================================================================================================= // iterators : begin() and end() // ================================================================================================= template<typename X, size_t M, size_t N> inline auto matrix<X,M,N>::begin() const { return mData; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline auto matrix<X,M,N>::end() const { return mData + mSize; } // ================================================================================================= // iterators : index() // ================================================================================================= template<typename X, size_t M, size_t N> inline auto matrix<X,M,N>::index(size_t i) const { Assert( i < mSize ); return begin() + i; } // ================================================================================================= // iterators : item() // ================================================================================================= template<typename X, size_t M, size_t N> inline auto matrix<X,M,N>::item(int a, int b) const { Assert( a == b ); int n = static_cast<int>(N); Assert( ( a < n && a >= -n ) or mPeriodic ); size_t A = static_cast<size_t>( (n+(a%n)) % n ); return this->begin() + A; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename T, typename S> inline auto matrix<X,M,N>::item(T a, T b) const { Assert( a < N ); Assert( b < N ); Assert( a == b ); return this->begin() + a; } // ================================================================================================= // initialize // ================================================================================================= template<typename X, size_t M, size_t N> inline void matrix<X,M,N>::setMap(const X *D) { mData = D; } // ================================================================================================= // copy to target // ================================================================================================= template<typename X, size_t M, size_t N> template<class Iterator> inline void matrix<X,M,N>::copyTo(Iterator first) const { std::copy(begin(), end(), first); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<class Iterator> inline void matrix<X,M,N>::copyTo(Iterator first, Iterator last) const { Assert( mSize == static_cast<size_t>(last-first) ); UNUSED(last); std::copy(begin(), end(), first); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<class Iterator> inline void matrix<X,M,N>::copyToDense(Iterator first) const { for ( size_t i = 0 ; i < N ; ++i ) { for ( size_t j = 0 ; j < N ; ++j ) { if ( i == j ) first[i*N+j] = mData[i]; else first[i*N+j] = static_cast<X>(0); } } } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<class Iterator> inline void matrix<X,M,N>::copyToDense(Iterator first, Iterator last) const { Assert( N*N == static_cast<size_t>(last-first) ); UNUSED(last); for ( size_t i = 0 ; i < N ; ++i ) { for ( size_t j = 0 ; j < N ; ++j ) { if ( i == j ) first[i*N+j] = mData[i]; else first[i*N+j] = static_cast<X>(0); } } } // ================================================================================================= // bound check // ================================================================================================= template<typename X, size_t M, size_t N> template<typename T> inline bool matrix<X,M,N>::inBounds(T a) const { if ( mPeriodic ) return true; if ( a >= static_cast<T>(N) ) return false; if ( std::numeric_limits<T>::is_signed ) { if ( a < 0 ) return false; } return true; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> template<typename T> inline bool matrix<X,M,N>::inBounds(T a, T b) const { if ( mPeriodic ) return true; if ( a >= static_cast<T>(N) ) return false; if ( b >= static_cast<T>(N) ) return false; if ( std::numeric_limits<T>::is_signed ) { if ( a < 0 ) return false; if ( b < 0 ) return false; } return true; } // ================================================================================================= // norm // ================================================================================================= template<typename X, size_t M, size_t N> inline X matrix<X,M,N>::norm() const { X out = static_cast<X>(0); for ( size_t i = 0 ; i < mSize ; ++i ) out += std::abs(mData[i]); return out; } // ================================================================================================= // location of the minimum/maximum // ================================================================================================= template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::argmin() const { return std::min_element(begin(), end()) - begin(); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::argmax() const { return std::max_element(begin(), end()) - begin(); } // ================================================================================================= // minimum // ================================================================================================= template<typename X, size_t M, size_t N> inline X matrix<X,M,N>::min() const { return *std::min_element(begin(),end()); } // ================================================================================================= // maximum // ================================================================================================= template<typename X, size_t M, size_t N> inline X matrix<X,M,N>::max() const { return *std::max_element(begin(),end()); } // ================================================================================================= // sum // ================================================================================================= template<typename X, size_t M, size_t N> inline X matrix<X,M,N>::sum() const { return std::accumulate(begin(), end(), static_cast<X>(0)); } // ================================================================================================= // mean // ================================================================================================= template<typename X, size_t M, size_t N> inline double matrix<X,M,N>::mean() const { return static_cast<double>(sum())/static_cast<double>(N*N); } // ================================================================================================= // weighted average // ================================================================================================= template<typename X, size_t M, size_t N> inline double matrix<X,M,N>::average(const matrix<X,M,N> &weights, bool norm) const { if ( norm ) return static_cast<double>((weights*(*this)).sum())/static_cast<double>(weights.sum()); else return static_cast<double>((weights*(*this)).sum()); } // ================================================================================================= // find the plain storage indices of all non-zero entries // ================================================================================================= template<typename X, size_t M, size_t N> inline std::vector<size_t> matrix<X,M,N>::where() const { size_t nnz = 0; for ( size_t i = 0 ; i < mSize ; ++i ) if ( mData[i] ) ++nnz; std::vector<size_t> out(nnz); size_t j = 0; for ( size_t i = 0 ; i < mSize ; ++i ) { if ( mData[i] ) { out[j] = i; ++j; } } return out; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::where(size_t index) const { size_t j = 0; for ( size_t i = 0 ; i < mSize ; ++i ) { if ( mData[i] ) { if ( j == index ) return i; ++j; } } throw std::runtime_error("Out-of-bounds"); } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline size_t matrix<X,M,N>::where(int index) const { int nnz = 0; for ( size_t i = 0 ; i < mSize ; ++i ) if ( mData[i] ) ++nnz; Assert( index < nnz && index >= -nnz ); index = ( nnz + (index%nnz) ) % nnz; int j = 0; for ( size_t i = 0 ; i < mSize ; ++i ) { if ( mData[i] ) { if ( j == index ) return i; ++j; } } throw std::runtime_error("Out-of-bounds"); } // ================================================================================================= // print operator // ================================================================================================= template<typename X, size_t M, size_t N> inline std::ostream& operator<<(std::ostream& out, const matrix<X,M,N>& src) { auto w = out.width(); auto p = out.precision(); for ( size_t i = 0 ; i < src.shape(0) ; ++i ) { for ( size_t j = 0 ; j < src.shape(1) ; ++j ) { out << std::setw(w) << std::setprecision(p) << src(i,j); if ( j != src.shape(1)-1 ) out << ", "; else if ( i != src.shape(0)-1 ) out << ";" << std::endl; else out << ";"; } } return out; } // ================================================================================================= // equality operators // ================================================================================================= template<typename X, size_t M, size_t N> inline bool operator!= (const matrix<X,M,N> &A, const matrix<X,M,N> &B) { for ( size_t i = 0 ; i < A.size() ; ++i ) if ( A[i] != B[i] ) return true; return false; } // ------------------------------------------------------------------------------------------------- template<typename X, size_t M, size_t N> inline bool operator== (const matrix<X,M,N> &A, const matrix<X,M,N> &B) { for ( size_t i = 0 ; i < A.size() ; ++i ) if ( A[i] != B[i] ) return false; return true; } // ================================================================================================= }}} // namespace ... // ------------------------------------------------------------------------------------------------- #endif
26.958603
101
0.355583
tdegeus
be08967d395cde607e5d9366c78185f3167c8d62
6,505
hxx
C++
OCC/opencascade-7.2.0/x64/debug/inc/SelectMgr_Selection.hxx
jiaguobing/FastCAE
2348ab87e83fe5c704e4c998cf391229c25ac5d5
[ "BSD-3-Clause" ]
2
2020-02-21T01:04:35.000Z
2020-02-21T03:35:37.000Z
OCC/opencascade-7.2.0/x64/debug/inc/SelectMgr_Selection.hxx
Sunqia/FastCAE
cbc023fe07b6e306ceefae8b8bd7c12bc1562acb
[ "BSD-3-Clause" ]
1
2020-03-06T04:49:42.000Z
2020-03-06T04:49:42.000Z
OCC/opencascade-7.2.0/x64/debug/inc/SelectMgr_Selection.hxx
Sunqia/FastCAE
cbc023fe07b6e306ceefae8b8bd7c12bc1562acb
[ "BSD-3-Clause" ]
1
2021-11-21T13:03:26.000Z
2021-11-21T13:03:26.000Z
// Created on: 1995-02-16 // Created by: Mister rmi // Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _SelectMgr_Selection_HeaderFile #define _SelectMgr_Selection_HeaderFile #include <NCollection_Vector.hxx> #include <Standard.hxx> #include <Standard_Type.hxx> #include <Standard_Type.hxx> #include <SelectMgr_TypeOfUpdate.hxx> #include <Standard_Transient.hxx> #include <SelectMgr_SensitiveEntity.hxx> #include <SelectMgr_StateOfSelection.hxx> #include <SelectMgr_TypeOfBVHUpdate.hxx> class Standard_NullObject; class SelectBasics_SensitiveEntity; //! Represents the state of a given selection mode for a //! Selectable Object. Contains all the sensitive entities available for this mode. //! An interactive object can have an indefinite number of //! modes of selection, each representing a //! "decomposition" into sensitive primitives; each //! primitive has an Owner (SelectMgr_EntityOwner) //! which allows us to identify the exact entity which has //! been detected. Each Selection mode is identified by //! an index. The set of sensitive primitives which //! correspond to a given mode is stocked in a //! SelectMgr_Selection object. By Convention, the //! default selection mode which allows us to grasp the //! Interactive object in its entirety will be mode 0. //! AIS_Trihedron : 4 selection modes //! - mode 0 : selection of a trihedron //! - mode 1 : selection of the origin of the trihedron //! - mode 2 : selection of the axes //! - mode 3 : selection of the planes XOY, YOZ, XOZ //! when you activate one of modes 1 2 3 4 , you pick AIS objects of type: //! - AIS_Point //! - AIS_Axis (and information on the type of axis) //! - AIS_Plane (and information on the type of plane). //! AIS_PlaneTrihedron offers 3 selection modes: //! - mode 0 : selection of the whole trihedron //! - mode 1 : selection of the origin of the trihedron //! - mode 2 : selection of the axes - same remarks as for the Trihedron. //! AIS_Shape : 7 maximum selection modes, depending //! on the complexity of the shape : //! - mode 0 : selection of the AIS_Shape //! - mode 1 : selection of the vertices //! - mode 2 : selection of the edges //! - mode 3 : selection of the wires //! - mode 4 : selection of the faces //! - mode 5 : selection of the shells //! - mode 6 : selection of the constituent solids. class SelectMgr_Selection : public Standard_Transient { public: //! Constructs a selection object defined by the selection mode IdMode. //! The default setting 0 is the selection mode for a shape in its entirety. Standard_EXPORT SelectMgr_Selection (const Standard_Integer theModeIdx = 0); Standard_EXPORT ~SelectMgr_Selection(); Standard_EXPORT void Destroy(); //! Adds the sensitive primitive aprimitive to the list of //! stored entities in this object. //! Raises NullObject if the primitive is a null handle. Standard_EXPORT void Add (const Handle(SelectBasics_SensitiveEntity)& theSensitive); //! empties the selection from all the stored entities Standard_EXPORT void Clear(); //! returns true if no sensitive entity is stored. Standard_EXPORT Standard_Boolean IsEmpty() const; //! returns the selection mode represented by this selection Standard_Integer Mode() const; //! Begins an iteration scanning for sensitive primitives. void Init(); //! Continues the iteration scanning for sensitive //! primitives with the mode defined in this framework. Standard_Boolean More() const; //! Returns the next sensitive primitive found in the //! iteration. This is a scan for entities with the mode //! defined in this framework. void Next(); //! Returns any sensitive primitive in this framework. const Handle(SelectMgr_SensitiveEntity)& Sensitive() const; //! Returns the flag UpdateFlag. //! This flage gives the update status of this framework //! in a ViewerSelector object: //! - full //! - partial, or //! - none. SelectMgr_TypeOfUpdate UpdateStatus() const; void UpdateStatus (const SelectMgr_TypeOfUpdate theStatus); void UpdateBVHStatus (const SelectMgr_TypeOfBVHUpdate theStatus); SelectMgr_TypeOfBVHUpdate BVHUpdateStatus() const; //! Returns status of selection Standard_EXPORT SelectMgr_StateOfSelection GetSelectionState() const; //! Sets status of selection Standard_EXPORT void SetSelectionState (const SelectMgr_StateOfSelection theState) const; //! Returns sensitivity of the selection Standard_EXPORT Standard_Integer Sensitivity() const; //! Changes sensitivity of the selection and all its entities to the given value. //! IMPORTANT: This method does not update any outer selection structures, so for //! proper updates use SelectMgr_SelectionManager::SetSelectionSensitivity method. Standard_EXPORT void SetSensitivity (const Standard_Integer theNewSens); DEFINE_STANDARD_RTTIEXT(SelectMgr_Selection,Standard_Transient) protected: //! Returns sensitive entity stored by index theIdx in entites vector Standard_EXPORT Handle(SelectMgr_SensitiveEntity)& GetEntityById (const Standard_Integer theIdx); private: NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> myEntities; NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator myEntityIter; Standard_Integer myMode; SelectMgr_TypeOfUpdate myUpdateStatus; mutable SelectMgr_StateOfSelection mySelectionState; mutable SelectMgr_TypeOfBVHUpdate myBVHUpdateStatus; Standard_Integer mySensFactor; Standard_Boolean myIsCustomSens; }; DEFINE_STANDARD_HANDLE(SelectMgr_Selection, Standard_Transient) #include <SelectMgr_Selection.lxx> #endif
39.664634
99
0.733897
jiaguobing
be09d4b050ec8c96f006454ca05570e9169a9865
57,773
cpp
C++
armnn-ethos-n-backend/test/EthosNMappingTests.cpp
QPC-database/ethos-n-driver-stack
484b865d854cd50abf461adcde08e115d6600026
[ "Apache-2.0" ]
1
2021-07-03T23:51:07.000Z
2021-07-03T23:51:07.000Z
armnn-ethos-n-backend/test/EthosNMappingTests.cpp
QPC-database/ethos-n-driver-stack
484b865d854cd50abf461adcde08e115d6600026
[ "Apache-2.0" ]
null
null
null
armnn-ethos-n-backend/test/EthosNMappingTests.cpp
QPC-database/ethos-n-driver-stack
484b865d854cd50abf461adcde08e115d6600026
[ "Apache-2.0" ]
null
null
null
// // Copyright © 2019-2021 Arm Limited. All rights reserved. // SPDX-License-Identifier: Apache-2.0 // #include "EthosNConfig.hpp" #include "EthosNLayerSupport.hpp" #include "EthosNMapping.hpp" #include "EthosNTestUtils.hpp" #include <EthosNBackend.hpp> #include <EthosNBackendId.hpp> #include <Network.hpp> #include <armnn/Logging.hpp> #include <armnn/utility/Assert.hpp> #include <backendsCommon/test/CommonTestUtils.hpp> #include <test/EthosNTestUtils.hpp> // The include order is important. Turn off clang-format // clang-format off #include <boost/test/unit_test.hpp> #include <boost/test/data/test_case.hpp> // clang-format on #include <sstream> using Tensors = std::map<std::string, armnn::SimpleInputOutput>; using Layers = std::vector<armnn::SimpleLayer>; using Shape = std::vector<uint32_t>; using Mappings = std::vector<armnn::Mapping>; using namespace armnn; using namespace testing_utils; namespace bdata = boost::unit_test::data; namespace { struct TestLayerType { LayerType layer; // For ActivationLayer, this will be the name of the activation function std::string name; }; using TestLayerTypeElem = std::tuple<TestLayerType, TestLayerType>; using TestLayerTypeList = std::vector<TestLayerTypeElem>; enum ExceptionCases { NoException = 0, ParseException = 1, InvalidArgumentException = 2, First = NoException, Last = InvalidArgumentException }; AdditionalLayerParams CreateAdditionalParams(LayerType type) { AdditionalLayerParams params; if (type == LayerType::Pooling2d) { params.insert(std::make_pair("padding", "1x1x1x1")); params.insert(std::make_pair("kernel", "3x3")); params.insert(std::make_pair("stride", "1x1")); params.insert(std::make_pair("function", "Average")); } else if (type == LayerType::TransposeConvolution2d) { params.insert(std::make_pair("stride", "2x2")); params.insert(std::make_pair("padding", "0x0x0x0")); params.insert(std::make_pair("kernel", "1x1")); } else if ((type == LayerType::DepthwiseConvolution2d) || (type == LayerType::Convolution2d)) { params.insert(std::make_pair("stride", "1x1")); params.insert(std::make_pair("kernel", "1x1")); params.insert(std::make_pair("padding", "0x0x0x0")); params.insert(std::make_pair("dilation", "1x1")); } return params; } // Creates mappings for substitution template <const unsigned int SIZE> Mappings CreateSubstitutionMappings(TestLayerType original, TestLayerType replacement, std::array<const unsigned int, SIZE> inputDimensions, std::array<const unsigned int, SIZE> outputDimensions) { Mappings mappings; Layers orgLayers, replacementLayers; Shape inputTensorShape, outputTensorShape; AdditionalLayerParams params; inputTensorShape = Shape(inputDimensions.data(), (inputDimensions.data() + inputDimensions.size())); outputTensorShape = Shape(outputDimensions.data(), (outputDimensions.data() + outputDimensions.size())); auto tensors = Tensors({ std::make_pair("firstInput", armnn::SimpleInputOutput("firstInput", inputTensorShape)), std::make_pair("firstOutput", armnn::SimpleInputOutput("firstOutput", outputTensorShape)) }); std::map<std::string, ActivationFunction> mapStringToActivationFunction = armnn::ethosnbackend::GetMapStringToActivationFunction(); if (!original.name.empty()) { BOOST_TEST((mapStringToActivationFunction.find(original.name) != mapStringToActivationFunction.end())); } if (!replacement.name.empty()) { BOOST_TEST((mapStringToActivationFunction.find(replacement.name) != mapStringToActivationFunction.end())); } switch (original.layer) { case LayerType::Activation: BOOST_TEST(original.name.empty() != true); orgLayers = Layers({ armnn::SimpleLayer("Activation", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, { std::make_pair("function", original.name) }) }); break; case LayerType::DepthwiseConvolution2d: orgLayers = Layers({ armnn::SimpleLayer("DepthwiseConvolution2d", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::L2Normalization: orgLayers = Layers( { armnn::SimpleLayer("L2Normalization", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::Floor: orgLayers = Layers({ armnn::SimpleLayer( "Floor", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::Softmax: orgLayers = Layers({ armnn::SimpleLayer( "Softmax", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::Output: orgLayers = Layers({ armnn::SimpleLayer( "Output", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::LogSoftmax: orgLayers = Layers({ armnn::SimpleLayer( "LogSoftmax", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::DepthToSpace: orgLayers = Layers({ armnn::SimpleLayer( "DepthToSpace", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::Convolution2d: orgLayers = Layers( { armnn::SimpleLayer("Convolution2d", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; default: ARMNN_ASSERT_MSG(false, "Unsupported substitutable layer type\n"); break; } switch (replacement.layer) { case LayerType::Activation: BOOST_TEST(replacement.name.empty() != true); replacementLayers = Layers({ armnn::SimpleLayer("Activation", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, { std::make_pair("function", replacement.name) }) }); break; case LayerType::Convolution2d: params = CreateAdditionalParams(LayerType::Convolution2d); replacementLayers = Layers( { armnn::SimpleLayer("Convolution2d", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, params) }); break; case LayerType::TransposeConvolution2d: params = CreateAdditionalParams(LayerType::TransposeConvolution2d); replacementLayers = Layers({ armnn::SimpleLayer( "TransposeConvolution2d", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, params) }); break; case LayerType::DepthwiseConvolution2d: params = CreateAdditionalParams(LayerType::DepthwiseConvolution2d); replacementLayers = Layers({ armnn::SimpleLayer( "DepthwiseConvolution2d", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, params) }); break; case LayerType::FullyConnected: ARMNN_LOG(info) << "Create a fully connected mapping\n"; replacementLayers = Layers( { armnn::SimpleLayer("FullyConnected", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, {}) }); break; case LayerType::Pooling2d: ARMNN_LOG(info) << "Create a Pooling2d mapping\n"; params = CreateAdditionalParams(LayerType::Pooling2d); replacementLayers = Layers({ armnn::SimpleLayer("Pooling2d", { armnn::SimpleInputOutput("firstInput", inputTensorShape) }, { "firstOutput" }, params) }); break; default: ARMNN_ASSERT_MSG(false, "Unsupported replacement layer type\n"); break; } mappings.emplace_back(tensors, orgLayers, replacementLayers); return mappings; } std::string CreateExclusionMappings(const EthosNConfig config = EthosNConfig()) { std::string mappings; mappings += "pattern:\n"; mappings += "input firstInput 1x16x16x16\n"; mappings += "output firstOutput 1x_x_x_\n"; mappings += "Activation (firstInput) (firstOutput) ((function=TanH))\n"; mappings += "graph-replacement:\n"; mappings += "Excluded (firstInput) (firstOutput)\n"; mappings += "pattern:\n"; mappings += "input firstInput 1x_x_x_\n"; mappings += "output firstOutput 1x_x_x_\n"; mappings += "StandIn (firstInput) (firstOutput) ((name=namew))\n"; mappings += "graph-replacement:\n"; mappings += "Excluded (firstInput) (firstOutput)\n"; std::ofstream mappingStream(config.m_PerfMappingFile); if (mappingStream.is_open()) { mappingStream << mappings; } return mappings; } std::string CreateMappingsWithLayerName(const EthosNConfig config = EthosNConfig()) { std::string mappings; mappings += "pattern:\n"; mappings += "input firstInput 1x16x16x16\n"; mappings += "output firstOutput 1x16x16x16\n"; mappings += "DepthwiseConvolution2d (firstInput) (firstOutput) ((name=depth))\n"; mappings += "graph-replacement:\n"; mappings += "Convolution2d (firstInput) (firstOutput)\n"; std::ofstream mappingStream(config.m_PerfMappingFile); if (mappingStream.is_open()) { mappingStream << mappings; } return mappings; } void CreateMappingsWithInvalidAdditionalArguments1(const EthosNConfig config = EthosNConfig()) { std::string mapping; // Invalid additional parameter name ie kernell mapping = "pattern:\n"; mapping += "input firstInput 1x16x16x16\n"; mapping += "output firstOutput 1x16x16x16\n"; mapping += "DepthwiseConvolution2d (firstInput) (firstOutput) ((name=depth))\n"; mapping += "graph-replacement:\n"; mapping += "Convolution2d (firstInput) (firstOutput) ((kernell=1x1))\n"; std::ofstream mappingStream(config.m_PerfMappingFile); if (mappingStream.is_open()) { mappingStream << mapping; } } void CreateMappingsWithInvalidAdditionalArguments2(const EthosNConfig config = EthosNConfig()) { std::string mapping; // Invalid value of additional parameter ie stride=1 mapping = "pattern:\n"; mapping += "input firstInput 1x16x16x16\n"; mapping += "output firstOutput 1x16x16x16\n"; mapping += "Activation (firstInput) (firstOutput) ((function=TanH))\n"; mapping += "graph-replacement:\n"; mapping += "DepthwiseConvolution2d (firstInput) (firstOutput) ((stride=1))\n"; std::ofstream mappingStream(config.m_PerfMappingFile); if (mappingStream.is_open()) { mappingStream << mapping; } } void CreateMappingsWithInvalidAdditionalArguments3(const EthosNConfig config = EthosNConfig()) { std::string mapping; // Required additional parameters not provided // Pooling2d requires ((function=something)) mapping = "pattern:\n"; mapping += "input firstInput 1x16x16x16\n"; mapping += "output firstOutput 1x16x16x16\n"; mapping += "Pooling2d (firstInput) (firstOutput) ((name=depth))\n"; mapping += "graph-replacement:\n"; mapping += "Activation (firstInput) (firstOutput) ((function=Sigmoid))\n"; std::ofstream mappingStream(config.m_PerfMappingFile); if (mappingStream.is_open()) { mappingStream << mapping; } } void CreateMappingsWithInvalidAdditionalArguments4(const EthosNConfig config = EthosNConfig()) { std::string mapping; // Unsupported value provided for additional parameter // Pooling2d is only supported with ((function=Average)) mapping = "pattern:\n"; mapping += "input firstInput 1x16x16x16\n"; mapping += "output firstOutput 1x16x16x16\n"; mapping += "Activation (firstInput) (firstOutput) ((name=depth), (function=ReLu))\n"; mapping += "graph-replacement:\n"; mapping += "Pooling2d (firstInput) (firstOutput) ((function=Max))\n"; std::ofstream mappingStream(config.m_PerfMappingFile); if (mappingStream.is_open()) { mappingStream << mapping; } } void CreateMappingsWithValidAdditionalArguments(const EthosNConfig config = EthosNConfig()) { std::string mappings; mappings += "pattern:\n"; mappings += "input firstInput 1x16x16x16\n"; mappings += "output firstOutput 1x16x16x16\n"; mappings += "Activation, (firstInput), (firstOutput), ((name=myact), (function=ReLu))\n"; mappings += "graph-replacement:\n"; mappings += "Pooling2d, (firstInput), (firstOutput), ((kernel=3x3), (stride=2x2), (padding=2x2x2x2), " "(function=Average), (name=mypool))\n"; std::ofstream mappingStream(config.m_PerfMappingFile); if (mappingStream.is_open()) { mappingStream << mappings; } } EthosNConfig CreateEthosNConfig(TempDir& tmpDir) { const std::string configFile = tmpDir.Str() + "/config.txt"; { std::ofstream configStream(configFile); armnn::EthosNConfig config; config.m_PerfOnly = true; config.m_PerfMappingFile = tmpDir.Str() + "/mapping.txt"; configStream << config; std::ofstream mappingStream(config.m_PerfMappingFile); mappingStream << ""; } SetEnv(armnn::EthosNConfig::CONFIG_FILE_ENV, configFile.c_str()); return armnn::GetEthosNConfig(); } void CreateUnoptimizedNetwork(INetwork& net) { armnn::IConnectableLayer* const inputLayer = net.AddInputLayer(0, "input layer"); BOOST_TEST(inputLayer); // Arm NN weights tensor shape is OHWI (out channels, height, width, in channels) for NHWC const TensorInfo convTensorInfo(TensorShape({ 1, 16, 16, 16 }), DataType::QAsymmU8, 0.9f, 0); const TensorInfo convWeightsInfo(TensorShape({ 16, 1, 1, 16 }), armnn::DataType::QAsymmU8, 0.9f, 0); const std::vector<uint8_t> convWeightsData(convWeightsInfo.GetNumElements()); const armnn::ConstTensor convWeights(convWeightsInfo, convWeightsData); armnn::Convolution2dDescriptor convDesc{}; convDesc.m_StrideX = 1; convDesc.m_StrideY = 1; convDesc.m_DataLayout = armnn::DataLayout::NHWC; armnn::IConnectableLayer* convLayer = net.AddConvolution2dLayer(convDesc, convWeights, EmptyOptional(), "convolution layer"); ActivationDescriptor tanDesc{}; tanDesc.m_A = 100; tanDesc.m_B = 0; tanDesc.m_Function = ActivationFunction::TanH; armnn::IConnectableLayer* const tanhLayer = net.AddActivationLayer(tanDesc, "TanH layer"); BOOST_TEST(tanhLayer); armnn::IConnectableLayer* const outputLayer = net.AddOutputLayer(0, "output layer"); BOOST_TEST(outputLayer); TensorInfo inputTensorInfo(TensorShape({ 1, 16, 16, 16 }), armnn::DataType::QAsymmU8); inputTensorInfo.SetQuantizationOffset(0); inputTensorInfo.SetQuantizationScale(0.9f); TensorInfo outputTensorInfo(TensorShape({ 1, 16, 16, 16 }), armnn::DataType::QAsymmU8); outputTensorInfo.SetQuantizationOffset(0); outputTensorInfo.SetQuantizationScale(1.0f / 256); inputLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(0)); inputLayer->GetOutputSlot(0).SetTensorInfo(inputTensorInfo); convLayer->GetOutputSlot(0).SetTensorInfo(convTensorInfo); convLayer->GetOutputSlot(0).Connect(tanhLayer->GetInputSlot(0)); tanhLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0)); tanhLayer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo); } } // namespace BOOST_AUTO_TEST_SUITE(EthosNMapping) // // Tests that the Ethos-N mapping file is parsed correctly // BOOST_AUTO_TEST_CASE(TestTrimm) { BOOST_TEST(armnn::Trim(std::string("")).size() == 0); BOOST_TEST(armnn::Trim(std::string("\t ")).size() == 0); BOOST_TEST(armnn::Trim(std::string(" pattern:\t")) == std::string("pattern:")); BOOST_TEST(armnn::Trim(std::string("input firstInput, 1x_x_x_ \n\t")) == std::string("input firstInput, 1x_x_x_")); } BOOST_AUTO_TEST_CASE(TestPrune) { // Given std::string s = "\n\tHello, world! \r"; // When armnn::Prune(s); // Then BOOST_TEST(s == std::string("Hello,world!")); } BOOST_AUTO_TEST_CASE(TestProcessPattern) { // Given const std::vector<std::string> buf1 = { "input, firstInput, 1x_x_x_", "\toutput, firstOutput, 1x_x_x_", "Activation, (firstInput), (firstOutput), ((function=TanH))", }; Tensors tensors1; Layers layers1; const std::vector<std::string> buf2 = { "input firstInput, 1x_x_x_", "input secondInput, 1x1x2x3", "output firstOutput, 1x_x_x_", "StandIn, (firstInput, secondInput), (firstOutput), ((\tfunction= CustomOp), (name=somename))", }; Tensors tensors2; Layers layers2; const std::vector<std::string> buf3 = { "input firstInput, 1x_x_x_", "output firstOutput, 1x_x_x_", "output secondOutput, 1x_x_x_", "Excluded, (firstInput), (firstOutput, secondOutput)", }; Tensors tensors3; Layers layers3; // When armnn::ProcessPattern(buf1, tensors1, layers1); // Then BOOST_TEST( tensors1 == Tensors({ std::make_pair("firstInput", armnn::SimpleInputOutput("firstInput", Shape({ 1, 0, 0, 0 }))), std::make_pair("firstOutput", armnn::SimpleInputOutput("firstOutput", Shape({ 1, 0, 0, 0 }))) })); BOOST_TEST(layers1 == Layers({ armnn::SimpleLayer("Activation", { armnn::SimpleInputOutput("firstInput", Shape({ 1, 0, 0, 0 })) }, { "firstOutput" }, { std::make_pair("function", "TanH") }) })); // And when armnn::ProcessPattern(buf2, tensors2, layers2); // Then BOOST_TEST( tensors2 == Tensors({ std::make_pair("firstInput", armnn::SimpleInputOutput("firstInput", Shape({ 1, 0, 0, 0 }))), std::make_pair("secondInput", armnn::SimpleInputOutput("secondInput", Shape({ 1, 1, 2, 3 }))), std::make_pair("firstOutput", armnn::SimpleInputOutput("firstOutput", Shape({ 1, 0, 0, 0 }))) })); BOOST_TEST(layers2 == Layers({ armnn::SimpleLayer( "StandIn", { armnn::SimpleInputOutput("firstInput", Shape({ 1, 0, 0, 0 })), armnn::SimpleInputOutput("secondInput", Shape({ 1, 1, 2, 3 })) }, { "firstOutput" }, { std::map<std::string, std::string>{ std::make_pair("function", "CustomOp"), std::make_pair("name", "somename") } }) })); // And when armnn::ProcessPattern(buf3, tensors3, layers3); // Then BOOST_TEST( tensors3 == Tensors({ std::make_pair("firstInput", armnn::SimpleInputOutput("firstInput", Shape({ 1, 0, 0, 0 }))), std::make_pair("firstOutput", armnn::SimpleInputOutput("firstOutput", Shape({ 1, 0, 0, 0 }))), std::make_pair("secondOutput", armnn::SimpleInputOutput("secondOutput", Shape({ 1, 0, 0, 0 }))) })); BOOST_TEST(layers3 == Layers({ armnn::SimpleLayer("Excluded", { armnn::SimpleInputOutput("firstInput", Shape({ 1, 0, 0, 0 })) }, { "firstOutput", "secondOutput" }, {}) })); } BOOST_AUTO_TEST_CASE(TestProcessBadInput) { const std::vector<std::string> buf = { "input_ firstInput, 1x_x_x_", "output? firstOutput, 1x_x_x_", "Activation, (firstInput), (firstOutput), ((function=TanH))", }; Tensors tensors; Layers layers; BOOST_CHECK_THROW(armnn::ProcessPattern(buf, tensors, layers), armnn::ParseException); try { armnn::ProcessPattern(buf, tensors, layers); } catch (const armnn::ParseException& e) { std::string err = "Syntax error:\ninput_ firstInput, 1x_x_x_\nSyntax error:\noutput? firstOutput, " "1x_x_x_\nUndefined input: 'firstInput'\n"; BOOST_CHECK_EQUAL(err, e.what()); } } template <const unsigned int SIZE> Mappings CreateMappings(TestLayerType originalType, TestLayerType replacementType, std::array<const unsigned int, SIZE> inputDimensions, std::array<const unsigned int, SIZE> outputDimensions) { Mappings ethosNMappings; std::map<std::string, LayerType> mapStringToLayerType = armnn::ethosnbackend::GetMapStringToLayerType(); ethosNMappings = CreateSubstitutionMappings<SIZE>(originalType, replacementType, inputDimensions, outputDimensions); //Test if there is at least one mapping ARMNN_ASSERT((ethosNMappings.size() >= 1)); //Test if the mapping layer types are as intended BOOST_TEST(((mapStringToLayerType.find(ethosNMappings[0].m_ReplacementLayers[0].m_LayerTypeName)->second) == replacementType.layer)); BOOST_TEST(((mapStringToLayerType.find(ethosNMappings[0].m_PatternLayers[0].m_LayerTypeName))->second == originalType.layer)); //Test for single layer mappings BOOST_TEST((ethosNMappings.size() == 1)); BOOST_TEST((ethosNMappings[0].m_PatternLayers.size() == 1)); BOOST_TEST((ethosNMappings[0].m_ReplacementLayers.size() == 1)); return ethosNMappings; } Mappings CreateMappingsFromList(TestLayerTypeList testLayerTypeList) { Mappings allMaps; for (TestLayerTypeElem elem : testLayerTypeList) { TestLayerType input = std::get<0>(elem); TestLayerType output = std::get<1>(elem); Mappings currentMap; // We need to create the inputDimensions and outputDimensions as per // those written in mapping-tests/*.txt files if ((input.layer == LayerType::FullyConnected) || (output.layer == LayerType::FullyConnected)) { std::array<const unsigned int, 2> inputDimensions{ { 1, 16 } }; std::array<const unsigned int, 2> outputDimensions{ { 1, 1 } }; currentMap = CreateMappings<2>(input, output, inputDimensions, outputDimensions); } else { std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; currentMap = CreateMappings<4>(input, output, inputDimensions, outputDimensions); } allMaps.insert(allMaps.end(), currentMap.begin(), currentMap.end()); } return allMaps; } template <const unsigned int SIZE> armnn::SubgraphView::SubgraphViewPtr CreateUnoptimizedSubgraph(Graph& graph, SimpleLayer layer, std::array<const unsigned int, SIZE> inputDimensions, std::array<const unsigned int, SIZE> outputDimensions) { Layer *inputLayer, *outputLayer, *operationLayer; Shape inputOutputTensorShape; std::map<std::string, LayerType> mapStringToLayerType = armnn::ethosnbackend::GetMapStringToLayerType(); LayerType type = mapStringToLayerType.find(layer.m_LayerTypeName)->second; TensorInfo inputInfo(static_cast<unsigned int>(inputDimensions.size()), inputDimensions.data(), DataType::QAsymmU8, 1.0f, 0); TensorInfo outputInfo(static_cast<unsigned int>(outputDimensions.size()), outputDimensions.data(), DataType::QAsymmU8, 1.0f, 0); if (type == LayerType::Activation) { std::string activationFuncOriginalLayer = layer.m_LayerParams.find("function")->second; std::string name = layer.m_LayerParams["name"]; operationLayer = ethosnbackend::CreateActivationLayer(graph, activationFuncOriginalLayer, name); } else if ((type == LayerType::Convolution2d) || (type == LayerType::TransposeConvolution2d) || (type == LayerType::DepthwiseConvolution2d)) { unsigned int inputChannels = inputInfo.GetShape()[3]; DataType weightDataType = inputInfo.GetDataType(); operationLayer = ethosnbackend::CreateConvolutionLayer(type, graph, inputChannels, layer.m_LayerParams, weightDataType, DataType::Signed32); } else if (type == LayerType::FullyConnected) { operationLayer = ethosnbackend::CreateFullyConnectedLayer(graph, inputInfo, outputInfo, layer.m_LayerParams); } else if (type == LayerType::Pooling2d) { operationLayer = ethosnbackend::CreatePooling2dLayer(graph, layer.m_LayerParams); } BOOST_TEST(operationLayer); operationLayer->GetOutputSlot(0).SetTensorInfo(outputInfo); // Construct the graph inputLayer = graph.AddLayer<InputLayer>(0, "input layer"); BOOST_TEST(inputLayer); inputLayer->GetOutputSlot(0).SetTensorInfo(inputInfo); outputLayer = graph.AddLayer<OutputLayer>(0, "output layer"); BOOST_TEST(outputLayer); // Connect the network inputLayer->GetOutputSlot(0).Connect(operationLayer->GetInputSlot(0)); operationLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0)); // Create the subgraph view for the whole network return CreateSubgraphViewFrom(CreateInputsFrom({ operationLayer }), CreateOutputsFrom({ operationLayer }), { operationLayer }); } // This function assumes that there is only one operation layer in the subgraph. // That is because CreateUnoptimizedSubgraph() creates a subgraph with one input // layer , one operation layer and one output layer. If in future, we want to // validate subgraphs with multiple operation layers, then this function should // be changed accordingly. bool IsLayerPresentInSubgraph(armnn::Graph& graph, LayerType type, AdditionalLayerParams params = { { "", "" } }) { const std::list<Layer*> newGraphLayers(graph.begin(), graph.end()); bool match = false; for (Layer* layer : newGraphLayers) { if (layer->GetType() == type) { match = true; // Check if the caller has passed any additional layer parameters if (!((*params.begin()).first.empty())) { // Note:- Currently we only check for those additionalParameters which are // provided by CreateMappingsWithValidAdditionalArguments(). This has been // done to reduce the scope for the test. // Our aim is to validate that the layer has set the correct values for the // additional parameters which are specified by the mapping file. Pooling2dLayer* poolLayer = nullptr; ActivationLayer* actLayer = nullptr; Pooling2dDescriptor poolDesc; ActivationDescriptor actDesc; switch (layer->GetType()) { case armnn::LayerType::Pooling2d: poolLayer = PolymorphicDowncast<Pooling2dLayer*>(layer); break; case armnn::LayerType::Activation: actLayer = PolymorphicDowncast<ActivationLayer*>(layer); break; default: return true; } if (poolLayer != nullptr) { poolDesc = poolLayer->GetParameters(); if (!params["function"].empty()) { auto poolAlgo = armnn::ethosnbackend::GetMapStringToPoolingAlgorithm(); auto m_PoolType = poolAlgo.find(params["function"])->second; BOOST_TEST((m_PoolType == poolDesc.m_PoolType)); } if (!params["stride"].empty()) { auto stride = GetLayerParameterValue(params, "stride"); BOOST_TEST((poolDesc.m_StrideX == stride[ethosnbackend::STRIDE_X])); BOOST_TEST((poolDesc.m_StrideY == stride[ethosnbackend::STRIDE_Y])); } if (!params["kernel"].empty()) { auto kernel = GetLayerParameterValue(params, "kernel"); BOOST_TEST((poolDesc.m_PoolHeight = kernel[ethosnbackend::KERNEL_HEIGHT])); BOOST_TEST((poolDesc.m_PoolWidth = kernel[ethosnbackend::KERNEL_WIDTH])); } if (!params["padding"].empty()) { auto padding = GetLayerParameterValue(params, "padding"); BOOST_TEST((poolDesc.m_PadBottom == padding[ethosnbackend::PAD_BOTTOM])); BOOST_TEST((poolDesc.m_PadLeft == padding[ethosnbackend::PAD_LEFT])); BOOST_TEST((poolDesc.m_PadRight == padding[ethosnbackend::PAD_RIGHT])); BOOST_TEST((poolDesc.m_PadTop == padding[ethosnbackend::PAD_TOP])); } } if (actLayer != nullptr) { actDesc = actLayer->GetParameters(); if (!params["function"].empty()) { auto actFunc = armnn::ethosnbackend::GetMapStringToActivationFunction(); auto m_Function = actFunc.find(params["function"])->second; BOOST_TEST((m_Function == actDesc.m_Function)); } } // Check for the common parameters ie 'name' if (!params["name"].empty()) { BOOST_TEST((params["name"] == layer->GetNameStr())); } } } } return match; } template <const unsigned int SIZE> void TestSubgraphSubstitution(TestLayerType originalType, TestLayerType replacementType, std::array<const unsigned int, SIZE> inputDimensions, std::array<const unsigned int, SIZE> outputDimensions, bool validSubstitution = true) { using namespace testing_utils; Graph graph, graph2; TempDir tmpDir; EthosNConfig ethosnConfig = CreateEthosNConfig(tmpDir); auto backendObjPtr = CreateBackendObject(EthosNBackendId()); BOOST_TEST((backendObjPtr != nullptr)); auto ethosNMappings = CreateMappings<SIZE>(originalType, replacementType, inputDimensions, outputDimensions); auto subGraphOriginal = CreateUnoptimizedSubgraph<SIZE>(graph, ethosNMappings[0].m_PatternLayers[0], inputDimensions, outputDimensions); auto subGraphOriginal2 = CreateUnoptimizedSubgraph<SIZE>(graph2, ethosNMappings[0].m_PatternLayers[0], inputDimensions, outputDimensions); //Validate that the graph2 had the layer of the original type BOOST_TEST(IsLayerPresentInSubgraph(graph2, originalType.layer)); // When OptimizationViews optimizationViews; armnn::CreatePreCompiledLayerInGraph(optimizationViews, *subGraphOriginal, ethosNMappings, {}); ethosnbackend::ApplyMappings(ethosNMappings, graph2); // Then validate that armnn was able to compile the graph successfully BOOST_TEST(optimizationViews.Validate(*subGraphOriginal)); BOOST_TEST(optimizationViews.GetSubstitutions().size() == 1); BOOST_TEST(optimizationViews.GetFailedSubgraphs().size() == 0); BOOST_TEST(optimizationViews.GetUntouchedSubgraphs().size() == 0); auto substitutions = optimizationViews.GetSubstitutions(); BOOST_TEST(substitutions.size() == 1); bool subgraphsAreSame = (*subGraphOriginal == substitutions[0].m_SubstitutableSubgraph); BOOST_TEST(subgraphsAreSame); //Currently we replace a single layer with another single layer BOOST_TEST((substitutions[0].m_ReplacementSubgraph.GetLayers().size() == 1)); // Validate that the substitution really took place. We need to do this as armnn // changes the layer type to pre-compiled BOOST_TEST((IsLayerPresentInSubgraph(graph2, replacementType.layer) == validSubstitution)); } static const char* MAPPING_FILE_TEST_DIRECTORY = "armnn-ethos-n-backend/test/mapping-tests/"; struct TestParseMappingFileData { const char* fileName; TestLayerTypeList layers; ExceptionCases exception = NoException; std::string exceptionMessage = ""; }; static TestParseMappingFileData TestParseMappingFileDataset[] = { { //.fileName = "inActivationBoundedReLu_outActivationSigmoid.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Activation, "BoundedReLu" }), TestLayerType({ LayerType::Activation, "Sigmoid" })), } }, { //.fileName = "inActivationBoundedReLu_outConvolution2d.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Activation, "BoundedReLu" }), TestLayerType({ LayerType::Convolution2d, "" })), } }, { //.fileName = "inActivationBoundedReLu_outActivationReLu.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Activation, "BoundedReLu" }), TestLayerType({ LayerType::Activation, "ReLu" })) } }, { //.fileName = "inDepthToSpace_outTransposeConvolution2d.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::DepthToSpace, "" }), TestLayerType({ LayerType::TransposeConvolution2d, "" })) } }, { //.fileName = "inActivationBoundedReLu_outDepthwiseConvolution2d.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Activation, "BoundedReLu" }), TestLayerType({ LayerType::DepthwiseConvolution2d, "" })) } }, { //.fileName = "inActivationBoundedReLu_outFullyConnected.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Activation, "BoundedReLu" }), TestLayerType({ LayerType::FullyConnected, "" })) } }, { //.fileName = "inActivationBoundedReLu_outPooling2d.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Activation, "BoundedReLu" }), TestLayerType({ LayerType::Pooling2d, "" })) } }, { //.fileName = "inDepthwiseConvolution2d_outConvolution2d.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::DepthwiseConvolution2d, "" }), TestLayerType({ LayerType::Convolution2d, "" })) } }, { //.fileName = "inL2Normalization_outDepthwiseConvolution2d.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::L2Normalization, "" }), TestLayerType({ LayerType::DepthwiseConvolution2d, "" })) } }, { //.fileName = "inFloor_outActivationReLu.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Floor, "" }), TestLayerType({ LayerType::Activation, "ReLu" })) } }, { //.fileName = "inSoftmax_outActivationSigmoid.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Softmax, "" }), TestLayerType({ LayerType::Activation, "Sigmoid" })) } }, { //.fileName = "inConvolution2d_outPooling2d.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::Convolution2d, "" }), TestLayerType({ LayerType::Pooling2d, "" })) } }, { //.fileName = "inLogSoftmax_outFullyConnected.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::LogSoftmax, "" }), TestLayerType({ LayerType::FullyConnected, "" })) } }, { //.fileName = "multiLayerMapping.txt", //.layers = { std::make_tuple( // .layer, .name TestLayerType({ LayerType::DepthwiseConvolution2d, "" }), TestLayerType({ LayerType::Convolution2d, "" })), std::make_tuple( // .layer, .name TestLayerType({ LayerType::Output, "" }), TestLayerType({ LayerType::Pooling2d, "" })), std::make_tuple( // .layer, .name TestLayerType({ LayerType::L2Normalization, "" }), TestLayerType({ LayerType::DepthwiseConvolution2d, "" })) } }, { //.fileName = "wrongSourceMapping.txt", //.layers = {}, // .exception ExceptionCases::ParseException, // .exceptionMessage "L2Normalization_XYZ, (firstInput), (firstOutput)" }, { //.fileName = "wrongReplacementMapping.txt", //.layers = {}, // .exception ExceptionCases::ParseException, // .exceptionMessage "DepthwiseConvolution2d_XYZ, (firstInput), (firstOutput)" }, { //.fileName = "wrongSyntaxAdditionalParams.txt", // .layers = {}, // .exception ExceptionCases::ParseException, // .exceptionMessage "Additional parameters are to be enclosed in (( ))" }, { //.fileName = "wrongSyntaxTooManyParams.txt", // .layers = {}, // .exception ExceptionCases::ParseException, // .exceptionMessage "Too many parameters specified" }, { //.fileName = "wrongSyntaxAdditionalParams2.txt", // .layers = {}, // .exception ExceptionCases::ParseException, // .exceptionMessage "Syntax error: Additional parameters should be in (name1=value1),(name2=value2) format" }, { //.fileName = "wrongSyntaxAdditionalParams3.txt", // .layers = {}, // .exception ExceptionCases::ParseException, // .exceptionMessage "Syntax error: Additional parameters should be in (name1=value1),(name2=value2) format" } }; std::ostream& boost_test_print_type(std::ostream& os, const TestParseMappingFileData& data) { os << "filename: " << data.fileName << std::endl; for (size_t elemIdx = 0; elemIdx < data.layers.size(); elemIdx++) { TestLayerTypeElem elem = data.layers[elemIdx]; TestLayerType input = std::get<0>(elem); TestLayerType output = std::get<1>(elem); os << "Layer " << elemIdx << ":" << std::endl; os << "\tInputLayerType: " << GetLayerTypeAsCString(input.layer) << " "; os << "\tInputLayerName: " << input.name << std::endl; os << "\tOutputLayerType: " << GetLayerTypeAsCString(output.layer) << " "; os << "\tOutputLayerName: " << output.name << std::endl; } return os; } BOOST_DATA_TEST_CASE( TestParseMappingFile, // Test case name // see https://www.boost.org/doc/libs/1_72_0/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation/generators.html#boost_test.tests_organization.test_cases.test_case_generation.generators.c_arrays // for some explanation on how the date sets are generated bdata::xrange(ARRAY_SIZE(TestParseMappingFileDataset)) ^ bdata::make(TestParseMappingFileDataset), xr, // Test number (not used here) arrayElement) // Current entry of the TestParseMappingFileDataset array to be tested { (void)(xr); //Get the input parameter of the tests const char* fileName = arrayElement.fileName; std::string fullFileName(MAPPING_FILE_TEST_DIRECTORY); fullFileName.append(fileName); TestLayerTypeList layers = arrayElement.layers; ExceptionCases gotException; ExceptionCases expectException = arrayElement.exception; std::string exceptionMessage = arrayElement.exceptionMessage; //Execute the test code Mappings inputMapping = CreateMappingsFromList(layers); Mappings parsedMapping; try { parsedMapping = GetMappings(fullFileName); gotException = ExceptionCases::NoException; } catch (const armnn::ParseException& e) { gotException = ExceptionCases::ParseException; BOOST_TEST((std::string(e.what()).find(exceptionMessage) != std::string::npos)); } catch (const armnn::InvalidArgumentException& e) { gotException = ExceptionCases::InvalidArgumentException; BOOST_TEST((std::string(e.what()).find(exceptionMessage) != std::string::npos)); } //Check the result BOOST_CHECK_EQUAL(gotException, expectException); BOOST_TEST(inputMapping == parsedMapping); } BOOST_AUTO_TEST_CASE(TestAllSubgraphSubstitution) { TestLayerType org, replacement; { std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; org.layer = LayerType::Activation; org.name = "BoundedReLu"; replacement.layer = LayerType::Activation; replacement.name = "Sigmoid"; TestSubgraphSubstitution<4>(org, replacement, inputDimensions, outputDimensions); } { std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; org.layer = LayerType::Activation; org.name = "BoundedReLu"; replacement.layer = LayerType::Convolution2d; replacement.name = ""; TestSubgraphSubstitution<4>(org, replacement, inputDimensions, outputDimensions); } { std::array<const unsigned int, 3> inputDimensions{ { 1, 16, 16 } }; std::array<const unsigned int, 3> outputDimensions{ { 1, 16, 16 } }; org.layer = LayerType::Activation; org.name = "BoundedReLu"; replacement.layer = LayerType::Activation; replacement.name = "ReLu"; TestSubgraphSubstitution<3>(org, replacement, inputDimensions, outputDimensions); } { // This is going to increase the size of the output by two times // as we are using a fixed value of strideX (which is 2) and // strideY (which is 2) std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 32, 32, 16 } }; org.layer = LayerType::Activation; org.name = "TanH"; replacement.layer = LayerType::TransposeConvolution2d; replacement.name = ""; TestSubgraphSubstitution<4>(org, replacement, inputDimensions, outputDimensions); } { std::array<const unsigned int, 3> inputDimensions{ { 1, 16, 16 } }; std::array<const unsigned int, 3> outputDimensions{ { 1, 16, 16 } }; // Test an invalid mapping // Here Activation is to be substituted with Convolution2d when input/ouput // tensor shape is of three dimensions. // This is invalid as convolution expects input/output tensor shape to be of // four dimensions. try { org.layer = LayerType::Activation; org.name = "BoundedReLu"; replacement.layer = LayerType::Convolution2d; replacement.name = ""; TestSubgraphSubstitution<3>(org, replacement, inputDimensions, outputDimensions, false); } catch (const armnn::InvalidArgumentException& e) { std::string err = "Invalid dimension index: 3 (number of dimensions is 3)"; BOOST_TEST((std::string(e.what()).find(err) != std::string::npos)); } } { std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; org.layer = LayerType::Activation; org.name = "BoundedReLu"; replacement.layer = LayerType::DepthwiseConvolution2d; replacement.name = ""; TestSubgraphSubstitution<4>(org, replacement, inputDimensions, outputDimensions); } { std::array<const unsigned int, 2> inputDimensions{ { 1, 16 } }; std::array<const unsigned int, 2> outputDimensions{ { 1, 1 } }; org.layer = LayerType::Activation; org.name = "BoundedReLu"; replacement.layer = LayerType::FullyConnected; replacement.name = ""; TestSubgraphSubstitution<2>(org, replacement, inputDimensions, outputDimensions); } { std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; org.layer = LayerType::Activation; org.name = "BoundedReLu"; replacement.layer = LayerType::Pooling2d; replacement.name = ""; TestSubgraphSubstitution<4>(org, replacement, inputDimensions, outputDimensions); } } BOOST_AUTO_TEST_CASE(TestLayerInclusion) { // Given TempDir tmpDir; armnn::g_EthosNConfig = CreateEthosNConfig(tmpDir); TensorInfo inputInfo({ 1, 16, 16, 16 }, DataType::QAsymmU8, 1.0f, 0); TensorInfo outputInfo({ 1, 16, 16, 16 }, DataType::QAsymmU8, 1.0f / 256, 0); ActivationDescriptor activationDescriptor; StandInDescriptor standInDescriptor{ 1, 1 }; std::string reason; // When auto backendObjPtr = CreateBackendObject(EthosNBackendId()); BOOST_TEST((backendObjPtr != nullptr)); auto layerSupport = backendObjPtr->GetLayerSupport(); // Then BOOST_TEST(layerSupport->IsActivationSupported(inputInfo, outputInfo, activationDescriptor, reason) == true); BOOST_TEST(reason.empty()); BOOST_TEST(layerSupport->IsStandInSupported(std::vector<const TensorInfo*>{ &inputInfo }, std::vector<const TensorInfo*>{ &outputInfo }, standInDescriptor, reason) == true); BOOST_TEST(reason.empty()); } BOOST_AUTO_TEST_CASE(TestAdditionalParameters) { // Given TempDir tmpDir; armnn::g_EthosNConfig = CreateEthosNConfig(tmpDir); typedef void (*CreateMappingsWithAdditionalArgs)(const EthosNConfig); typedef struct { CreateMappingsWithAdditionalArgs createMappingFunc; std::string exceptionMessage; ExceptionCases exception; } mappingTestCases; std::vector<mappingTestCases> testCases; testCases.push_back({ CreateMappingsWithInvalidAdditionalArguments1, "Invalid Argument: Layer Parameter \"kernell\"is unknown", ExceptionCases::InvalidArgumentException }); testCases.push_back({ CreateMappingsWithInvalidAdditionalArguments2, "Invalid Value: The expected format is ((stride=_x_))", ExceptionCases::InvalidArgumentException }); testCases.push_back({ CreateMappingsWithInvalidAdditionalArguments3, "Invalid Argument: ((function=somefunction)) is needed", ExceptionCases::InvalidArgumentException }); testCases.push_back({ CreateMappingsWithInvalidAdditionalArguments4, "Invalid Value: Only Average Pooling is supported", ExceptionCases::InvalidArgumentException }); testCases.push_back({ CreateMappingsWithValidAdditionalArguments, "", ExceptionCases::NoException }); for (auto test : testCases) { test.createMappingFunc(armnn::g_EthosNConfig); auto ethosNMappings = GetMappings(armnn::g_EthosNConfig.m_PerfMappingFile); Graph graph; std::string exceptionMessage = test.exceptionMessage; auto expectException = test.exception; auto gotException = ExceptionCases::NoException; // When auto originalLayerType = armnn::ethosnbackend::GetLayerType(ethosNMappings[0].m_PatternLayers[0].m_LayerTypeName); auto replacementLayerType = armnn::ethosnbackend::GetLayerType(ethosNMappings[0].m_ReplacementLayers[0].m_LayerTypeName); std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; auto subGraphOriginal = CreateUnoptimizedSubgraph<inputDimensions.size()>( graph, ethosNMappings[0].m_PatternLayers[0], inputDimensions, outputDimensions); BOOST_TEST( IsLayerPresentInSubgraph(graph, originalLayerType, ethosNMappings[0].m_PatternLayers[0].m_LayerParams)); // Then try { ethosnbackend::ApplyMappings(ethosNMappings, graph); BOOST_TEST(IsLayerPresentInSubgraph(graph, replacementLayerType, ethosNMappings[0].m_ReplacementLayers[0].m_LayerParams)); } catch (const armnn::InvalidArgumentException& e) { gotException = ExceptionCases::InvalidArgumentException; BOOST_TEST((std::string(e.what()).find(exceptionMessage) != std::string::npos)); } catch (const armnn::ParseException& e) { gotException = ExceptionCases::InvalidArgumentException; BOOST_TEST((std::string(e.what()).find(exceptionMessage) != std::string::npos)); } BOOST_TEST((gotException == expectException)); } } BOOST_AUTO_TEST_CASE(TestLayerSubstitutionWithName) { // Given TempDir tmpDir; Graph graph; armnn::g_EthosNConfig = CreateEthosNConfig(tmpDir); CreateMappingsWithLayerName(armnn::g_EthosNConfig); std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; auto ethosNMappings = GetMappings(armnn::g_EthosNConfig.m_PerfMappingFile); auto originalLayerType = armnn::ethosnbackend::GetLayerType(ethosNMappings[0].m_PatternLayers[0].m_LayerTypeName); auto replacementLayerType = armnn::ethosnbackend::GetLayerType(ethosNMappings[0].m_ReplacementLayers[0].m_LayerTypeName); // When auto subGraphOriginal = CreateUnoptimizedSubgraph<inputDimensions.size()>( graph, ethosNMappings[0].m_PatternLayers[0], inputDimensions, outputDimensions); BOOST_TEST(IsLayerPresentInSubgraph(graph, originalLayerType)); ethosnbackend::ApplyMappings(ethosNMappings, graph); // Then BOOST_TEST(IsLayerPresentInSubgraph(graph, replacementLayerType)); } BOOST_AUTO_TEST_CASE(TestLayerSubstitutionWithNameMismatch) { // Given TempDir tmpDir; Graph graph; armnn::g_EthosNConfig = CreateEthosNConfig(tmpDir); CreateMappingsWithLayerName(armnn::g_EthosNConfig); std::array<const unsigned int, 4> inputDimensions{ { 1, 16, 16, 16 } }; std::array<const unsigned int, 4> outputDimensions{ { 1, 16, 16, 16 } }; auto ethosNMappings = GetMappings(armnn::g_EthosNConfig.m_PerfMappingFile); auto originalLayerType = armnn::ethosnbackend::GetLayerType(ethosNMappings[0].m_PatternLayers[0].m_LayerTypeName); auto replacementLayerType = armnn::ethosnbackend::GetLayerType(ethosNMappings[0].m_ReplacementLayers[0].m_LayerTypeName); // When // Get the original layer name from the mapping parameters std::string name = ethosNMappings[0].m_PatternLayers[0].m_LayerParams["name"]; // Change the layer name in the mapping parameters ethosNMappings[0].m_PatternLayers[0].m_LayerParams["name"] = "abcd"; auto subGraphOriginal = CreateUnoptimizedSubgraph<inputDimensions.size()>( graph, ethosNMappings[0].m_PatternLayers[0], inputDimensions, outputDimensions); // Revert the layer name in the mapping parameters back to its original. // This will ensure that there is a mismatch of layer name between the // graph's layer and the mapping parameters. ethosNMappings[0].m_PatternLayers[0].m_LayerParams["name"] = name; BOOST_TEST(IsLayerPresentInSubgraph(graph, originalLayerType)); ethosnbackend::ApplyMappings(ethosNMappings, graph); // Then //Then the substitution should fail BOOST_TEST(!(IsLayerPresentInSubgraph(graph, replacementLayerType))); // And the graph should still contain the original layer BOOST_TEST(IsLayerPresentInSubgraph(graph, originalLayerType)); } BOOST_AUTO_TEST_CASE(TestLayerExclusion) { // Given TempDir tmpDir; armnn::g_EthosNConfig = CreateEthosNConfig(tmpDir); CreateExclusionMappings(armnn::g_EthosNConfig); armnn::g_EthosNMappings = GetMappings(armnn::g_EthosNConfig.m_PerfMappingFile); TensorInfo inputInfo({ 1, 16, 16, 16 }, DataType::QAsymmU8, 1.0f, 0); TensorInfo outputInfo({ 1, 16, 16, 16 }, DataType::QAsymmU8, 1.0f / 256, 0); ActivationDescriptor activationDescriptor1; ActivationDescriptor activationDescriptor2; activationDescriptor1.m_Function = ActivationFunction::Sigmoid; activationDescriptor2.m_Function = ActivationFunction::TanH; StandInDescriptor standInDescriptor{ 1, 1 }; std::string reason; // When auto backendObjPtr = CreateBackendObject(EthosNBackendId()); BOOST_TEST((backendObjPtr != nullptr)); auto layerSupport = backendObjPtr->GetLayerSupport(); // Then BOOST_TEST(layerSupport->IsActivationSupported(inputInfo, outputInfo, activationDescriptor1, reason) == true); BOOST_TEST(layerSupport->IsActivationSupported(inputInfo, outputInfo, activationDescriptor2, reason) == false); BOOST_TEST(reason == "Layer declared excluded in mapping file"); BOOST_TEST(layerSupport->IsStandInSupported(std::vector<const TensorInfo*>{ &inputInfo }, std::vector<const TensorInfo*>{ &outputInfo }, standInDescriptor, reason) == false); BOOST_TEST(reason == "Layer declared excluded in mapping file"); } BOOST_AUTO_TEST_CASE(TestLayerExclusionViaArmnn) { // Given TempDir tmpDir; EthosNConfig ethosnConfig = CreateEthosNConfig(tmpDir); CreateExclusionMappings(ethosnConfig); auto backendObjPtr = CreateBackendObject(EthosNBackendId()); BOOST_TEST((backendObjPtr != nullptr)); INetworkPtr net(INetwork::Create()); CreateUnoptimizedNetwork(*net); // When IRuntime::CreationOptions options; IRuntimePtr runtime(IRuntime::Create(options)); std::vector<BackendId> backends = { EthosNBackendId(), "CpuRef" }; IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime->GetDeviceSpec()); // Then armnn::Graph& optimizedGraph = GetGraphForTesting(optNet.get()); Graph::ConstIterator layer = optimizedGraph.cbegin(); auto inputLayer = *layer; BOOST_TEST((inputLayer->GetBackendId() == EthosNBackendId())); ++layer; auto convolutionLayer = *layer; BOOST_TEST((convolutionLayer->GetBackendId() == EthosNBackendId())); ++layer; auto activationLayer = *layer; BOOST_TEST((activationLayer->GetBackendId() == BackendId(Compute::CpuRef))); ++layer; auto outputLayer = *layer; BOOST_TEST((outputLayer->GetBackendId() == BackendId(Compute::CpuRef))); } BOOST_AUTO_TEST_CASE(TestLayerInvalidExclusionViaArmnn) { // Given TempDir tmpDir; EthosNConfig ethosnConfig = CreateEthosNConfig(tmpDir); const std::vector<std::string> mappings1 = { "input firstInput, 1x_x_x_", "output firstOutput, 1x_x_x_", "Excluded1, (firstInput), (firstOutput), ((function=TanH))", }; Tensors tensors; Layers layers; BOOST_CHECK_THROW(armnn::ProcessPattern(mappings1, tensors, layers), armnn::ParseException); // When try { armnn::ProcessPattern(mappings1, tensors, layers); } // Then catch (const armnn::ParseException& e) { std::string err = "Syntax error:\nExcluded1, (firstInput), (firstOutput), ((function=TanH))\n"; BOOST_CHECK_EQUAL(err, e.what()); } } BOOST_AUTO_TEST_SUITE_END()
41.03196
227
0.626192
QPC-database
be09d8e4cbbad885c4ba4fd8b910550976ada034
10,093
cpp
C++
Sources/Tools/EPI/Document/ContentInfo/SplineRepresentation.cpp
benkaraban/anima-games-engine
8aa7a5368933f1b82c90f24814f1447119346c3b
[ "BSD-3-Clause" ]
2
2015-04-16T01:05:53.000Z
2019-08-26T07:38:43.000Z
Sources/Tools/EPI/Document/ContentInfo/SplineRepresentation.cpp
benkaraban/anima-games-engine
8aa7a5368933f1b82c90f24814f1447119346c3b
[ "BSD-3-Clause" ]
null
null
null
Sources/Tools/EPI/Document/ContentInfo/SplineRepresentation.cpp
benkaraban/anima-games-engine
8aa7a5368933f1b82c90f24814f1447119346c3b
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright (c) 2010, Anima Games, Benjamin Karaban, Laurent Schneider, * Jérémie Comarmond, Didier Colin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "SplineRepresentation.h" #include <Universe/World.h> #include <EPI/Document/Properties/PtyTrajectory/PtyTrajectory.moc.h> #include <Core/Math/Splines/CatmullRom.h> #include <Core/List.h> #include <Core/Math/Splines/Trajectory.h> #include <Assets/GeometricPrimitive.h> #include <Assets/Tool.h> #include <EPI/Document/ContentInfo/SplineRepresentation.h> #include <EPI/Constants.h> namespace EPI { const String tagNodeSpline = L"SplineRepresentationTrajectory"; //const String tagNodeGroupDecal = L"GroupDecalRepresentationTrajectory"; const String tagNodeLocalAxis = L"CheckPointLocalAxis"; const String SPLINE_ARROW_MODEL_NAME = L"$SplineArrow"; const String SPLINE_ARROW_MESH_NAME = L"$SplineArrowMesh"; const float SPLINE_ARROW_SIZE_FACTOR = 2.6f; //----------------------------------------------------------------------------- void createSplineModels(Ptr<Universe::RessourcePool> pPool) { //arrow Ptr<Assets::ModelMesh> arrow (new Assets::ModelMesh()); Assets::VerticeSet & vsetArrow = arrow->getLODByID(0); Assets::createArrow(vsetArrow, SPLINE_ARROW_SIZE_FACTOR); Assets::makeTBNBasis(vsetArrow, false); arrow->cleanup(); Ptr<Assets::Model> pArrowModel (new Assets::Model()); pArrowModel->addMesh(SPLINE_ARROW_MESH_NAME, *arrow); pPool->addModel(SPLINE_ARROW_MODEL_NAME, pArrowModel); } //----------------------------------------------------------------------------- Ptr<Universe::NodeGroup> createSplineUniverseRepresentation(const Ptr<Universe::World>& pWorld) { Ptr<Universe::NodeGroup> pRet; pRet = pWorld->createGroup(); Ptr<Universe::NodeSpline> pNodeSpline = pWorld->createSpline(); pNodeSpline->addTag(tagNodeSpline); pNodeSpline->setColor(Core::Vector4f(0.8f,0.8f,0.8f,1.f)); Ptr<Universe::NodeGroup> pGroup = pWorld->createGroup(); pGroup->setFixedSize(true, 1/20.f); pGroup->addTag(tagNodeLocalAxis); Ptr<Universe::NodeMesh> pNodeArrowAxeX = pWorld->createMesh(SPLINE_ARROW_MODEL_NAME, SPLINE_ARROW_MESH_NAME); Ptr<Universe::NodeMesh> pNodeArrowAxeY = pWorld->createMesh(SPLINE_ARROW_MODEL_NAME, SPLINE_ARROW_MESH_NAME); Ptr<Universe::NodeMesh> pNodeArrowAxeZ = pWorld->createMesh(SPLINE_ARROW_MODEL_NAME, SPLINE_ARROW_MESH_NAME); pNodeArrowAxeX->getMeshInstance()->setMaterial(RdrConst::sMatAxisX); pNodeArrowAxeY->getMeshInstance()->setMaterial(RdrConst::sMatAxisY); pNodeArrowAxeZ->getMeshInstance()->setMaterial(RdrConst::sMatAxisZ); pNodeArrowAxeX->beginMatrixUpdate(); pNodeArrowAxeX->localRoll(-f_PI_DIV_2); pNodeArrowAxeX->setLocalPosition(Core::Vector3f(SPLINE_ARROW_SIZE_FACTOR,0,0)); pNodeArrowAxeX->endMatrixUpdate(); pNodeArrowAxeY->beginMatrixUpdate(); pNodeArrowAxeY->setLocalPosition(Core::Vector3f(0,SPLINE_ARROW_SIZE_FACTOR,0)); pNodeArrowAxeY->endMatrixUpdate(); pNodeArrowAxeZ->beginMatrixUpdate(); pNodeArrowAxeZ->localPitch(f_PI_DIV_2); pNodeArrowAxeZ->setLocalPosition(Core::Vector3f(0,0,SPLINE_ARROW_SIZE_FACTOR)); pNodeArrowAxeZ->endMatrixUpdate(); pGroup->addChild(pNodeArrowAxeX); pGroup->addChild(pNodeArrowAxeY); pGroup->addChild(pNodeArrowAxeZ); pRet->addChild(pNodeSpline); pRet->addChild(pGroup); return pRet; } //----------------------------------------------------------------------------- SplineRepresentation::SplineRepresentation(const Ptr<Universe::World>& pWorld, const Ptr<Universe::Node>& pNodeToRepresent): IContentRepresentation(), _mode(SELECTION_REPRESENTATION), _pWorld(pWorld) { createSplineModels(_pWorld->getRessourcesPool()); _pNodeRepresentation = createSplineUniverseRepresentation(_pWorld); pNodeToRepresent->addGhostChild(_pNodeRepresentation); } //----------------------------------------------------------------------------- SplineRepresentation::SplineRepresentation(const SplineRepresentation& other): IContentRepresentation(other), _pWorld(other._pWorld) { //TODO LM_ASSERT(false); } //----------------------------------------------------------------------------- SplineRepresentation::~SplineRepresentation() { _pNodeRepresentation->kill(); } //----------------------------------------------------------------------------- void SplineRepresentation::updateObjectRepresentation(const Property& pPty) { const PtyTrajectory& pPtyT = static_cast<const PtyTrajectory&>(pPty); Ptr<Universe::NodeSpline> pNodeSpline = LM_DEBUG_PTR_CAST<Universe::NodeSpline>(_pNodeRepresentation->getChildWithTag(tagNodeSpline)); const Core::Trajectory& traj = pPtyT.getTrajectory(); const Core::List<Core::CheckPoint> & cp = traj.getCheckPoints(); /* Ptr<Universe::Node> pNode = ((const PtyNode&)(pPty)).getUniverseNode(); _pNodeRepresentation->setWorldPosition(pNode->getWorldPosition()); _pNodeRepresentation->setLocalOrientation(pNode->getLocalOrient());*/ //Spline Core::List<Core::Vector3f> pos; for (int32 ii=0; ii<cp.size(); ++ii) { pos.push_back(cp[ii].position); if (ii==0 || ii==cp.size()-1) { pos.push_back(cp[ii].position); pos.push_back(cp[ii].position); } } Core::CRSpline sp(pos); pNodeSpline->setSpline(sp); pNodeSpline->setResolution(10*pos.size()); /* //Decal Ptr<Universe::NodeGroup > pNodeGroupDecal = LM_DEBUG_PTR_CAST<Universe::NodeGroup>(_pNodeRepresentation->getChildWithTag(tagNodeGroupDecal)); if (pNodeGroupDecal->getChildCount() < cp.size()) { int32 nbNewDecal = cp.size()-pNodeGroupDecal->getChildCount(); for (int32 ii=0; ii<nbNewDecal; ++ii) { pNodeGroupDecal->addChild(_pWorld->createDecal()); } } else { int32 nbDecalToDelete = pNodeGroupDecal->getChildCount()-cp.size(); for (int32 ii=0; ii<nbDecalToDelete; ++ii) { pNodeGroupDecal->removeChild(pNodeGroupDecal->getChildren().back()); } } for (int32 ii=0; ii<cp.size(); ++ii) { LM_DEBUG_PTR_CAST<Universe::NodeDecal>(pNodeGroupDecal->getChild(ii))->setBillboard(true); LM_DEBUG_PTR_CAST<Universe::NodeDecal>(pNodeGroupDecal->getChild(ii))->setSize(0.1f); pNodeGroupDecal->getChild(ii)->setWorldPosition(cp[ii].position); pNodeGroupDecal->getChild(ii)->setFixedSize(true); }*/ } //----------------------------------------------------------------------------- void SplineRepresentation::setRepresentationMode(ECRMode mode) { _mode = mode; Ptr<Universe::NodeSpline> pNodeSpline = LM_DEBUG_PTR_CAST<Universe::NodeSpline>(_pNodeRepresentation->getChildWithTag(tagNodeSpline)); // Ptr<Universe::NodeGroup > pNodeGroupDecal = LM_DEBUG_PTR_CAST<Universe::NodeGroup>(_pNodeRepresentation->getChildWithTag(tagNodeGroupDecal)); if (_mode==OBJECT_REPRESENTATION) { pNodeSpline->setVisible(true); // pNodeGroupDecal->setVisible(true); } else { pNodeSpline->setVisible(true); // pNodeGroupDecal->setVisible(false); } } //----------------------------------------------------------------------------- const Ptr<Universe::NodeGroup>& SplineRepresentation::getNodeRepresentation() { return _pNodeRepresentation; } //----------------------------------------------------------------------------- bool SplineRepresentation::isItMe(const Ptr<Universe::Node>& pNode) { if (pNode==_pNodeRepresentation) return true; return false; } //----------------------------------------------------------------------------- Ptr<IContentRepresentation> SplineRepresentation::clone() { Ptr<SplineRepresentation> pRet = Ptr<SplineRepresentation>(new SplineRepresentation (*this)); return pRet; } //----------------------------------------------------------------------------- void SplineRepresentation::setNodeToRepresent(const Ptr<Universe::Node>& pNode) { pNode->addGhostChild(_pNodeRepresentation); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- } // namespace EPI
41.028455
148
0.635886
benkaraban
be0a10874dda4946544813fa28b986dc9a86ae50
9,353
cpp
C++
VC2010Samples/MFC/Visual C++ 2008 Feature Pack/VisualStudioDemo/PropertiesViewBar.cpp
alonmm/VCSamples
6aff0b4902f5027164d593540fcaa6601a0407c3
[ "MIT" ]
300
2019-05-09T05:32:33.000Z
2022-03-31T20:23:24.000Z
VC2010Samples/MFC/Visual C++ 2008 Feature Pack/VisualStudioDemo/PropertiesViewBar.cpp
JaydenChou/VCSamples
9e1d4475555b76a17a3568369867f1d7b6cc6126
[ "MIT" ]
9
2016-09-19T18:44:26.000Z
2018-10-26T10:20:05.000Z
VC2010Samples/MFC/Visual C++ 2008 Feature Pack/VisualStudioDemo/PropertiesViewBar.cpp
JaydenChou/VCSamples
9e1d4475555b76a17a3568369867f1d7b6cc6126
[ "MIT" ]
633
2019-05-08T07:34:12.000Z
2022-03-30T04:38:28.000Z
// This is a part of the Microsoft Foundation Classes C++ library. // Copyright (c) Microsoft Corporation. All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product. #include "stdafx.h" #include "VisualStudioDemo.h" #include "MainFrm.h" #include "PropertiesViewBar.h" #include <memory> #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif ///////////////////////////////////////////////////////////////////////////// // CResourceViewBar CPropertiesViewBar::CPropertiesViewBar() { } CPropertiesViewBar::~CPropertiesViewBar() { } BEGIN_MESSAGE_MAP(CPropertiesViewBar, CDockablePane) ON_WM_CREATE() ON_WM_SIZE() ON_COMMAND(ID_SORTINGPROP, OnSortingprop) ON_UPDATE_COMMAND_UI(ID_SORTINGPROP, OnUpdateSortingprop) ON_COMMAND(ID_PROPERIES1, OnProperies1) ON_UPDATE_COMMAND_UI(ID_PROPERIES1, OnUpdateProperies1) ON_COMMAND(ID_PROPERIES2, OnProperies2) ON_UPDATE_COMMAND_UI(ID_PROPERIES2, OnUpdateProperies2) ON_COMMAND(ID_EXPAND, OnExpand) ON_UPDATE_COMMAND_UI(ID_EXPAND, OnUpdateExpand) ON_WM_SETFOCUS() ON_WM_SETTINGCHANGE() END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CResourceViewBar message handlers void CPropertiesViewBar::AdjustLayout() { if (GetSafeHwnd() == NULL) { return; } CRect rectClient,rectCombo; GetClientRect(rectClient); m_wndObjectCombo.GetWindowRect(&rectCombo); int cyCmb = rectCombo.Size().cy; int cyTlb = m_wndToolBar.CalcFixedLayout(FALSE, TRUE).cy; m_wndObjectCombo.SetWindowPos(NULL, rectClient.left, rectClient.top, rectClient.Width(), 200, SWP_NOACTIVATE | SWP_NOZORDER); m_wndToolBar.SetWindowPos(NULL, rectClient.left, rectClient.top + cyCmb, rectClient.Width(), cyTlb, SWP_NOACTIVATE | SWP_NOZORDER); m_wndPropList.SetWindowPos(NULL, rectClient.left, rectClient.top + cyCmb + cyTlb, rectClient.Width(), rectClient.Height() -(cyCmb+cyTlb), SWP_NOACTIVATE | SWP_NOZORDER); } int CPropertiesViewBar::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; CRect rectDummy; rectDummy.SetRectEmpty(); // Create combo: const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_BORDER | CBS_SORT | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; if (!m_wndObjectCombo.Create(dwViewStyle, rectDummy, this, 1)) { TRACE0("Failed to create Properies Combo \n"); return -1; // fail to create } m_wndObjectCombo.AddString(_T("IDD_ABOUTBOX(Dialog)")); m_wndObjectCombo.SetCurSel(0); if (!m_wndPropList.Create(WS_VISIBLE | WS_CHILD, rectDummy, this, 2)) { TRACE0("Failed to create Properies Grid \n"); return -1; // fail to create } InitPropList(); m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_PROPERTIES); m_wndToolBar.LoadToolBar(IDR_PROPERTIES, 0, 0, TRUE /* Is locked */); OnChangeVisualStyle(); m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY); m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT)); m_wndToolBar.SetOwner(this); // All commands will be routed via this control , not via the parent frame: m_wndToolBar.SetRouteCommandsViaFrame(FALSE); AdjustLayout(); return 0; } void CPropertiesViewBar::OnSize(UINT nType, int cx, int cy) { CDockablePane::OnSize(nType, cx, cy); AdjustLayout(); } void CPropertiesViewBar::OnSortingprop() { m_wndPropList.SetAlphabeticMode(); } void CPropertiesViewBar::OnUpdateSortingprop(CCmdUI* pCmdUI) { pCmdUI->SetCheck(m_wndPropList.IsAlphabeticMode()); } void CPropertiesViewBar::OnExpand() { m_wndPropList.SetAlphabeticMode(FALSE); } void CPropertiesViewBar::OnUpdateExpand(CCmdUI* pCmdUI) { pCmdUI->SetCheck(!m_wndPropList.IsAlphabeticMode()); } void CPropertiesViewBar::OnProperies1() { // TODO: Add your command handler code here } void CPropertiesViewBar::OnUpdateProperies1(CCmdUI* /*pCmdUI*/) { // TODO: Add your command update UI handler code here } void CPropertiesViewBar::OnProperies2() { // TODO: Add your command handler code here } void CPropertiesViewBar::OnUpdateProperies2(CCmdUI* /*pCmdUI*/) { // TODO: Add your command update UI handler code here } void CPropertiesViewBar::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); std::auto_ptr<CMFCPropertyGridProperty> apGroup1(new CMFCPropertyGridProperty(_T("Appearance"))); apGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("3D Look"), (_variant_t) false, _T("Specifies the dialog's font will be nonbold and controls will have a 3D border"))); CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Border"), _T("Dialog Frame"), _T("One of: None, Thin, Resizable, or Dialog Frame")); pProp->AddOption(_T("None")); pProp->AddOption(_T("Thin")); pProp->AddOption(_T("Resizable")); pProp->AddOption(_T("Dialog Frame")); pProp->AllowEdit(FALSE); apGroup1->AddSubItem(pProp); apGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Caption"), (_variant_t) _T("About"), _T("Specifies the text that will be displayed in the dialog's title bar"))); m_wndPropList.AddProperty(apGroup1.release()); std::auto_ptr<CMFCPropertyGridProperty> apSize(new CMFCPropertyGridProperty(_T("Window Size"), 0, TRUE)); pProp = new CMFCPropertyGridProperty(_T("Height"), (_variant_t) 250l, _T("Specifies the dialog's height")); pProp->EnableSpinControl(TRUE, 0, 1000); apSize->AddSubItem(pProp); pProp = new CMFCPropertyGridProperty( _T("Width"), (_variant_t) 150l, _T("Specifies the dialog's width")); pProp->EnableSpinControl(TRUE, 1, 500); apSize->AddSubItem(pProp); m_wndPropList.AddProperty(apSize.release()); std::auto_ptr<CMFCPropertyGridProperty> apGroup2(new CMFCPropertyGridProperty(_T("Font"))); LOGFONT lf; CFont* font = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)); font->GetLogFont(&lf); lstrcpy(lf.lfFaceName, _T("Arial")); apGroup2->AddSubItem(new CMFCPropertyGridFontProperty(_T("Font"), lf, CF_EFFECTS | CF_SCREENFONTS, _T("Specifies the default font for the dialog"))); apGroup2->AddSubItem(new CMFCPropertyGridProperty(_T("Use System Font"), (_variant_t) true, _T("Specifies that the dialog uses MS Shell Dlg font"))); m_wndPropList.AddProperty(apGroup2.release()); std::auto_ptr<CMFCPropertyGridProperty> apGroup3(new CMFCPropertyGridProperty(_T("Misc"))); pProp = new CMFCPropertyGridProperty(_T("(Name)"), _T("IDD_ABOUT_BOX(dialog)")); pProp->Enable(FALSE); apGroup3->AddSubItem(pProp); CMFCPropertyGridColorProperty* pColorProp = new CMFCPropertyGridColorProperty(_T("Window Color"), RGB(210, 192, 254), NULL, _T("Specifies the default dialog color")); pColorProp->EnableOtherButton(_T("Other...")); pColorProp->EnableAutomaticButton(_T("Default"), ::GetSysColor(COLOR_3DFACE)); apGroup3->AddSubItem(pColorProp); static TCHAR BASED_CODE szFilter[] = _T("Icon Files(*.ico)|*.ico|All Files(*.*)|*.*||"); apGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Icon"), TRUE, _T(""), _T("ico"), 0, szFilter, _T("Specifies the dialog icon"))); apGroup3->AddSubItem(new CMFCPropertyGridFileProperty(_T("Folder"), _T("c:\\"))); m_wndPropList.AddProperty(apGroup3.release()); std::auto_ptr<CMFCPropertyGridProperty> apGroup4(new CMFCPropertyGridProperty(_T("Hierarchy"))); CMFCPropertyGridProperty* pGroup41 = new CMFCPropertyGridProperty(_T("First sub-level")); apGroup4->AddSubItem(pGroup41); CMFCPropertyGridProperty* pGroup411 = new CMFCPropertyGridProperty(_T("Second sub-level")); pGroup41->AddSubItem(pGroup411); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 1"), (_variant_t) _T("Value 1"), _T("This is a description"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 2"), (_variant_t) _T("Value 2"), _T("This is a description"))); pGroup411->AddSubItem(new CMFCPropertyGridProperty(_T("Item 3"), (_variant_t) _T("Value 3"), _T("This is a description"))); apGroup4->Expand(FALSE); m_wndPropList.AddProperty(apGroup4.release()); } void CPropertiesViewBar::OnSetFocus(CWnd* pOldWnd) { CDockablePane::OnSetFocus(pOldWnd); m_wndPropList.SetFocus(); } void CPropertiesViewBar::OnSettingChange(UINT uFlags, LPCTSTR lpszSection) { CDockablePane::OnSettingChange(uFlags, lpszSection); SetPropListFont(); } void CPropertiesViewBar::SetPropListFont() { ::DeleteObject (m_fntPropList.Detach ()); LOGFONT lf; afxGlobalData.fontRegular.GetLogFont (&lf); NONCLIENTMETRICS info; info.cbSize = sizeof(info); afxGlobalData.GetNonClientMetrics (info); lf.lfHeight = info.lfMenuFont.lfHeight; lf.lfWeight = info.lfMenuFont.lfWeight; lf.lfItalic = info.lfMenuFont.lfItalic; m_fntPropList.CreateFontIndirect (&lf); m_wndPropList.SetFont(&m_fntPropList); m_wndObjectCombo.SetFont(&m_fntPropList); } void CPropertiesViewBar::OnChangeVisualStyle() { m_wndToolBar.CleanUpLockedImages(); m_wndToolBar.LoadBitmap(theApp.m_bHiColorIcons ? IDB_PROP24 : IDR_PROPERTIES, 0, 0, TRUE /* Locked */); }
32.58885
173
0.755373
alonmm
be0a3dc4cd03044b5dc9758163abf6484d898f12
45,091
cpp
C++
multiview/contrib/alglib/cpp/src/diffequations.cpp
prcvlabs/multiview
1a03e14855292967ffb0c0ec7fff855c5abbc9d2
[ "Apache-2.0" ]
5
2021-09-03T23:12:08.000Z
2022-03-04T21:43:32.000Z
multiview/contrib/alglib/cpp/src/diffequations.cpp
prcvlabs/multiview
1a03e14855292967ffb0c0ec7fff855c5abbc9d2
[ "Apache-2.0" ]
3
2021-09-08T02:57:46.000Z
2022-02-26T05:33:02.000Z
multiview/contrib/alglib/cpp/src/diffequations.cpp
prcvlabs/multiview
1a03e14855292967ffb0c0ec7fff855c5abbc9d2
[ "Apache-2.0" ]
2
2021-09-26T03:14:40.000Z
2022-01-26T06:42:52.000Z
/************************************************************************* ALGLIB 3.12.0 (source code generated 2017-08-22) Copyright (c) Sergey Bochkanov (ALGLIB project). >>> SOURCE LICENSE >>> This program is a Commercial Edition of the ALGLIB package licensed to Perceive, Inc. (Licensee), agreement ID is AGR-20170916-1 As of 2017-09-16: * DEV-1 license plan is purchased (1 developer) * following developers are registered for this license: * amichaux@perceiveinc.com ========================== GENERAL INFORMATION ========================== 1. Only Licensee and its Sublicensees can use/distribute it according to the ALGLIB License Agreement (see below) between Licensor (Sole Proprietor Bochkanov Sergey Anatolyevich) and Licensee. 2. All developers working for Licensee should register themselves at alglib.net. Quick access link for Licensee's account can be found at the section 9 of scanned copy of ALGLIB License Agreement or in e-mails from ALGLIB Project. 3. This source code may contain modifications made by Licensee or Sublicensees which fall under the terms of the ALGLIB License Agreement too. 4. Text below is an excerpt from complete ALGLIB License Agreement, a part which governs usage and redistribution rights granted to Licensee. See agreement-v6.pdf at the root of ALGLIB distribution for complete text of license agreement. ================ ALGLIB LICENSE AGREEMENT ( APPENDIX A ) ================ DEFINITIONS: * "ALGLIB" – software delivered by Licensor to Licensee under present Agreement. ALGLIB may include Binary Components (delivered only in binary form) and Source Code Components (with optional precompiled binary form). ALGLIB may include optional third-party components, which may have their own licensing terms. Specific list of components and additional licensing terms (if there are any) is included in the license.txt file in the root of archive containing ALGLIB. If you decide not to link ALGLIB with these optional components, their licensing terms do not apply to you. * "Application" - program developed by Licensee (either standalone application or software development library) which includes ALGLIB as one of its parts . * "Sublicensee" - any party (including resellers) which receives Application from Licensee or another Sublicensee. * "Application License Agreement" - agreement which governs usage/ redistribution of the Application. LICENSE GRANT: Subject to the License Restrictions below, Licensor grants to Licensee the following non-exclusive royalty-free licenses: A. To modify Source Code Components of ALGLIB and to use modified version on the terms of this Agreement. B. To develop Applications which use ALGLIB and to distribute such Applications in Binary and/or Source Code forms, with ALGLIB either statically or dynamically linked. This right is granted provided that: * distribution of Source Code forms of Application/ALGLIB is performed subject to additional conditions set by clause H (this clause is not applied to binary-only distribution) * such Applications add significant primary functionality different from that of the ALGLIB. * such Applications do not expose ALGLIB API (application programming interface) either directly or indirectly * Sublicensee has no right to use ALGLIB except as part of the Application * any subsequent redistribution respects conditions of the present Agreement * all developers working for Licensee should register at company's account at www.alglib.net (in order to find login link, see section 9 of scanned copy of ALGLIB License Agreement -or find it in e-mails from ALGLIB Project). C. To use Resellers for distribution of the Application (in Binary or Source Code forms), provided that the only activity Reseller performs with Application is redistribution. LICENSE RESTRICTIONS: D. Licensee/Sublicensee may NOT use, copy or distribute ALGLIB except as provided in this Agreement. D2. Licensee/Sublicensee may NOT rent or lease ALGLIB to any third party. E. Licensee/Sublicensee may NOT disassemble, reverse engineer, decompile, modify Binary Components of ALGLIB or compiled forms of Source Code components. F. Licensee/Sublicensee may NOT remove any copyright notice from the Source Code / Binary Components. G. Licensee/Sublicensee may NOT disable/remove code which checks for presence of license keys (if such code is included in ALGLIB) from the Source Code / Binary Components. H. Distribution of Source Code forms of Application/ALGLIB must be performed subject to additional conditions: * Source Code Components of ALGLIB are distributed only as part of the Application. They are not publicly distributed. Sublicensee must explicitly accept Application License Agreement in order to access ALGLIB source code. * Sublicensee has no right to redistribute Application/ALGLIB (in any form, Binary or Source Code), unless Sublicensee is Reseller who is fully compliant with conditions set by clause C. * Sublicensee has no right to modify ALGLIB Source Code, except for the purpose of fixing bugs * Sublicensee has no right to workaround "use ALGLIB only as part of the Application" limitation by sequentially modifying Application in a way which effectively creates new program with different purpose. Application License Agreement may (a) explicitly forbid such modifications, or (b) allow only limited set of "safe" modifications (developing plugins, fixing bugs, modifying only specific parts of the Application). COPYRIGHT: Title to the ALGLIB and all copies thereof remain with Licensor. The ALGLIB is copyrighted and is protected by Russian copyright laws and international treaty provisions. You will not remove any copyright notice from the ALGLIB files. You agree to prevent any unauthorized copying of the ALGLIB. Except as expressly provided herein, Licensor does not grant any express or implied right to you under Licensor patents, copyrights, trademarks, or trade secret information. >>> END OF LICENSE >>> *************************************************************************/ #include "stdafx.h" #include "diffequations.h" // disable some irrelevant warnings #if (AE_COMPILER==AE_MSVC) #pragma warning(disable:4100) #pragma warning(disable:4127) #pragma warning(disable:4702) #pragma warning(disable:4996) #endif using namespace std; ///////////////////////////////////////////////////////////////////////// // // THIS SECTION CONTAINS IMPLEMENTATION OF C++ INTERFACE // ///////////////////////////////////////////////////////////////////////// namespace alglib { /************************************************************************* *************************************************************************/ _odesolverstate_owner::_odesolverstate_owner() { p_struct = (alglib_impl::odesolverstate*)alglib_impl::ae_malloc(sizeof(alglib_impl::odesolverstate), NULL); if( p_struct==NULL ) throw ap_error("ALGLIB: malloc error"); alglib_impl::_odesolverstate_init(p_struct, NULL); } _odesolverstate_owner::_odesolverstate_owner(const _odesolverstate_owner &rhs) { p_struct = (alglib_impl::odesolverstate*)alglib_impl::ae_malloc(sizeof(alglib_impl::odesolverstate), NULL); if( p_struct==NULL ) throw ap_error("ALGLIB: malloc error"); alglib_impl::_odesolverstate_init_copy(p_struct, const_cast<alglib_impl::odesolverstate*>(rhs.p_struct), NULL); } _odesolverstate_owner& _odesolverstate_owner::operator=(const _odesolverstate_owner &rhs) { if( this==&rhs ) return *this; alglib_impl::_odesolverstate_clear(p_struct); alglib_impl::_odesolverstate_init_copy(p_struct, const_cast<alglib_impl::odesolverstate*>(rhs.p_struct), NULL); return *this; } _odesolverstate_owner::~_odesolverstate_owner() { alglib_impl::_odesolverstate_clear(p_struct); ae_free(p_struct); } alglib_impl::odesolverstate* _odesolverstate_owner::c_ptr() { return p_struct; } alglib_impl::odesolverstate* _odesolverstate_owner::c_ptr() const { return const_cast<alglib_impl::odesolverstate*>(p_struct); } odesolverstate::odesolverstate() : _odesolverstate_owner() ,needdy(p_struct->needdy),y(&p_struct->y),dy(&p_struct->dy),x(p_struct->x) { } odesolverstate::odesolverstate(const odesolverstate &rhs):_odesolverstate_owner(rhs) ,needdy(p_struct->needdy),y(&p_struct->y),dy(&p_struct->dy),x(p_struct->x) { } odesolverstate& odesolverstate::operator=(const odesolverstate &rhs) { if( this==&rhs ) return *this; _odesolverstate_owner::operator=(rhs); return *this; } odesolverstate::~odesolverstate() { } /************************************************************************* *************************************************************************/ _odesolverreport_owner::_odesolverreport_owner() { p_struct = (alglib_impl::odesolverreport*)alglib_impl::ae_malloc(sizeof(alglib_impl::odesolverreport), NULL); if( p_struct==NULL ) throw ap_error("ALGLIB: malloc error"); alglib_impl::_odesolverreport_init(p_struct, NULL); } _odesolverreport_owner::_odesolverreport_owner(const _odesolverreport_owner &rhs) { p_struct = (alglib_impl::odesolverreport*)alglib_impl::ae_malloc(sizeof(alglib_impl::odesolverreport), NULL); if( p_struct==NULL ) throw ap_error("ALGLIB: malloc error"); alglib_impl::_odesolverreport_init_copy(p_struct, const_cast<alglib_impl::odesolverreport*>(rhs.p_struct), NULL); } _odesolverreport_owner& _odesolverreport_owner::operator=(const _odesolverreport_owner &rhs) { if( this==&rhs ) return *this; alglib_impl::_odesolverreport_clear(p_struct); alglib_impl::_odesolverreport_init_copy(p_struct, const_cast<alglib_impl::odesolverreport*>(rhs.p_struct), NULL); return *this; } _odesolverreport_owner::~_odesolverreport_owner() { alglib_impl::_odesolverreport_clear(p_struct); ae_free(p_struct); } alglib_impl::odesolverreport* _odesolverreport_owner::c_ptr() { return p_struct; } alglib_impl::odesolverreport* _odesolverreport_owner::c_ptr() const { return const_cast<alglib_impl::odesolverreport*>(p_struct); } odesolverreport::odesolverreport() : _odesolverreport_owner() ,nfev(p_struct->nfev),terminationtype(p_struct->terminationtype) { } odesolverreport::odesolverreport(const odesolverreport &rhs):_odesolverreport_owner(rhs) ,nfev(p_struct->nfev),terminationtype(p_struct->terminationtype) { } odesolverreport& odesolverreport::operator=(const odesolverreport &rhs) { if( this==&rhs ) return *this; _odesolverreport_owner::operator=(rhs); return *this; } odesolverreport::~odesolverreport() { } /************************************************************************* Cash-Karp adaptive ODE solver. This subroutine solves ODE Y'=f(Y,x) with initial conditions Y(xs)=Ys (here Y may be single variable or vector of N variables). INPUT PARAMETERS: Y - initial conditions, array[0..N-1]. contains values of Y[] at X[0] N - system size X - points at which Y should be tabulated, array[0..M-1] integrations starts at X[0], ends at X[M-1], intermediate values at X[i] are returned too. SHOULD BE ORDERED BY ASCENDING OR BY DESCENDING! M - number of intermediate points + first point + last point: * M>2 means that you need both Y(X[M-1]) and M-2 values at intermediate points * M=2 means that you want just to integrate from X[0] to X[1] and don't interested in intermediate values. * M=1 means that you don't want to integrate :) it is degenerate case, but it will be handled correctly. * M<1 means error Eps - tolerance (absolute/relative error on each step will be less than Eps). When passing: * Eps>0, it means desired ABSOLUTE error * Eps<0, it means desired RELATIVE error. Relative errors are calculated with respect to maximum values of Y seen so far. Be careful to use this criterion when starting from Y[] that are close to zero. H - initial step lenth, it will be adjusted automatically after the first step. If H=0, step will be selected automatically (usualy it will be equal to 0.001 of min(x[i]-x[j])). OUTPUT PARAMETERS State - structure which stores algorithm state between subsequent calls of OdeSolverIteration. Used for reverse communication. This structure should be passed to the OdeSolverIteration subroutine. SEE ALSO AutoGKSmoothW, AutoGKSingular, AutoGKIteration, AutoGKResults. -- ALGLIB -- Copyright 01.09.2009 by Bochkanov Sergey *************************************************************************/ void odesolverrkck(const real_1d_array &y, const ae_int_t n, const real_1d_array &x, const ae_int_t m, const double eps, const double h, odesolverstate &state) { alglib_impl::ae_state _alglib_env_state; alglib_impl::ae_state_init(&_alglib_env_state); try { alglib_impl::odesolverrkck(const_cast<alglib_impl::ae_vector*>(y.c_ptr()), n, const_cast<alglib_impl::ae_vector*>(x.c_ptr()), m, eps, h, const_cast<alglib_impl::odesolverstate*>(state.c_ptr()), &_alglib_env_state); alglib_impl::ae_state_clear(&_alglib_env_state); return; } catch(alglib_impl::ae_error_type) { throw ap_error(_alglib_env_state.error_msg); } } /************************************************************************* Cash-Karp adaptive ODE solver. This subroutine solves ODE Y'=f(Y,x) with initial conditions Y(xs)=Ys (here Y may be single variable or vector of N variables). INPUT PARAMETERS: Y - initial conditions, array[0..N-1]. contains values of Y[] at X[0] N - system size X - points at which Y should be tabulated, array[0..M-1] integrations starts at X[0], ends at X[M-1], intermediate values at X[i] are returned too. SHOULD BE ORDERED BY ASCENDING OR BY DESCENDING! M - number of intermediate points + first point + last point: * M>2 means that you need both Y(X[M-1]) and M-2 values at intermediate points * M=2 means that you want just to integrate from X[0] to X[1] and don't interested in intermediate values. * M=1 means that you don't want to integrate :) it is degenerate case, but it will be handled correctly. * M<1 means error Eps - tolerance (absolute/relative error on each step will be less than Eps). When passing: * Eps>0, it means desired ABSOLUTE error * Eps<0, it means desired RELATIVE error. Relative errors are calculated with respect to maximum values of Y seen so far. Be careful to use this criterion when starting from Y[] that are close to zero. H - initial step lenth, it will be adjusted automatically after the first step. If H=0, step will be selected automatically (usualy it will be equal to 0.001 of min(x[i]-x[j])). OUTPUT PARAMETERS State - structure which stores algorithm state between subsequent calls of OdeSolverIteration. Used for reverse communication. This structure should be passed to the OdeSolverIteration subroutine. SEE ALSO AutoGKSmoothW, AutoGKSingular, AutoGKIteration, AutoGKResults. -- ALGLIB -- Copyright 01.09.2009 by Bochkanov Sergey *************************************************************************/ void odesolverrkck(const real_1d_array &y, const real_1d_array &x, const double eps, const double h, odesolverstate &state) { alglib_impl::ae_state _alglib_env_state; ae_int_t n; ae_int_t m; n = y.length(); m = x.length(); alglib_impl::ae_state_init(&_alglib_env_state); try { alglib_impl::odesolverrkck(const_cast<alglib_impl::ae_vector*>(y.c_ptr()), n, const_cast<alglib_impl::ae_vector*>(x.c_ptr()), m, eps, h, const_cast<alglib_impl::odesolverstate*>(state.c_ptr()), &_alglib_env_state); alglib_impl::ae_state_clear(&_alglib_env_state); return; } catch(alglib_impl::ae_error_type) { throw ap_error(_alglib_env_state.error_msg); } } /************************************************************************* This function provides reverse communication interface Reverse communication interface is not documented or recommended to use. See below for functions which provide better documented API *************************************************************************/ bool odesolveriteration(const odesolverstate &state) { alglib_impl::ae_state _alglib_env_state; alglib_impl::ae_state_init(&_alglib_env_state); try { ae_bool result = alglib_impl::odesolveriteration(const_cast<alglib_impl::odesolverstate*>(state.c_ptr()), &_alglib_env_state); alglib_impl::ae_state_clear(&_alglib_env_state); return *(reinterpret_cast<bool*>(&result)); } catch(alglib_impl::ae_error_type) { throw ap_error(_alglib_env_state.error_msg); } } void odesolversolve(odesolverstate &state, void (*diff)(const real_1d_array &y, double x, real_1d_array &dy, void *ptr), void *ptr){ alglib_impl::ae_state _alglib_env_state; if( diff==NULL ) throw ap_error("ALGLIB: error in 'odesolversolve()' (diff is NULL)"); alglib_impl::ae_state_init(&_alglib_env_state); try { while( alglib_impl::odesolveriteration(state.c_ptr(), &_alglib_env_state) ) { if( state.needdy ) { diff(state.y, state.x, state.dy, ptr); continue; } throw ap_error("ALGLIB: unexpected error in 'odesolversolve'"); } alglib_impl::ae_state_clear(&_alglib_env_state); } catch(alglib_impl::ae_error_type) { throw ap_error(_alglib_env_state.error_msg); } } /************************************************************************* ODE solver results Called after OdeSolverIteration returned False. INPUT PARAMETERS: State - algorithm state (used by OdeSolverIteration). OUTPUT PARAMETERS: M - number of tabulated values, M>=1 XTbl - array[0..M-1], values of X YTbl - array[0..M-1,0..N-1], values of Y in X[i] Rep - solver report: * Rep.TerminationType completetion code: * -2 X is not ordered by ascending/descending or there are non-distinct X[], i.e. X[i]=X[i+1] * -1 incorrect parameters were specified * 1 task has been solved * Rep.NFEV contains number of function calculations -- ALGLIB -- Copyright 01.09.2009 by Bochkanov Sergey *************************************************************************/ void odesolverresults(const odesolverstate &state, ae_int_t &m, real_1d_array &xtbl, real_2d_array &ytbl, odesolverreport &rep) { alglib_impl::ae_state _alglib_env_state; alglib_impl::ae_state_init(&_alglib_env_state); try { alglib_impl::odesolverresults(const_cast<alglib_impl::odesolverstate*>(state.c_ptr()), &m, const_cast<alglib_impl::ae_vector*>(xtbl.c_ptr()), const_cast<alglib_impl::ae_matrix*>(ytbl.c_ptr()), const_cast<alglib_impl::odesolverreport*>(rep.c_ptr()), &_alglib_env_state); alglib_impl::ae_state_clear(&_alglib_env_state); return; } catch(alglib_impl::ae_error_type) { throw ap_error(_alglib_env_state.error_msg); } } } ///////////////////////////////////////////////////////////////////////// // // THIS SECTION CONTAINS IMPLEMENTATION OF COMPUTATIONAL CORE // ///////////////////////////////////////////////////////////////////////// namespace alglib_impl { static double odesolver_odesolvermaxgrow = 3.0; static double odesolver_odesolvermaxshrink = 10.0; static void odesolver_odesolverinit(ae_int_t solvertype, /* Real */ ae_vector* y, ae_int_t n, /* Real */ ae_vector* x, ae_int_t m, double eps, double h, odesolverstate* state, ae_state *_state); /************************************************************************* Cash-Karp adaptive ODE solver. This subroutine solves ODE Y'=f(Y,x) with initial conditions Y(xs)=Ys (here Y may be single variable or vector of N variables). INPUT PARAMETERS: Y - initial conditions, array[0..N-1]. contains values of Y[] at X[0] N - system size X - points at which Y should be tabulated, array[0..M-1] integrations starts at X[0], ends at X[M-1], intermediate values at X[i] are returned too. SHOULD BE ORDERED BY ASCENDING OR BY DESCENDING! M - number of intermediate points + first point + last point: * M>2 means that you need both Y(X[M-1]) and M-2 values at intermediate points * M=2 means that you want just to integrate from X[0] to X[1] and don't interested in intermediate values. * M=1 means that you don't want to integrate :) it is degenerate case, but it will be handled correctly. * M<1 means error Eps - tolerance (absolute/relative error on each step will be less than Eps). When passing: * Eps>0, it means desired ABSOLUTE error * Eps<0, it means desired RELATIVE error. Relative errors are calculated with respect to maximum values of Y seen so far. Be careful to use this criterion when starting from Y[] that are close to zero. H - initial step lenth, it will be adjusted automatically after the first step. If H=0, step will be selected automatically (usualy it will be equal to 0.001 of min(x[i]-x[j])). OUTPUT PARAMETERS State - structure which stores algorithm state between subsequent calls of OdeSolverIteration. Used for reverse communication. This structure should be passed to the OdeSolverIteration subroutine. SEE ALSO AutoGKSmoothW, AutoGKSingular, AutoGKIteration, AutoGKResults. -- ALGLIB -- Copyright 01.09.2009 by Bochkanov Sergey *************************************************************************/ void odesolverrkck(/* Real */ ae_vector* y, ae_int_t n, /* Real */ ae_vector* x, ae_int_t m, double eps, double h, odesolverstate* state, ae_state *_state) { _odesolverstate_clear(state); ae_assert(n>=1, "ODESolverRKCK: N<1!", _state); ae_assert(m>=1, "ODESolverRKCK: M<1!", _state); ae_assert(y->cnt>=n, "ODESolverRKCK: Length(Y)<N!", _state); ae_assert(x->cnt>=m, "ODESolverRKCK: Length(X)<M!", _state); ae_assert(isfinitevector(y, n, _state), "ODESolverRKCK: Y contains infinite or NaN values!", _state); ae_assert(isfinitevector(x, m, _state), "ODESolverRKCK: Y contains infinite or NaN values!", _state); ae_assert(ae_isfinite(eps, _state), "ODESolverRKCK: Eps is not finite!", _state); ae_assert(ae_fp_neq(eps,(double)(0)), "ODESolverRKCK: Eps is zero!", _state); ae_assert(ae_isfinite(h, _state), "ODESolverRKCK: H is not finite!", _state); odesolver_odesolverinit(0, y, n, x, m, eps, h, state, _state); } /************************************************************************* -- ALGLIB -- Copyright 01.09.2009 by Bochkanov Sergey *************************************************************************/ ae_bool odesolveriteration(odesolverstate* state, ae_state *_state) { ae_int_t n; ae_int_t m; ae_int_t i; ae_int_t j; ae_int_t k; double xc; double v; double h; double h2; ae_bool gridpoint; double err; double maxgrowpow; ae_int_t klimit; ae_bool result; /* * Reverse communication preparations * I know it looks ugly, but it works the same way * anywhere from C++ to Python. * * This code initializes locals by: * * random values determined during code * generation - on first subroutine call * * values from previous call - on subsequent calls */ if( state->rstate.stage>=0 ) { n = state->rstate.ia.ptr.p_int[0]; m = state->rstate.ia.ptr.p_int[1]; i = state->rstate.ia.ptr.p_int[2]; j = state->rstate.ia.ptr.p_int[3]; k = state->rstate.ia.ptr.p_int[4]; klimit = state->rstate.ia.ptr.p_int[5]; gridpoint = state->rstate.ba.ptr.p_bool[0]; xc = state->rstate.ra.ptr.p_double[0]; v = state->rstate.ra.ptr.p_double[1]; h = state->rstate.ra.ptr.p_double[2]; h2 = state->rstate.ra.ptr.p_double[3]; err = state->rstate.ra.ptr.p_double[4]; maxgrowpow = state->rstate.ra.ptr.p_double[5]; } else { n = 359; m = -58; i = -919; j = -909; k = 81; klimit = 255; gridpoint = ae_false; xc = -788; v = 809; h = 205; h2 = -838; err = 939; maxgrowpow = -526; } if( state->rstate.stage==0 ) { goto lbl_0; } /* * Routine body */ /* * prepare */ if( state->repterminationtype!=0 ) { result = ae_false; return result; } n = state->n; m = state->m; h = state->h; maxgrowpow = ae_pow(odesolver_odesolvermaxgrow, (double)(5), _state); state->repnfev = 0; /* * some preliminary checks for internal errors * after this we assume that H>0 and M>1 */ ae_assert(ae_fp_greater(state->h,(double)(0)), "ODESolver: internal error", _state); ae_assert(m>1, "ODESolverIteration: internal error", _state); /* * choose solver */ if( state->solvertype!=0 ) { goto lbl_1; } /* * Cask-Karp solver * Prepare coefficients table. * Check it for errors */ ae_vector_set_length(&state->rka, 6, _state); state->rka.ptr.p_double[0] = (double)(0); state->rka.ptr.p_double[1] = (double)1/(double)5; state->rka.ptr.p_double[2] = (double)3/(double)10; state->rka.ptr.p_double[3] = (double)3/(double)5; state->rka.ptr.p_double[4] = (double)(1); state->rka.ptr.p_double[5] = (double)7/(double)8; ae_matrix_set_length(&state->rkb, 6, 5, _state); state->rkb.ptr.pp_double[1][0] = (double)1/(double)5; state->rkb.ptr.pp_double[2][0] = (double)3/(double)40; state->rkb.ptr.pp_double[2][1] = (double)9/(double)40; state->rkb.ptr.pp_double[3][0] = (double)3/(double)10; state->rkb.ptr.pp_double[3][1] = -(double)9/(double)10; state->rkb.ptr.pp_double[3][2] = (double)6/(double)5; state->rkb.ptr.pp_double[4][0] = -(double)11/(double)54; state->rkb.ptr.pp_double[4][1] = (double)5/(double)2; state->rkb.ptr.pp_double[4][2] = -(double)70/(double)27; state->rkb.ptr.pp_double[4][3] = (double)35/(double)27; state->rkb.ptr.pp_double[5][0] = (double)1631/(double)55296; state->rkb.ptr.pp_double[5][1] = (double)175/(double)512; state->rkb.ptr.pp_double[5][2] = (double)575/(double)13824; state->rkb.ptr.pp_double[5][3] = (double)44275/(double)110592; state->rkb.ptr.pp_double[5][4] = (double)253/(double)4096; ae_vector_set_length(&state->rkc, 6, _state); state->rkc.ptr.p_double[0] = (double)37/(double)378; state->rkc.ptr.p_double[1] = (double)(0); state->rkc.ptr.p_double[2] = (double)250/(double)621; state->rkc.ptr.p_double[3] = (double)125/(double)594; state->rkc.ptr.p_double[4] = (double)(0); state->rkc.ptr.p_double[5] = (double)512/(double)1771; ae_vector_set_length(&state->rkcs, 6, _state); state->rkcs.ptr.p_double[0] = (double)2825/(double)27648; state->rkcs.ptr.p_double[1] = (double)(0); state->rkcs.ptr.p_double[2] = (double)18575/(double)48384; state->rkcs.ptr.p_double[3] = (double)13525/(double)55296; state->rkcs.ptr.p_double[4] = (double)277/(double)14336; state->rkcs.ptr.p_double[5] = (double)1/(double)4; ae_matrix_set_length(&state->rkk, 6, n, _state); /* * Main cycle consists of two iterations: * * outer where we travel from X[i-1] to X[i] * * inner where we travel inside [X[i-1],X[i]] */ ae_matrix_set_length(&state->ytbl, m, n, _state); ae_vector_set_length(&state->escale, n, _state); ae_vector_set_length(&state->yn, n, _state); ae_vector_set_length(&state->yns, n, _state); xc = state->xg.ptr.p_double[0]; ae_v_move(&state->ytbl.ptr.pp_double[0][0], 1, &state->yc.ptr.p_double[0], 1, ae_v_len(0,n-1)); for(j=0; j<=n-1; j++) { state->escale.ptr.p_double[j] = (double)(0); } i = 1; lbl_3: if( i>m-1 ) { goto lbl_5; } /* * begin inner iteration */ lbl_6: if( ae_false ) { goto lbl_7; } /* * truncate step if needed (beyond right boundary). * determine should we store X or not */ if( ae_fp_greater_eq(xc+h,state->xg.ptr.p_double[i]) ) { h = state->xg.ptr.p_double[i]-xc; gridpoint = ae_true; } else { gridpoint = ae_false; } /* * Update error scale maximums * * These maximums are initialized by zeros, * then updated every iterations. */ for(j=0; j<=n-1; j++) { state->escale.ptr.p_double[j] = ae_maxreal(state->escale.ptr.p_double[j], ae_fabs(state->yc.ptr.p_double[j], _state), _state); } /* * make one step: * 1. calculate all info needed to do step * 2. update errors scale maximums using values/derivatives * obtained during (1) * * Take into account that we use scaling of X to reduce task * to the form where x[0] < x[1] < ... < x[n-1]. So X is * replaced by x=xscale*t, and dy/dx=f(y,x) is replaced * by dy/dt=xscale*f(y,xscale*t). */ ae_v_move(&state->yn.ptr.p_double[0], 1, &state->yc.ptr.p_double[0], 1, ae_v_len(0,n-1)); ae_v_move(&state->yns.ptr.p_double[0], 1, &state->yc.ptr.p_double[0], 1, ae_v_len(0,n-1)); k = 0; lbl_8: if( k>5 ) { goto lbl_10; } /* * prepare data for the next update of YN/YNS */ state->x = state->xscale*(xc+state->rka.ptr.p_double[k]*h); ae_v_move(&state->y.ptr.p_double[0], 1, &state->yc.ptr.p_double[0], 1, ae_v_len(0,n-1)); for(j=0; j<=k-1; j++) { v = state->rkb.ptr.pp_double[k][j]; ae_v_addd(&state->y.ptr.p_double[0], 1, &state->rkk.ptr.pp_double[j][0], 1, ae_v_len(0,n-1), v); } state->needdy = ae_true; state->rstate.stage = 0; goto lbl_rcomm; lbl_0: state->needdy = ae_false; state->repnfev = state->repnfev+1; v = h*state->xscale; ae_v_moved(&state->rkk.ptr.pp_double[k][0], 1, &state->dy.ptr.p_double[0], 1, ae_v_len(0,n-1), v); /* * update YN/YNS */ v = state->rkc.ptr.p_double[k]; ae_v_addd(&state->yn.ptr.p_double[0], 1, &state->rkk.ptr.pp_double[k][0], 1, ae_v_len(0,n-1), v); v = state->rkcs.ptr.p_double[k]; ae_v_addd(&state->yns.ptr.p_double[0], 1, &state->rkk.ptr.pp_double[k][0], 1, ae_v_len(0,n-1), v); k = k+1; goto lbl_8; lbl_10: /* * estimate error */ err = (double)(0); for(j=0; j<=n-1; j++) { if( !state->fraceps ) { /* * absolute error is estimated */ err = ae_maxreal(err, ae_fabs(state->yn.ptr.p_double[j]-state->yns.ptr.p_double[j], _state), _state); } else { /* * Relative error is estimated */ v = state->escale.ptr.p_double[j]; if( ae_fp_eq(v,(double)(0)) ) { v = (double)(1); } err = ae_maxreal(err, ae_fabs(state->yn.ptr.p_double[j]-state->yns.ptr.p_double[j], _state)/v, _state); } } /* * calculate new step, restart if necessary */ if( ae_fp_less_eq(maxgrowpow*err,state->eps) ) { h2 = odesolver_odesolvermaxgrow*h; } else { h2 = h*ae_pow(state->eps/err, 0.2, _state); } if( ae_fp_less(h2,h/odesolver_odesolvermaxshrink) ) { h2 = h/odesolver_odesolvermaxshrink; } if( ae_fp_greater(err,state->eps) ) { h = h2; goto lbl_6; } /* * advance position */ xc = xc+h; ae_v_move(&state->yc.ptr.p_double[0], 1, &state->yn.ptr.p_double[0], 1, ae_v_len(0,n-1)); /* * update H */ h = h2; /* * break on grid point */ if( gridpoint ) { goto lbl_7; } goto lbl_6; lbl_7: /* * save result */ ae_v_move(&state->ytbl.ptr.pp_double[i][0], 1, &state->yc.ptr.p_double[0], 1, ae_v_len(0,n-1)); i = i+1; goto lbl_3; lbl_5: state->repterminationtype = 1; result = ae_false; return result; lbl_1: result = ae_false; return result; /* * Saving state */ lbl_rcomm: result = ae_true; state->rstate.ia.ptr.p_int[0] = n; state->rstate.ia.ptr.p_int[1] = m; state->rstate.ia.ptr.p_int[2] = i; state->rstate.ia.ptr.p_int[3] = j; state->rstate.ia.ptr.p_int[4] = k; state->rstate.ia.ptr.p_int[5] = klimit; state->rstate.ba.ptr.p_bool[0] = gridpoint; state->rstate.ra.ptr.p_double[0] = xc; state->rstate.ra.ptr.p_double[1] = v; state->rstate.ra.ptr.p_double[2] = h; state->rstate.ra.ptr.p_double[3] = h2; state->rstate.ra.ptr.p_double[4] = err; state->rstate.ra.ptr.p_double[5] = maxgrowpow; return result; } /************************************************************************* ODE solver results Called after OdeSolverIteration returned False. INPUT PARAMETERS: State - algorithm state (used by OdeSolverIteration). OUTPUT PARAMETERS: M - number of tabulated values, M>=1 XTbl - array[0..M-1], values of X YTbl - array[0..M-1,0..N-1], values of Y in X[i] Rep - solver report: * Rep.TerminationType completetion code: * -2 X is not ordered by ascending/descending or there are non-distinct X[], i.e. X[i]=X[i+1] * -1 incorrect parameters were specified * 1 task has been solved * Rep.NFEV contains number of function calculations -- ALGLIB -- Copyright 01.09.2009 by Bochkanov Sergey *************************************************************************/ void odesolverresults(odesolverstate* state, ae_int_t* m, /* Real */ ae_vector* xtbl, /* Real */ ae_matrix* ytbl, odesolverreport* rep, ae_state *_state) { double v; ae_int_t i; *m = 0; ae_vector_clear(xtbl); ae_matrix_clear(ytbl); _odesolverreport_clear(rep); rep->terminationtype = state->repterminationtype; if( rep->terminationtype>0 ) { *m = state->m; rep->nfev = state->repnfev; ae_vector_set_length(xtbl, state->m, _state); v = state->xscale; ae_v_moved(&xtbl->ptr.p_double[0], 1, &state->xg.ptr.p_double[0], 1, ae_v_len(0,state->m-1), v); ae_matrix_set_length(ytbl, state->m, state->n, _state); for(i=0; i<=state->m-1; i++) { ae_v_move(&ytbl->ptr.pp_double[i][0], 1, &state->ytbl.ptr.pp_double[i][0], 1, ae_v_len(0,state->n-1)); } } else { rep->nfev = 0; } } /************************************************************************* Internal initialization subroutine *************************************************************************/ static void odesolver_odesolverinit(ae_int_t solvertype, /* Real */ ae_vector* y, ae_int_t n, /* Real */ ae_vector* x, ae_int_t m, double eps, double h, odesolverstate* state, ae_state *_state) { ae_int_t i; double v; _odesolverstate_clear(state); /* * Prepare RComm */ ae_vector_set_length(&state->rstate.ia, 5+1, _state); ae_vector_set_length(&state->rstate.ba, 0+1, _state); ae_vector_set_length(&state->rstate.ra, 5+1, _state); state->rstate.stage = -1; state->needdy = ae_false; /* * check parameters. */ if( (n<=0||m<1)||ae_fp_eq(eps,(double)(0)) ) { state->repterminationtype = -1; return; } if( ae_fp_less(h,(double)(0)) ) { h = -h; } /* * quick exit if necessary. * after this block we assume that M>1 */ if( m==1 ) { state->repnfev = 0; state->repterminationtype = 1; ae_matrix_set_length(&state->ytbl, 1, n, _state); ae_v_move(&state->ytbl.ptr.pp_double[0][0], 1, &y->ptr.p_double[0], 1, ae_v_len(0,n-1)); ae_vector_set_length(&state->xg, m, _state); ae_v_move(&state->xg.ptr.p_double[0], 1, &x->ptr.p_double[0], 1, ae_v_len(0,m-1)); return; } /* * check again: correct order of X[] */ if( ae_fp_eq(x->ptr.p_double[1],x->ptr.p_double[0]) ) { state->repterminationtype = -2; return; } for(i=1; i<=m-1; i++) { if( (ae_fp_greater(x->ptr.p_double[1],x->ptr.p_double[0])&&ae_fp_less_eq(x->ptr.p_double[i],x->ptr.p_double[i-1]))||(ae_fp_less(x->ptr.p_double[1],x->ptr.p_double[0])&&ae_fp_greater_eq(x->ptr.p_double[i],x->ptr.p_double[i-1])) ) { state->repterminationtype = -2; return; } } /* * auto-select H if necessary */ if( ae_fp_eq(h,(double)(0)) ) { v = ae_fabs(x->ptr.p_double[1]-x->ptr.p_double[0], _state); for(i=2; i<=m-1; i++) { v = ae_minreal(v, ae_fabs(x->ptr.p_double[i]-x->ptr.p_double[i-1], _state), _state); } h = 0.001*v; } /* * store parameters */ state->n = n; state->m = m; state->h = h; state->eps = ae_fabs(eps, _state); state->fraceps = ae_fp_less(eps,(double)(0)); ae_vector_set_length(&state->xg, m, _state); ae_v_move(&state->xg.ptr.p_double[0], 1, &x->ptr.p_double[0], 1, ae_v_len(0,m-1)); if( ae_fp_greater(x->ptr.p_double[1],x->ptr.p_double[0]) ) { state->xscale = (double)(1); } else { state->xscale = (double)(-1); ae_v_muld(&state->xg.ptr.p_double[0], 1, ae_v_len(0,m-1), -1); } ae_vector_set_length(&state->yc, n, _state); ae_v_move(&state->yc.ptr.p_double[0], 1, &y->ptr.p_double[0], 1, ae_v_len(0,n-1)); state->solvertype = solvertype; state->repterminationtype = 0; /* * Allocate arrays */ ae_vector_set_length(&state->y, n, _state); ae_vector_set_length(&state->dy, n, _state); } void _odesolverstate_init(void* _p, ae_state *_state) { odesolverstate *p = (odesolverstate*)_p; ae_touch_ptr((void*)p); ae_vector_init(&p->yc, 0, DT_REAL, _state); ae_vector_init(&p->escale, 0, DT_REAL, _state); ae_vector_init(&p->xg, 0, DT_REAL, _state); ae_vector_init(&p->y, 0, DT_REAL, _state); ae_vector_init(&p->dy, 0, DT_REAL, _state); ae_matrix_init(&p->ytbl, 0, 0, DT_REAL, _state); ae_vector_init(&p->yn, 0, DT_REAL, _state); ae_vector_init(&p->yns, 0, DT_REAL, _state); ae_vector_init(&p->rka, 0, DT_REAL, _state); ae_vector_init(&p->rkc, 0, DT_REAL, _state); ae_vector_init(&p->rkcs, 0, DT_REAL, _state); ae_matrix_init(&p->rkb, 0, 0, DT_REAL, _state); ae_matrix_init(&p->rkk, 0, 0, DT_REAL, _state); _rcommstate_init(&p->rstate, _state); } void _odesolverstate_init_copy(void* _dst, void* _src, ae_state *_state) { odesolverstate *dst = (odesolverstate*)_dst; odesolverstate *src = (odesolverstate*)_src; dst->n = src->n; dst->m = src->m; dst->xscale = src->xscale; dst->h = src->h; dst->eps = src->eps; dst->fraceps = src->fraceps; ae_vector_init_copy(&dst->yc, &src->yc, _state); ae_vector_init_copy(&dst->escale, &src->escale, _state); ae_vector_init_copy(&dst->xg, &src->xg, _state); dst->solvertype = src->solvertype; dst->needdy = src->needdy; dst->x = src->x; ae_vector_init_copy(&dst->y, &src->y, _state); ae_vector_init_copy(&dst->dy, &src->dy, _state); ae_matrix_init_copy(&dst->ytbl, &src->ytbl, _state); dst->repterminationtype = src->repterminationtype; dst->repnfev = src->repnfev; ae_vector_init_copy(&dst->yn, &src->yn, _state); ae_vector_init_copy(&dst->yns, &src->yns, _state); ae_vector_init_copy(&dst->rka, &src->rka, _state); ae_vector_init_copy(&dst->rkc, &src->rkc, _state); ae_vector_init_copy(&dst->rkcs, &src->rkcs, _state); ae_matrix_init_copy(&dst->rkb, &src->rkb, _state); ae_matrix_init_copy(&dst->rkk, &src->rkk, _state); _rcommstate_init_copy(&dst->rstate, &src->rstate, _state); } void _odesolverstate_clear(void* _p) { odesolverstate *p = (odesolverstate*)_p; ae_touch_ptr((void*)p); ae_vector_clear(&p->yc); ae_vector_clear(&p->escale); ae_vector_clear(&p->xg); ae_vector_clear(&p->y); ae_vector_clear(&p->dy); ae_matrix_clear(&p->ytbl); ae_vector_clear(&p->yn); ae_vector_clear(&p->yns); ae_vector_clear(&p->rka); ae_vector_clear(&p->rkc); ae_vector_clear(&p->rkcs); ae_matrix_clear(&p->rkb); ae_matrix_clear(&p->rkk); _rcommstate_clear(&p->rstate); } void _odesolverstate_destroy(void* _p) { odesolverstate *p = (odesolverstate*)_p; ae_touch_ptr((void*)p); ae_vector_destroy(&p->yc); ae_vector_destroy(&p->escale); ae_vector_destroy(&p->xg); ae_vector_destroy(&p->y); ae_vector_destroy(&p->dy); ae_matrix_destroy(&p->ytbl); ae_vector_destroy(&p->yn); ae_vector_destroy(&p->yns); ae_vector_destroy(&p->rka); ae_vector_destroy(&p->rkc); ae_vector_destroy(&p->rkcs); ae_matrix_destroy(&p->rkb); ae_matrix_destroy(&p->rkk); _rcommstate_destroy(&p->rstate); } void _odesolverreport_init(void* _p, ae_state *_state) { odesolverreport *p = (odesolverreport*)_p; ae_touch_ptr((void*)p); } void _odesolverreport_init_copy(void* _dst, void* _src, ae_state *_state) { odesolverreport *dst = (odesolverreport*)_dst; odesolverreport *src = (odesolverreport*)_src; dst->nfev = src->nfev; dst->terminationtype = src->terminationtype; } void _odesolverreport_clear(void* _p) { odesolverreport *p = (odesolverreport*)_p; ae_touch_ptr((void*)p); } void _odesolverreport_destroy(void* _p) { odesolverreport *p = (odesolverreport*)_p; ae_touch_ptr((void*)p); } }
35.957735
278
0.590983
prcvlabs
be0a77ef2bc95116abf1dc0136905aea561d0411
2,816
cpp
C++
src/equation/lu/lu_mumps_cpu.cpp
rigarash/monolish-debian-package
70b4917370184bcf07378e1907c5239a1ad9579b
[ "Apache-2.0" ]
172
2021-04-05T10:04:40.000Z
2022-03-28T14:30:38.000Z
src/equation/lu/lu_mumps_cpu.cpp
rigarash/monolish-debian-package
70b4917370184bcf07378e1907c5239a1ad9579b
[ "Apache-2.0" ]
96
2021-04-06T01:53:44.000Z
2022-03-09T07:27:09.000Z
src/equation/lu/lu_mumps_cpu.cpp
termoshtt/monolish
1cba60864002b55bc666da9baa0f8c2273578e01
[ "Apache-2.0" ]
8
2021-04-05T13:21:07.000Z
2022-03-09T23:24:06.000Z
#include "../../../include/monolish_blas.hpp" #include "../../../include/monolish_equation.hpp" #include "../../internal/monolish_internal.hpp" // #include "dmumps_c.h" // #include "mpi.h" #define JOB_INIT -1 #define JOB_END -2 #define USE_COMM_WORLD -987654 namespace monolish { // mumps is choushi warui.. template <> int equation::LU<matrix::CRS<double>, double>::mumps_LU(matrix::CRS<double> &A, vector<double> &x, vector<double> &b) { Logger &logger = Logger::get_instance(); logger.func_in(monolish_func); (void)(&A); (void)(&x); (void)(&b); if (1) { throw std::runtime_error("error sparse LU on CPU does not impl."); } // DMUMPS_STRUC_C id; // MUMPS_INT n = A.get_row(); // MUMPS_INT8 nnz = A.get_nnz(); // // // covert mumps format (CRS -> 1-origin COO) // std::vector<int>tmp_row(nnz); // std::vector<int>tmp_col(nnz); // for(int i=0; i<n; i++){ // for(int j = A.row_ptr[i]; j < A.row_ptr[i+1]; j++){ // tmp_row[j] = i+1; // tmp_row[j] = A.col_ind[j]+1; // } // } // MUMPS_INT* irn = A.row_ptr.data(); // MUMPS_INT* jcn = A.col_ind.data(); // // double* a = A.val.data(); // double* rhs = b.data(); // // MUMPS_INT myid, ierr; // int* dummy; // char*** dummyc; // // int error = 0; // #if defined(MAIN_COMP) // argv = &name; // #endif // ierr = MPI_Init(dummy, dummyc); // ierr = MPI_Comm_rank(MPI_COMM_WORLD, &myid); // // /* Initialize a MUMPS instance. Use MPI_COMM_WORLD */ // id.comm_fortran=USE_COMM_WORLD; // id.par=1; id.sym=0; // id.job=JOB_INIT; // dmumps_c(&id); // // /* Define the problem on the host */ // if (myid == 0) { // id.n = n; id.nnz =nnz; id.irn=irn; id.jcn=jcn; // id.a = a; id.rhs = rhs; // } // // #define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */ // /* No outputs */ // id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; // // /* Call the MUMPS package (analyse, factorization and solve). */ // id.job=6; // dmumps_c(&id); // if (id.infog[0]<0) { // printf(" (PROC %d) ERROR RETURN: \tINFOG(1)= // %d\n\t\t\t\tINFOG(2)= // %d\n", myid, id.infog[0], id.infog[1]); // error = 1; // } // // /* Terminate instance. */ // id.job=JOB_END; // dmumps_c(&id); // if (myid == 0) { // if (!error) { // printf("Solution is : (%8.2f %8.2f)\n", // rhs[0],rhs[1]); } else { // printf("An error has occured, please check error code returned by // MUMPS.\n"); // } // } // ierr = MPI_Finalize(); logger.func_out(); return 0; } } // namespace monolish
27.607843
79
0.51669
rigarash
be0bd4470583830df7a5937b497088823737d0a1
1,387
cc
C++
solutions/online-judge/362.cc
zwliew/ctci
871f4fc957be96c6d0749d205549b7b35dc53d9e
[ "MIT" ]
4
2020-11-07T14:38:02.000Z
2022-01-03T19:02:36.000Z
solutions/online-judge/362.cc
zwliew/ctci
871f4fc957be96c6d0749d205549b7b35dc53d9e
[ "MIT" ]
1
2019-04-17T06:55:14.000Z
2019-04-17T06:55:14.000Z
solutions/online-judge/362.cc
zwliew/ctci
871f4fc957be96c6d0749d205549b7b35dc53d9e
[ "MIT" ]
null
null
null
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <climits> #include <cmath> #include <cstring> #include <deque> #include <ext/pb_ds/assoc_container.hpp> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #ifdef LOCAL #include "../../_library/cc/debug.h" #define FILE "test" #else #define debug(...) 0 #define FILE "" #endif int main() { cin.tie(nullptr)->sync_with_stdio(false); if (fopen(FILE ".in", "r")) { freopen(FILE ".in", "r", stdin); freopen(FILE ".out", "w", stdout); } int target; int ti = 1; while (cin >> target && target) { int thusFar = 0; int prev5s = 0; int time = 0; int x; cout << "Output for data set " << ti << ", " << target << " bytes:\n"; while (thusFar != target) { cin >> x; ++time; thusFar += x; prev5s += x; if (time % 5 == 0) { cout << " Time remaining: "; if (prev5s) { cout << (5 * target - 5 * thusFar + prev5s - 1) / prev5s << " seconds\n"; } else { cout << "stalled\n"; } prev5s = 0; } } cout << "Total time: " << time << " seconds\n\n"; ++ti; } }
20.397059
74
0.549387
zwliew
be0f9301fd27d653611d4f9dd16aa97fac781adc
1,018
hpp
C++
src/filters_cpp/src/filters.hpp
satvik007/Scanner_OP
c146f67e3851cd537d62989842abfee7d34de2c0
[ "MIT" ]
null
null
null
src/filters_cpp/src/filters.hpp
satvik007/Scanner_OP
c146f67e3851cd537d62989842abfee7d34de2c0
[ "MIT" ]
null
null
null
src/filters_cpp/src/filters.hpp
satvik007/Scanner_OP
c146f67e3851cd537d62989842abfee7d34de2c0
[ "MIT" ]
1
2021-05-10T10:14:27.000Z
2021-05-10T10:14:27.000Z
/** * This document is part of the project ScanIN. See License for more details. * This is implementation of all the filters of the app, it contains the following filters * - Magic * - Sepia * - Lighten * - Gray * - Sharpen * Author : Satvik Choudhary * Created on : 8 July 2020 */ #ifndef __FILTERS_HPP__ #define __FILTERS_HPP__ #include <opencv2/core/core.hpp> #include <opencv2/imgproc.hpp> void resize_image_if_bigger (cv::Mat &input, cv::Mat &dst, const int dim=1536, const int interpolation=cv::INTER_AREA); void magic_filter (cv::Mat &src, cv::Mat &dst, const double alpha=1.5, const int beta=0, const int threshold=0); void sepia_filter (cv::Mat &src, cv::Mat &dst); void lighten_filter (cv::Mat &src, cv::Mat &dst); void gray_filter (cv::Mat &src, cv::Mat &dst); void dark_magic_filter (cv::Mat &src, cv::Mat &dst); void sharpen_filter (cv::Mat &src, cv::Mat &dst, cv::Size kernel_size=cv::Size(5, 5), const double sigma=1.0, const double amount=1.0, const int threshold=0); #endif
31.8125
158
0.70334
satvik007
be1227178877f99896d09f3483eb5d7e0ced186f
1,593
cc
C++
PhysicsTools/TagAndProbe/src/RooCBExGaussShape.cc
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
1
2020-08-12T08:37:04.000Z
2020-08-12T08:37:04.000Z
PhysicsTools/TagAndProbe/src/RooCBExGaussShape.cc
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
5
2021-03-09T10:27:32.000Z
2021-12-08T18:47:35.000Z
PhysicsTools/TagAndProbe/src/RooCBExGaussShape.cc
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
1
2019-03-19T13:44:54.000Z
2019-03-19T13:44:54.000Z
#include "PhysicsTools/TagAndProbe/interface/RooCBExGaussShape.h" ClassImp(RooCBExGaussShape) RooCBExGaussShape::RooCBExGaussShape(const char *name, const char *title, RooAbsReal& _m, RooAbsReal& _m0, RooAbsReal& _sigma, RooAbsReal& _alpha, RooAbsReal& _n, RooAbsReal& _sigma_2, RooAbsReal& _frac ) : RooAbsPdf(name,title), m("m","m",this,_m), m0(" m0"," m0",this,_m0), sigma(" sigma"," sigma",this,_sigma), alpha(" alpha"," alpha",this,_alpha), n(" n"," n",this,_n), sigma_2(" sigma_2"," sigma_2",this,_sigma_2), frac(" frac"," frac",this,_frac) { } RooCBExGaussShape::RooCBExGaussShape(const RooCBExGaussShape& other, const char* name): RooAbsPdf(other,name), m("m",this,other.m), m0(" m0",this,other. m0), sigma(" sigma",this,other. sigma), alpha(" alpha",this,other. alpha), n(" n",this,other. n), sigma_2(" sigma_2",this,other. sigma_2), frac(" frac",this,other. frac) { } Double_t RooCBExGaussShape::evaluate() const { Double_t rval=0; Double_t t = (m-m0)/sigma; Double_t t0 = (m-m0)/sigma_2; if (alpha < 0){ t = -t; t0 = -t0; } Double_t absAlpha = fabs((Double_t)alpha); if (t >= -absAlpha) { rval= frac*exp(-0.5*t*t) + (1.0-frac)*exp(-0.5*t0*t0); } else { Double_t a = TMath::Power(n/absAlpha,n)*exp(-0.5*absAlpha*absAlpha); Double_t b= n/absAlpha - absAlpha; rval= a/TMath::Power(b - t, n); } //std::cout<<"RooCBExGaussShape: m, evaluate= "<<m<<", "<<rval<<std::endl; return rval; }
26.114754
87
0.600753
nistefan
be13fed23660a6a5a4180e8493276df85e869a86
597
cpp
C++
src/Audio.cpp
flipcoder/bitplanes
6d37b261929bac815cd97b09b00baa60dc55b950
[ "MIT" ]
5
2015-08-14T15:27:35.000Z
2019-07-08T07:06:22.000Z
src/Audio.cpp
flipcoder/bitplanes
6d37b261929bac815cd97b09b00baa60dc55b950
[ "MIT" ]
null
null
null
src/Audio.cpp
flipcoder/bitplanes
6d37b261929bac815cd97b09b00baa60dc55b950
[ "MIT" ]
null
null
null
#include "Audio.h" Audio::Sound :: Sound(const std::string& fn): IConfigurable(fn, "data/audio/") { nullify(); scoped_dtor<Sound> dtor(this); //m_spSample = sample; m_spSample = Audio::get().samples().cache(fn); // might throw if(!(m_pSound = al_create_sample_instance(m_spSample->sample()))) throw Failure(); al_attach_sample_instance_to_mixer(m_pSound, al_get_default_mixer()); // disambiguate the overloaded positioned() accessor callbackOnMove(std::bind((void(Audio::Sound::*)(bool))&Audio::Sound::positioned, this, true)); dtor.resolve(); }
31.421053
98
0.675042
flipcoder
be1462aa6602c994fd635fae6f6e2f94dea022d7
19,750
cpp
C++
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
[ "Apache-2.0" ]
427
2018-05-29T14:21:02.000Z
2022-03-16T03:17:54.000Z
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
PolideaPlayground/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
[ "Apache-2.0" ]
25
2018-07-23T08:34:15.000Z
2021-11-05T07:13:36.000Z
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
PolideaPlayground/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
[ "Apache-2.0" ]
52
2018-07-19T19:57:32.000Z
2022-03-11T16:05:38.000Z
//===-- DebuggerThread.cpp --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "DebuggerThread.h" #include "ExceptionRecord.h" #include "IDebugDelegate.h" #include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Predicate.h" #include "lldb/Host/ThisThread.h" #include "lldb/Host/ThreadLauncher.h" #include "lldb/Host/windows/HostProcessWindows.h" #include "lldb/Host/windows/HostThreadWindows.h" #include "lldb/Host/windows/ProcessLauncherWindows.h" #include "lldb/Target/Process.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/raw_ostream.h" using namespace lldb; using namespace lldb_private; namespace { struct DebugLaunchContext { DebugLaunchContext(DebuggerThread *thread, const ProcessLaunchInfo &launch_info) : m_thread(thread), m_launch_info(launch_info) {} DebuggerThread *m_thread; ProcessLaunchInfo m_launch_info; }; struct DebugAttachContext { DebugAttachContext(DebuggerThread *thread, lldb::pid_t pid, const ProcessAttachInfo &attach_info) : m_thread(thread), m_pid(pid), m_attach_info(attach_info) {} DebuggerThread *m_thread; lldb::pid_t m_pid; ProcessAttachInfo m_attach_info; }; } DebuggerThread::DebuggerThread(DebugDelegateSP debug_delegate) : m_debug_delegate(debug_delegate), m_pid_to_detach(0), m_is_shutting_down(false) { m_debugging_ended_event = ::CreateEvent(nullptr, TRUE, FALSE, nullptr); } DebuggerThread::~DebuggerThread() { ::CloseHandle(m_debugging_ended_event); } Error DebuggerThread::DebugLaunch(const ProcessLaunchInfo &launch_info) { WINLOG_IFALL(WINDOWS_LOG_PROCESS, "DebuggerThread::DebugLaunch launching '%s'", launch_info.GetExecutableFile().GetPath().c_str()); Error error; DebugLaunchContext *context = new DebugLaunchContext(this, launch_info); HostThread slave_thread(ThreadLauncher::LaunchThread( "lldb.plugin.process-windows.slave[?]", DebuggerThreadLaunchRoutine, context, &error)); if (!error.Success()) { WINERR_IFALL(WINDOWS_LOG_PROCESS, "DebugLaunch couldn't launch debugger thread. %s", error.AsCString()); } return error; } Error DebuggerThread::DebugAttach(lldb::pid_t pid, const ProcessAttachInfo &attach_info) { WINLOG_IFALL(WINDOWS_LOG_PROCESS, "DebuggerThread::DebugAttach attaching to '%llu'", pid); Error error; DebugAttachContext *context = new DebugAttachContext(this, pid, attach_info); HostThread slave_thread(ThreadLauncher::LaunchThread( "lldb.plugin.process-windows.slave[?]", DebuggerThreadAttachRoutine, context, &error)); if (!error.Success()) { WINERR_IFALL(WINDOWS_LOG_PROCESS, "DebugAttach couldn't attach to process '%llu'. %s", pid, error.AsCString()); } return error; } lldb::thread_result_t DebuggerThread::DebuggerThreadLaunchRoutine(void *data) { DebugLaunchContext *context = static_cast<DebugLaunchContext *>(data); lldb::thread_result_t result = context->m_thread->DebuggerThreadLaunchRoutine(context->m_launch_info); delete context; return result; } lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine(void *data) { DebugAttachContext *context = static_cast<DebugAttachContext *>(data); lldb::thread_result_t result = context->m_thread->DebuggerThreadAttachRoutine( context->m_pid, context->m_attach_info); delete context; return result; } lldb::thread_result_t DebuggerThread::DebuggerThreadLaunchRoutine( const ProcessLaunchInfo &launch_info) { // Grab a shared_ptr reference to this so that we know it won't get deleted // until after the // thread routine has exited. std::shared_ptr<DebuggerThread> this_ref(shared_from_this()); WINLOG_IFALL(WINDOWS_LOG_PROCESS, "DebuggerThread preparing to launch '%s' on background thread.", launch_info.GetExecutableFile().GetPath().c_str()); Error error; ProcessLauncherWindows launcher; HostProcess process(launcher.LaunchProcess(launch_info, error)); // If we couldn't create the process, notify waiters immediately. Otherwise // enter the debug // loop and wait until we get the create process debug notification. Note // that if the process // was created successfully, we can throw away the process handle we got from // CreateProcess // because Windows will give us another (potentially more useful?) handle when // it sends us the // CREATE_PROCESS_DEBUG_EVENT. if (error.Success()) DebugLoop(); else m_debug_delegate->OnDebuggerError(error, 0); return 0; } lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine( lldb::pid_t pid, const ProcessAttachInfo &attach_info) { // Grab a shared_ptr reference to this so that we know it won't get deleted // until after the // thread routine has exited. std::shared_ptr<DebuggerThread> this_ref(shared_from_this()); WINLOG_IFALL(WINDOWS_LOG_PROCESS, "DebuggerThread preparing to attach to " "process '%llu' on background thread.", pid); if (!DebugActiveProcess((DWORD)pid)) { Error error(::GetLastError(), eErrorTypeWin32); m_debug_delegate->OnDebuggerError(error, 0); return 0; } // The attach was successful, enter the debug loop. From here on out, this is // no different than // a create process operation, so all the same comments in DebugLaunch should // apply from this // point out. DebugLoop(); return 0; } Error DebuggerThread::StopDebugging(bool terminate) { Error error; lldb::pid_t pid = m_process.GetProcessId(); WINLOG_IFALL(WINDOWS_LOG_PROCESS, "StopDebugging('%s') called (inferior=%I64u).", (terminate ? "true" : "false"), pid); // Set m_is_shutting_down to true if it was false. Return if it was already // true. bool expected = false; if (!m_is_shutting_down.compare_exchange_strong(expected, true)) return error; // Make a copy of the process, since the termination sequence will reset // DebuggerThread's internal copy and it needs to remain open for the Wait // operation. HostProcess process_copy = m_process; lldb::process_t handle = m_process.GetNativeProcess().GetSystemHandle(); if (terminate) { // Initiate the termination before continuing the exception, so that the // next debug // event we get is the exit process event, and not some other event. BOOL terminate_suceeded = TerminateProcess(handle, 0); WINLOG_IFALL(WINDOWS_LOG_PROCESS, "StopDebugging called " "TerminateProcess(0x%p, 0) " "(inferior=%I64u), success='%s'", handle, pid, (terminate_suceeded ? "true" : "false")); } // If we're stuck waiting for an exception to continue (e.g. the user is at a // breakpoint // messing around in the debugger), continue it now. But only AFTER calling // TerminateProcess // to make sure that the very next call to WaitForDebugEvent is an exit // process event. if (m_active_exception.get()) { WINLOG_IFANY(WINDOWS_LOG_PROCESS | WINDOWS_LOG_EXCEPTION, "StopDebugging masking active exception"); ContinueAsyncException(ExceptionResult::MaskException); } if (!terminate) { // Indicate that we want to detach. m_pid_to_detach = GetProcess().GetProcessId(); // Force a fresh break so that the detach can happen from the debugger // thread. if (!::DebugBreakProcess( GetProcess().GetNativeProcess().GetSystemHandle())) { error.SetError(::GetLastError(), eErrorTypeWin32); } } WINLOG_IFALL( WINDOWS_LOG_PROCESS, "StopDebugging waiting for detach from process %llu to complete.", pid); DWORD wait_result = WaitForSingleObject(m_debugging_ended_event, 5000); if (wait_result != WAIT_OBJECT_0) { error.SetError(GetLastError(), eErrorTypeWin32); WINERR_IFALL(WINDOWS_LOG_PROCESS, "StopDebugging WaitForSingleObject(0x%p, 5000) returned %lu", m_debugging_ended_event, wait_result); } else { WINLOG_IFALL( WINDOWS_LOG_PROCESS, "StopDebugging detach from process %llu completed successfully.", pid); } if (!error.Success()) { WINERR_IFALL(WINDOWS_LOG_PROCESS, "StopDebugging encountered an error " "while trying to stop process %llu. %s", pid, error.AsCString()); } return error; } void DebuggerThread::ContinueAsyncException(ExceptionResult result) { if (!m_active_exception.get()) return; WINLOG_IFANY( WINDOWS_LOG_PROCESS | WINDOWS_LOG_EXCEPTION, "ContinueAsyncException called for inferior process %I64u, broadcasting.", m_process.GetProcessId()); m_active_exception.reset(); m_exception_pred.SetValue(result, eBroadcastAlways); } void DebuggerThread::FreeProcessHandles() { m_process = HostProcess(); m_main_thread = HostThread(); if (m_image_file) { ::CloseHandle(m_image_file); m_image_file = nullptr; } } void DebuggerThread::DebugLoop() { DEBUG_EVENT dbe = {}; bool should_debug = true; WINLOG_IFALL(WINDOWS_LOG_EVENT, "Entering WaitForDebugEvent loop"); while (should_debug) { WINLOGD_IFALL(WINDOWS_LOG_EVENT, "Calling WaitForDebugEvent"); BOOL wait_result = WaitForDebugEvent(&dbe, INFINITE); if (wait_result) { DWORD continue_status = DBG_CONTINUE; switch (dbe.dwDebugEventCode) { case EXCEPTION_DEBUG_EVENT: { ExceptionResult status = HandleExceptionEvent(dbe.u.Exception, dbe.dwThreadId); if (status == ExceptionResult::MaskException) continue_status = DBG_CONTINUE; else if (status == ExceptionResult::SendToApplication) continue_status = DBG_EXCEPTION_NOT_HANDLED; break; } case CREATE_THREAD_DEBUG_EVENT: continue_status = HandleCreateThreadEvent(dbe.u.CreateThread, dbe.dwThreadId); break; case CREATE_PROCESS_DEBUG_EVENT: continue_status = HandleCreateProcessEvent(dbe.u.CreateProcessInfo, dbe.dwThreadId); break; case EXIT_THREAD_DEBUG_EVENT: continue_status = HandleExitThreadEvent(dbe.u.ExitThread, dbe.dwThreadId); break; case EXIT_PROCESS_DEBUG_EVENT: continue_status = HandleExitProcessEvent(dbe.u.ExitProcess, dbe.dwThreadId); should_debug = false; break; case LOAD_DLL_DEBUG_EVENT: continue_status = HandleLoadDllEvent(dbe.u.LoadDll, dbe.dwThreadId); break; case UNLOAD_DLL_DEBUG_EVENT: continue_status = HandleUnloadDllEvent(dbe.u.UnloadDll, dbe.dwThreadId); break; case OUTPUT_DEBUG_STRING_EVENT: continue_status = HandleODSEvent(dbe.u.DebugString, dbe.dwThreadId); break; case RIP_EVENT: continue_status = HandleRipEvent(dbe.u.RipInfo, dbe.dwThreadId); if (dbe.u.RipInfo.dwType == SLE_ERROR) should_debug = false; break; } WINLOGD_IFALL( WINDOWS_LOG_EVENT, "DebugLoop calling ContinueDebugEvent(%lu, %lu, %lu) on thread %lu.", dbe.dwProcessId, dbe.dwThreadId, continue_status, ::GetCurrentThreadId()); ::ContinueDebugEvent(dbe.dwProcessId, dbe.dwThreadId, continue_status); if (m_detached) { should_debug = false; } } else { WINERR_IFALL( WINDOWS_LOG_EVENT, "DebugLoop returned FALSE from WaitForDebugEvent. Error = %lu", ::GetLastError()); should_debug = false; } } FreeProcessHandles(); WINLOG_IFALL(WINDOWS_LOG_EVENT, "WaitForDebugEvent loop completed, exiting."); SetEvent(m_debugging_ended_event); } ExceptionResult DebuggerThread::HandleExceptionEvent(const EXCEPTION_DEBUG_INFO &info, DWORD thread_id) { if (m_is_shutting_down) { // A breakpoint that occurs while `m_pid_to_detach` is non-zero is a magic // exception that // we use simply to wake up the DebuggerThread so that we can close out the // debug loop. if (m_pid_to_detach != 0 && info.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT) { WINLOG_IFANY(WINDOWS_LOG_EVENT | WINDOWS_LOG_EXCEPTION | WINDOWS_LOG_PROCESS, "Breakpoint exception is cue to detach from process 0x%lx", m_pid_to_detach.load()); ::DebugActiveProcessStop(m_pid_to_detach); m_detached = true; } // Don't perform any blocking operations while we're shutting down. That // will // cause TerminateProcess -> WaitForSingleObject to time out. return ExceptionResult::SendToApplication; } bool first_chance = (info.dwFirstChance != 0); m_active_exception.reset( new ExceptionRecord(info.ExceptionRecord, thread_id)); WINLOG_IFANY(WINDOWS_LOG_EVENT | WINDOWS_LOG_EXCEPTION, "HandleExceptionEvent encountered %s chance exception 0x%lx on " "thread 0x%lx", first_chance ? "first" : "second", info.ExceptionRecord.ExceptionCode, thread_id); ExceptionResult result = m_debug_delegate->OnDebugException(first_chance, *m_active_exception); m_exception_pred.SetValue(result, eBroadcastNever); WINLOG_IFANY(WINDOWS_LOG_EVENT | WINDOWS_LOG_EXCEPTION, "DebuggerThread::HandleExceptionEvent waiting for ExceptionPred " "!= BreakInDebugger"); m_exception_pred.WaitForValueNotEqualTo(ExceptionResult::BreakInDebugger, result); WINLOG_IFANY(WINDOWS_LOG_EVENT | WINDOWS_LOG_EXCEPTION, "DebuggerThread::HandleExceptionEvent got ExceptionPred = %u", m_exception_pred.GetValue()); return result; } DWORD DebuggerThread::HandleCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO &info, DWORD thread_id) { WINLOG_IFANY(WINDOWS_LOG_EVENT | WINDOWS_LOG_THREAD, "HandleCreateThreadEvent Thread 0x%lx spawned in process %llu", thread_id, m_process.GetProcessId()); HostThread thread(info.hThread); thread.GetNativeThread().SetOwnsHandle(false); m_debug_delegate->OnCreateThread(thread); return DBG_CONTINUE; } DWORD DebuggerThread::HandleCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO &info, DWORD thread_id) { uint32_t process_id = ::GetProcessId(info.hProcess); WINLOG_IFANY(WINDOWS_LOG_EVENT | WINDOWS_LOG_PROCESS, "HandleCreateProcessEvent process %u spawned", process_id); std::string thread_name; llvm::raw_string_ostream name_stream(thread_name); name_stream << "lldb.plugin.process-windows.slave[" << process_id << "]"; name_stream.flush(); ThisThread::SetName(thread_name.c_str()); // info.hProcess and info.hThread are closed automatically by Windows when // EXIT_PROCESS_DEBUG_EVENT is received. m_process = HostProcess(info.hProcess); ((HostProcessWindows &)m_process.GetNativeProcess()).SetOwnsHandle(false); m_main_thread = HostThread(info.hThread); m_main_thread.GetNativeThread().SetOwnsHandle(false); m_image_file = info.hFile; lldb::addr_t load_addr = reinterpret_cast<lldb::addr_t>(info.lpBaseOfImage); m_debug_delegate->OnDebuggerConnected(load_addr); return DBG_CONTINUE; } DWORD DebuggerThread::HandleExitThreadEvent(const EXIT_THREAD_DEBUG_INFO &info, DWORD thread_id) { WINLOG_IFANY( WINDOWS_LOG_EVENT | WINDOWS_LOG_THREAD, "HandleExitThreadEvent Thread %lu exited with code %lu in process %llu", thread_id, info.dwExitCode, m_process.GetProcessId()); m_debug_delegate->OnExitThread(thread_id, info.dwExitCode); return DBG_CONTINUE; } DWORD DebuggerThread::HandleExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO &info, DWORD thread_id) { WINLOG_IFANY(WINDOWS_LOG_EVENT | WINDOWS_LOG_THREAD, "HandleExitProcessEvent process %llu exited with code %lu", m_process.GetProcessId(), info.dwExitCode); m_debug_delegate->OnExitProcess(info.dwExitCode); FreeProcessHandles(); return DBG_CONTINUE; } DWORD DebuggerThread::HandleLoadDllEvent(const LOAD_DLL_DEBUG_INFO &info, DWORD thread_id) { if (info.hFile == nullptr) { // Not sure what this is, so just ignore it. WINWARN_IFALL(WINDOWS_LOG_EVENT, "Inferior %llu - HandleLoadDllEvent has " "a NULL file handle, returning...", m_process.GetProcessId()); return DBG_CONTINUE; } std::vector<wchar_t> buffer(1); DWORD required_size = GetFinalPathNameByHandleW(info.hFile, &buffer[0], 0, VOLUME_NAME_DOS); if (required_size > 0) { buffer.resize(required_size + 1); required_size = GetFinalPathNameByHandleW(info.hFile, &buffer[0], required_size, VOLUME_NAME_DOS); std::string path_str_utf8; llvm::convertWideToUTF8(buffer.data(), path_str_utf8); llvm::StringRef path_str = path_str_utf8; const char *path = path_str.data(); if (path_str.startswith("\\\\?\\")) path += 4; FileSpec file_spec(path, false); ModuleSpec module_spec(file_spec); lldb::addr_t load_addr = reinterpret_cast<lldb::addr_t>(info.lpBaseOfDll); WINLOG_IFALL(WINDOWS_LOG_EVENT, "Inferior %I64u - HandleLoadDllEvent DLL " "'%s' loaded at address 0x%p...", m_process.GetProcessId(), path, info.lpBaseOfDll); m_debug_delegate->OnLoadDll(module_spec, load_addr); } else { WINERR_IFALL(WINDOWS_LOG_EVENT, "Inferior %llu - HandleLoadDllEvent Error " "%lu occurred calling " "GetFinalPathNameByHandle", m_process.GetProcessId(), ::GetLastError()); } // Windows does not automatically close info.hFile, so we need to do it. ::CloseHandle(info.hFile); return DBG_CONTINUE; } DWORD DebuggerThread::HandleUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO &info, DWORD thread_id) { WINLOG_IFALL(WINDOWS_LOG_EVENT, "HandleUnloadDllEvent process %llu unloading DLL at addr 0x%p.", m_process.GetProcessId(), info.lpBaseOfDll); m_debug_delegate->OnUnloadDll( reinterpret_cast<lldb::addr_t>(info.lpBaseOfDll)); return DBG_CONTINUE; } DWORD DebuggerThread::HandleODSEvent(const OUTPUT_DEBUG_STRING_INFO &info, DWORD thread_id) { return DBG_CONTINUE; } DWORD DebuggerThread::HandleRipEvent(const RIP_INFO &info, DWORD thread_id) { WINERR_IFALL(WINDOWS_LOG_EVENT, "HandleRipEvent encountered error %lu " "(type=%lu) in process %llu thread %lu", info.dwError, info.dwType, m_process.GetProcessId(), thread_id); Error error(info.dwError, eErrorTypeWin32); m_debug_delegate->OnDebuggerError(error, info.dwType); return DBG_CONTINUE; }
35.909091
80
0.681418
Polidea
be14ad9c2abf5da992de1f349c2c8a5e995b43da
12,482
hpp
C++
src/Optimization/hiopAlgPrimalDecomp.hpp
LLNL/hiop
d348485926effc459d2da54c3962d802da2de9e8
[ "BSD-3-Clause" ]
126
2017-12-30T13:06:07.000Z
2022-03-27T03:30:46.000Z
src/Optimization/hiopAlgPrimalDecomp.hpp
LLNL/hiop
d348485926effc459d2da54c3962d802da2de9e8
[ "BSD-3-Clause" ]
344
2018-01-24T22:05:38.000Z
2022-03-31T17:49:52.000Z
src/Optimization/hiopAlgPrimalDecomp.hpp
LLNL/hiop
d348485926effc459d2da54c3962d802da2de9e8
[ "BSD-3-Clause" ]
30
2018-01-20T00:16:06.000Z
2022-03-18T12:57:19.000Z
// Copyright (c) 2017, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory (LLNL). // LLNL-CODE-742473. All rights reserved. // // This file is part of HiOp. For details, see https://github.com/LLNL/hiop. HiOp // is released under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause). // Please also read "Additional BSD Notice" below. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // i. Redistributions of source code must retain the above copyright notice, this list // of conditions and the disclaimer below. // ii. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the disclaimer (as noted below) in the documentation and/or // other materials provided with the distribution. // iii. Neither the name of the LLNS/LLNL nor the names of its contributors may be used to // endorse or promote products derived from this software without specific prior written // permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED // AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Additional BSD Notice // 1. This notice is required to be provided under our contract with the U.S. Department // of Energy (DOE). This work was produced at Lawrence Livermore National Laboratory under // Contract No. DE-AC52-07NA27344 with the DOE. // 2. Neither the United States Government nor Lawrence Livermore National Security, LLC // nor any of their employees, makes any warranty, express or implied, or assumes any // liability or responsibility for the accuracy, completeness, or usefulness of any // information, apparatus, product, or process disclosed, or represents that its use would // not infringe privately-owned rights. // 3. Also, reference herein to any specific commercial products, process, or services by // trade name, trademark, manufacturer or otherwise does not necessarily constitute or // imply its endorsement, recommendation, or favoring by the United States Government or // Lawrence Livermore National Security, LLC. The views and opinions of authors expressed // herein do not necessarily state or reflect those of the United States Government or // Lawrence Livermore National Security, LLC, and shall not be used for advertising or // product endorsement purposes. /** * @file hiopAlgPrimalDecomp.hpp * * @author Jingyi "Frank" Wang <wang125@llnl.gov>, LLNL * @author Cosmin G. Petra <petra1@llnl.gov>, LLNL * */ #ifndef HIOP_PRIDECOMP #define HIOP_PRIDECOMP #include "hiopInterfacePrimalDecomp.hpp" #include <cstdio> #include <vector> #include <chrono> #include <thread> #include <cmath> #include "hiopMPI.hpp" #include "hiopOptions.hpp" namespace hiop { class hiopLogger; // temporary output levels, aiming to integrate with hiop verbosity enum MPIout { outlevel0=0, //print nothing during from the MPI engine outlevel1=1, //print standard output: objective, step size outlevel2=2, //print the details needed to debug the algorithm, including alpha info, //also prints elapsed time and output x and gradient outlevel3=3, //print the send and receive messages outlevel4=4 //print details about the algorithm }; /* The main mpi engine for solving a class of problems with primal decomposition. * The master problem is the user defined class that should be able to solve both * the base case and full problem depending whether a recourse approximation is * included. * */ class hiopAlgPrimalDecomposition { public: //constructor hiopAlgPrimalDecomposition(hiopInterfacePriDecProblem* prob_in, MPI_Comm comm_world=MPI_COMM_WORLD); hiopAlgPrimalDecomposition(hiopInterfacePriDecProblem* prob_in, const int nc, const int* xc_index, MPI_Comm comm_world=MPI_COMM_WORLD); virtual ~hiopAlgPrimalDecomposition(); //we should make the public methods to look like hiopAlgFilterIPMBase /* Main function to run the optimization in parallel */ hiopSolveStatus run(); /* Main function to run the optimization in serial */ hiopSolveStatus run_single(); double getObjective() const; void getSolution(hiopVector& x) const; void getDualSolutions(double* zl, double* zu, double* lambda); /* returns the status of the solver */ inline hiopSolveStatus getSolveStatus() const; /* returns the number of iterations, meaning how many times the master was solved */ int getNumIterations() const; bool stopping_criteria(const int it, const double convg); void set_verbosity(const int i); void set_initial_alpha_ratio(const double ratio); void set_alpha_min(const double alp_min); void set_alpha_max(const double alp_max); void set_max_iteration(const int max_it); void set_tolerance(const double tol); void set_acceptable_tolerance(const double tol); double step_size_inf(const int nc, const int* idx, const hiopVector& x, const hiopVector& x0); /* Contains information of a previous solution step including function value * and gradient. Used for storing the solution for the previous iteration * This struct is intended for internal use of hiopAlgPrimalDecomposition class only */ struct Prevsol{ Prevsol(const int n, const double f, const double* grad, const double* x) { n_ = n; f_ = f; grad_ = new double[n]; memcpy(grad_, grad, n_*sizeof(double)); x_ = new double[n]; memcpy(x_, x, n_*sizeof(double)); } void update(const double f, const double* grad, const double* x) { assert(grad!=NULL); memcpy(grad_, grad, n_*sizeof(double)); memcpy(x_, x, n_*sizeof(double)); f_ = f; } double get_f(){return f_;} double* get_grad(){return grad_;} double* get_x(){return x_;} private: int n_; double f_; double* grad_; double* x_; }; /* Struct for the quadratic coefficient alpha in the recourse approximation * function. It contains quantities such as s_{k-1} = x_k-x_{k-1} that is * otherwise not computed but useful for certian update rules for alpha, * as well as the convergence measure. The update function is called * every iteration to ensure the values are up to date. * The xk here should only be the coupled x. * This struct is intened for internal use of hiopAlgPrimalDecomposition class only */ struct HessianApprox { HessianApprox(hiopInterfacePriDecProblem* priDecProb, hiopOptions* options_pridec); HessianApprox(const int& n, hiopInterfacePriDecProblem* priDecProb, hiopOptions* options_pridec); /* ratio is used to compute alpha in alpha_f */ HessianApprox(const int& n, const double ratio, hiopInterfacePriDecProblem* priDecProb, hiopOptions* options_pridec); ~HessianApprox(); /* n_ is the dimension of x, hence the dimension of g_k, skm1, etc */ void set_n(const int n); void set_xkm1(const hiopVector& xk); void set_gkm1(const hiopVector& grad); void initialize(const double f_val, const hiopVector& xk, const hiopVector& grad); /* updating variables for the current iteration */ void update_hess_coeff(const hiopVector& xk, const hiopVector& gk, const double& f_val); /* updating ratio_ used to compute alpha i * Using trust-region notations, * rhok = (f_{k-1}-f_k)/(m(0)-m(p_k)), where m(p)=f_{k-1}+g_{k-1}^Tp+0.5 alpha_{k-1} pTp. * Therefore, m(0) = f_{k-1}. rhok is the ratio of real change in recourse function value * and the estimate change. Trust-region algorithms use a set heuristics to update alpha_k * based on rhok * rk: m(p_k) * The condition |x-x_{k-1}| = \Deltak is replaced by measuring the ratio of quadratic * objective and linear objective. * User can provide a global maximum and minimum for alpha */ void update_ratio(); /** A trust-region way of updating alpha ratio * rkm1: true recourse value at {k-1} * rk: true recourse value at k */ void update_ratio_tr(const double rhok, const double rkm1, const double rk, const double alpha_g_ratio, double& alpha_ratio); // updating ratio_ using both base case and recourse objective function void update_ratio(const double base_v, const double base_vm1); void update_ratio_tr(const double rhok, double& alpha_ratio); /* currently provides multiple ways to compute alpha, one is to the BB alpha * or the alpha computed through the BarzilaiBorwein gradient method, a quasi-Newton method. */ double get_alpha_BB(); /* Computing alpha through alpha = alpha_f*ratio_ * alpha_f is computed through * min{f_k+g_k^T(x-x_k)+0.5 alpha_k|x-x_k|^2 >= beta_k f} * So alpha_f is based on the constraint on the minimum of recourse * approximition. This is to ensure good approximation. */ double get_alpha_f(const hiopVector& gk); /* Computing alpha through alpha = alpha_*ratio_ * Not based on function information */ double get_alpha_tr(); /* Function to check convergence based gradient */ double check_convergence_grad(const hiopVector& gk); double check_convergence_fcn(const double base_v, const double base_vm1); double compute_base(const double val); // setting the output level for the Hessian approximation void set_verbosity(const int i); void set_alpha_ratio_min(const double alp_ratio_min); void set_alpha_ratio_max(const double alp_ratio_max); void set_alpha_min(const double alp_min); void set_alpha_max(const double alp_max); private: int n_; double alpha_ = 1e6; double ratio_ = 1.0; double tr_ratio_ = 1.0; double ratio_min = 0.5; double ratio_max = 5.0; double alpha_min = 1e-5; double alpha_max = 1e6; double fk; double fkm1; double fkm1_lin; hiopVector* xkm1; hiopVector* gkm1; hiopVector* skm1; hiopVector* ykm1; size_t ver_ = 2; //output level for HessianApprox class hiopInterfacePriDecProblem* priDecProb_; hiopOptions* options_; }; private: #ifdef HIOP_USE_MPI MPI_Request* request_; MPI_Status status_; int my_rank_,comm_size_; int my_rank_type_; #endif MPI_Comm comm_world_; //master/solver(0), or worker(1:total rank) //maximum number of outer iterations, user specified int max_iter = 200; //pointer to the problem to be solved (passed as argument) hiopInterfacePriDecProblem* master_prob_; hiopSolveStatus solver_status_; //current primal iterate hiopVector* x_; //dimension of x_ size_t n_; //dimension of coupled x_ size_t nc_; //number of recourse terms size_t S_; //level of output through the MPI engine size_t ver_ = 1; //indices of the coupled x in the full x int* xc_idx_; //tolerance of the convergence stopping criteria. TODO: user options from options file via hiopOptions double tol_ = 1e-8; //acceptable tolerance is used to terminate hiop if NLP residuals are below the //set value for 10 consecutive iterations double accp_tol_ = 1e-6; //consecutive iteration count where NLP residual is lower than acceptable tolerance int accp_count = 0; //initial alpha_ratio if used double alpha_ratio_ = 1.0; double alpha_min_ = 1e-5; double alpha_max_ = 1e6; //real decrease over expected decrease ratio double rhok_ = 0.; protected: hiopOptions* options_; hiopLogger* log_; }; } //end of namespace #endif
35.867816
104
0.715671
LLNL
be1e1e764273ff0de290313638af9cac4f2a34c9
10,317
cc
C++
src/cpp/src/IMPL/MCParticleImpl.cc
tmadlener/LCIO
8f9e86b93b7d5d83221fabb872ed7e82f1638476
[ "BSD-3-Clause" ]
17
2016-09-12T15:39:23.000Z
2021-07-27T00:25:25.000Z
src/cpp/src/IMPL/MCParticleImpl.cc
tmadlener/LCIO
8f9e86b93b7d5d83221fabb872ed7e82f1638476
[ "BSD-3-Clause" ]
88
2016-10-03T18:49:06.000Z
2022-03-23T18:19:28.000Z
src/cpp/src/IMPL/MCParticleImpl.cc
tmadlener/LCIO
8f9e86b93b7d5d83221fabb872ed7e82f1638476
[ "BSD-3-Clause" ]
44
2016-09-12T15:42:26.000Z
2021-12-02T12:33:05.000Z
#include "IMPL/MCParticleImpl.h" #include "EVENT/LCIO.h" #include <iostream> #include <sstream> #include <stdexcept> #include <vector> #include <math.h> #include <algorithm> namespace EVENT{ // the standard requires static const ints to be defined aoutside the class declaration // so we do this here : const int MCParticle::BITEndpoint ; const int MCParticle::BITCreatedInSimulation ; const int MCParticle::BITBackscatter ; const int MCParticle::BITVertexIsNotEndpointOfParent ; const int MCParticle::BITDecayedInTracker ; const int MCParticle::BITDecayedInCalorimeter ; const int MCParticle::BITLeftDetector ; const int MCParticle::BITStopped ; const int MCParticle::BITOverlay ; } using namespace EVENT ; namespace IMPL { MCParticleImpl::MCParticleImpl() : _pdg(0), _genstatus(0), _simstatus(0), _mass(0), _charge(0), _time(0), _parents(0), _daughters(0), _endpointSet(false) { _vertex[0] = 0.0 ; _vertex[1] = 0.0 ; _vertex[2] = 0.0 ; _pEndpoint[0] = 0.0 ; _pEndpoint[1] = 0.0 ; _pEndpoint[2] = 0.0 ; _p[0] = 0.0 ; _p[1] = 0.0 ; _p[2] = 0.0 ; _endpoint[0] = 0.0 ; _endpoint[1] = 0.0 ; _endpoint[2] = 0.0 ; _spin[0] = 0.0 ; _spin[1] = 0.0 ; _spin[2] = 0.0 ; _colorFlow[0] = 0 ; _colorFlow[1] = 0 ; } MCParticleImpl::~MCParticleImpl(){ } const MCParticleVec & MCParticleImpl::getParents() const { return _parents ; } const MCParticleVec & MCParticleImpl::getDaughters() const { return _daughters ; } // int MCParticleImpl::getNumberOfParents() const { // //static bool first = true ; // //if( first ){ // // std::cout << " WARNING >>>>>>> MCParticleImpl::getNumberOfParents() is deprecated " // // << " - please use MCParticleImpl::getParents().size() ! " << std::endl ; // // first = false ; // //} // // UTIL::LCWarning::getInstance().printWarning( "MCPARTICLE_DEPRECATED_GETNUMBEROFPARENTS" ) ; // // return _parents.size() ; // } // // MCParticle* MCParticleImpl::getParent(int i) const { // // //static bool first = true ; // //if( first ){ // // std::cout << " WARNING >>>>>>> MCParticleImpl::getParent(i) is deprecated " // // << " - please use MCParticleImpl::getParents()[i] ! " << std::endl ; // // first = false ; // //} // // UTIL::LCWarning::getInstance().printWarning( "MCPARTICLE_DEPRECATED_GETPARENT" ) ; // // try{ // return _parents.at(i) ; // }catch( std::out_of_range ){ // std::stringstream err ; err << "MCParticleImpl::getParent(): out_of_range :" << i ; // throw Exception( err.str() ); // } // } // // // // unchecked access // // MCParticle* MCParticleImpl::getParent(int i) const { // // return _parents[i] ; // // } // // // int MCParticleImpl::getNumberOfDaughters() const { // //static bool first = true ; // //if( first ){ // // std::cout << " WARNING >>>>>>> MCParticleImpl::getNumberOfDaughters() is deprecated " // // << " - please use MCParticleImpl::getDaughters().size() ! " << std::endl ; // // first = false ; // //} // // UTIL::LCWarning::getInstance().printWarning( "MCPARTICLE_DEPRECATED_GETNUMBEROFDAUGHTERS" ) ; // // return _daughters.size() ; // } // // MCParticle* MCParticleImpl::getDaughter(int i) const { // // UTIL::LCWarning::getInstance().printWarning( "MCPARTICLE_DEPRECATED_GETDAUGHTER" ) ; // // try{ // return _daughters.at(i) ; // }catch( std::out_of_range ){ // std::stringstream err ; err << "MCParticleImpl::getDaughter(): out_of_range :" << i ; // throw Exception( err.str() ); // } // // } const double* MCParticleImpl::getEndpoint() const { if( ! _simstatus.test( BITEndpoint ) ){ if( _daughters.size() == 0 ) return _endpoint ; for(unsigned int i=0;i<_daughters.size();i++) { if(!_daughters[i]->vertexIsNotEndpointOfParent()) return _daughters[i]->getVertex(); } return _endpoint ; } else return _endpoint ; } double MCParticleImpl::getEnergy() const { return sqrt( _p[0]*_p[0] + _p[1]*_p[1] + _p[2]*_p[2] + _mass*_mass ) ; } const float* MCParticleImpl::getSpin() const { return _spin ; } const int* MCParticleImpl::getColorFlow() const { return _colorFlow ; } int MCParticleImpl::getPDG() const { return _pdg ;} int MCParticleImpl::getGeneratorStatus() const { return _genstatus ;} int MCParticleImpl::getSimulatorStatus() const { // bit 31 reserved for endpoint // return ( 0x7fffffff & _simstatus ) ; return _simstatus.to_ulong() ; } bool MCParticleImpl::isCreatedInSimulation() const { return _simstatus[ BITCreatedInSimulation ] ; } bool MCParticleImpl::isBackscatter() const { return _simstatus[ BITBackscatter ] ; } bool MCParticleImpl::vertexIsNotEndpointOfParent() const { return _simstatus[ BITVertexIsNotEndpointOfParent ] ; } bool MCParticleImpl::isDecayedInTracker() const { return _simstatus[ BITDecayedInTracker ] ; } bool MCParticleImpl::isDecayedInCalorimeter() const { return _simstatus[ BITDecayedInCalorimeter ] ; } bool MCParticleImpl::hasLeftDetector() const { return _simstatus[ BITLeftDetector ] ; } bool MCParticleImpl::isStopped() const { return _simstatus[ BITStopped ] ; } bool MCParticleImpl::isOverlay() const { return _simstatus[ BITOverlay ] ; } const double * MCParticleImpl::getVertex() const { return _vertex ;} float MCParticleImpl::getTime() const { return _time ; } const double * MCParticleImpl::getMomentum() const { return _p ;} const double * MCParticleImpl::getMomentumAtEndpoint() const { return _pEndpoint ;} double MCParticleImpl::getMass() const { return _mass ;} float MCParticleImpl::getCharge() const { return _charge ; } // void MCParticleImpl::setParent( MCParticle *mom0 ) { // checkAccess("MCParticleImpl::setParent") ; // _mother0 = mom0 ; // } // void MCParticleImpl::setSecondParent( MCParticle *mom1 ) { // checkAccess("MCParticleImpl::setSecondParent") ; // _mother1 = mom1 ; // } void MCParticleImpl::addDaughter( MCParticle* daughter) { checkAccess("MCParticleImpl::addDaughter") ; // MCParticle** pD = new (MCParticle*) ; // *pD = daughter ; _daughters.push_back( daughter ) ; } void MCParticleImpl::addParent( MCParticle* parent) { checkAccess("MCParticleImpl::addParent") ; if( std::find( _parents.begin(), _parents.end(), parent ) != _parents.end() ) return ; // parent already exists in list _parents.push_back( parent ) ; MCParticleImpl* mom = dynamic_cast<MCParticleImpl*>( parent ) ; if( mom ) mom->addDaughter( this ) ; } void MCParticleImpl::setPDG(int pdg ) { checkAccess("MCParticleImpl::setPDG") ; _pdg = pdg ; } void MCParticleImpl::setGeneratorStatus( int status ) { checkAccess("MCParticleImpl::setGeneratorStatus") ; _genstatus = status ; } void MCParticleImpl::setSimulatorStatus( int status ) { checkAccess("MCParticleImpl::setSimulatorStatus") ; // bit 31 reserved for endpoint // _simstatus |= ( 0x7fffffff & status ) ; _simstatus = status ; } void MCParticleImpl::setVertex( const double vtx[3] ){ checkAccess("MCParticleImpl::setVertex") ; _vertex[0] = vtx[0] ; _vertex[1] = vtx[1] ; _vertex[2] = vtx[2] ; } void MCParticleImpl::setTime(float time ) { checkAccess("MCParticleImpl::setTime") ; _time = time ; } void MCParticleImpl::setMomentum( const float p[3] ){ checkAccess("MCParticleImpl::setMomentum") ; _p[0] = p[0] ; _p[1] = p[1] ; _p[2] = p[2] ; } void MCParticleImpl::setMomentum( const double p[3] ){ checkAccess("MCParticleImpl::setMomentum") ; _p[0] = p[0] ; _p[1] = p[1] ; _p[2] = p[2] ; } void MCParticleImpl::setMomentumAtEndpoint( const float p[3] ){ checkAccess("MCParticleImpl::setMomentumAtEndpoint") ; _pEndpoint[0] = p[0] ; _pEndpoint[1] = p[1] ; _pEndpoint[2] = p[2] ; } void MCParticleImpl::setMomentumAtEndpoint( const double p[3] ){ checkAccess("MCParticleImpl::setMomentumAtEndpoint") ; _pEndpoint[0] = p[0] ; _pEndpoint[1] = p[1] ; _pEndpoint[2] = p[2] ; } void MCParticleImpl::setMass( float m ) { checkAccess("MCParticleImpl::setMass") ; _mass = m ; } void MCParticleImpl::setCharge( float c ) { checkAccess("MCParticleImpl::setCharge") ; _charge = c ; } void MCParticleImpl::setEndpoint( const double endpoint[3] ){ checkAccess("MCParticleImpl::setEndpoint") ; _simstatus.set( BITEndpoint ) ; _endpoint[0] = endpoint[0] ; _endpoint[1] = endpoint[1] ; _endpoint[2] = endpoint[2] ; } void MCParticleImpl::setSpin( const float spin[3] ){ checkAccess("MCParticleImpl::setSpin") ; _spin[0] = spin[0] ; _spin[1] = spin[1] ; _spin[2] = spin[2] ; } void MCParticleImpl::setColorFlow( const int cflow[2] ){ checkAccess("MCParticleImpl::setColorFlow") ; _colorFlow[0] = cflow[0] ; _colorFlow[1] = cflow[1] ; } void MCParticleImpl::setCreatedInSimulation(bool val) { _simstatus[ BITCreatedInSimulation ] = val ; } void MCParticleImpl::setBackscatter(bool val) { _simstatus[ BITBackscatter ] = val; } void MCParticleImpl::setVertexIsNotEndpointOfParent(bool val) { _simstatus[ BITVertexIsNotEndpointOfParent ] = val; } void MCParticleImpl::setDecayedInTracker(bool val) { _simstatus[ BITDecayedInTracker ] = val; } void MCParticleImpl::setDecayedInCalorimeter(bool val) { _simstatus[ BITDecayedInCalorimeter ] = val; } void MCParticleImpl::setHasLeftDetector(bool val) { _simstatus[ BITLeftDetector ] = val ; } void MCParticleImpl::setStopped(bool val) { _simstatus[ BITStopped ] = val; } void MCParticleImpl::setOverlay(bool val) { _simstatus[ BITOverlay ] = val; } } /// namespace IMPl
31.263636
129
0.621983
tmadlener
be1f640bb7ae1ac25391a191f2a10783811cc823
8,373
cpp
C++
SerialPrograms/Source/PokemonLA/Programs/ShinyHunting/PokemonLA_CrobatFinder.cpp
Gin890/Arduino-Source
9047ff584010d8ddc3558068874f16fb3c7bb46d
[ "MIT" ]
null
null
null
SerialPrograms/Source/PokemonLA/Programs/ShinyHunting/PokemonLA_CrobatFinder.cpp
Gin890/Arduino-Source
9047ff584010d8ddc3558068874f16fb3c7bb46d
[ "MIT" ]
null
null
null
SerialPrograms/Source/PokemonLA/Programs/ShinyHunting/PokemonLA_CrobatFinder.cpp
Gin890/Arduino-Source
9047ff584010d8ddc3558068874f16fb3c7bb46d
[ "MIT" ]
null
null
null
/* Alpha Crobat Hunter * * From: https://github.com/PokemonAutomation/Arduino-Source * */ #include "Common/Cpp/Exceptions.h" #include "CommonFramework/Notifications/ProgramNotifications.h" #include "CommonFramework/VideoPipeline/VideoFeed.h" #include "CommonFramework/InferenceInfra/InferenceRoutines.h" #include "CommonFramework/Inference/BlackScreenDetector.h" #include "CommonFramework/Tools/StatsTracking.h" #include "NintendoSwitch/NintendoSwitch_Settings.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonLA/PokemonLA_Settings.h" #include "PokemonLA/Inference/PokemonLA_MapDetector.h" #include "PokemonLA/Inference/PokemonLA_DialogDetector.h" #include "PokemonLA/Inference/PokemonLA_OverworldDetector.h" #include "PokemonLA/Inference/Sounds/PokemonLA_ShinySoundDetector.h" #include "PokemonLA/Programs/PokemonLA_GameEntry.h" #include "PokemonLA/Programs/PokemonLA_RegionNavigation.h" #include "PokemonLA_CrobatFinder.h" namespace PokemonAutomation{ namespace NintendoSwitch{ namespace PokemonLA{ CrobatFinder_Descriptor::CrobatFinder_Descriptor() : RunnableSwitchProgramDescriptor( "PokemonLA:CrobatFinder", STRING_POKEMON + " LA", "Alpha Crobat Hunter", "ComputerControl/blob/master/Wiki/Programs/PokemonLA/AlphaCrobatHunter.md", "Constantly reset the cave to find Shiny Alpha Crobat.", FeedbackType::REQUIRED, false, PABotBaseLevel::PABOTBASE_12KB ) {} CrobatFinder::CrobatFinder(const CrobatFinder_Descriptor& descriptor) : SingleSwitchProgramInstance(descriptor) , SHINY_DETECTED_ENROUTE( "Enroute Shiny Action", "This applies if you are still traveling to the Crobat.", "2 * TICKS_PER_SECOND" ) , SHINY_DETECTED_DESTINATION( "Destination Shiny Action", "This applies if you are near the Crobat.", "2 * TICKS_PER_SECOND" ) , NOTIFICATION_STATUS("Status Update", true, false, std::chrono::seconds(3600)) , NOTIFICATIONS({ &NOTIFICATION_STATUS, &SHINY_DETECTED_ENROUTE.NOTIFICATIONS, &SHINY_DETECTED_DESTINATION.NOTIFICATIONS, &NOTIFICATION_PROGRAM_FINISH, // &NOTIFICATION_ERROR_RECOVERABLE, &NOTIFICATION_ERROR_FATAL, }) { PA_ADD_STATIC(SHINY_REQUIRES_AUDIO); PA_ADD_OPTION(SHINY_DETECTED_ENROUTE); PA_ADD_OPTION(SHINY_DETECTED_DESTINATION); PA_ADD_OPTION(NOTIFICATIONS); } class CrobatFinder::Stats : public StatsTracker, public ShinyStatIncrementer{ public: Stats() : attempts(m_stats["Attempts"]) , errors(m_stats["Errors"]) , shinies(m_stats["Shinies"]) { m_display_order.emplace_back("Attempts"); m_display_order.emplace_back("Errors", true); m_display_order.emplace_back("Shinies", true); } virtual void add_shiny() override{ shinies++; } std::atomic<uint64_t>& attempts; std::atomic<uint64_t>& errors; std::atomic<uint64_t>& shinies; }; std::unique_ptr<StatsTracker> CrobatFinder::make_stats() const{ return std::unique_ptr<StatsTracker>(new Stats()); } void CrobatFinder::run_iteration(SingleSwitchProgramEnvironment& env, BotBaseContext& context){ // NOTE: there's no "stunned by alpha" detection in case any of the close ones are alphas! Stats& stats = env.stats<Stats>(); stats.attempts++; // program should be started right in front of the entrance // so enter the sub region env.console.log("Entering Wayward Cave..."); mash_A_to_enter_sub_area(env, env.console, context); env.console.log("Beginning navigation to the Alpha Crobat..."); // Switch to Wrydeer. bool error = true; MountDetector mount_detector; for (size_t c = 0; c < 10; c++){ MountState mount = mount_detector.detect(env.console.video().snapshot()); if (mount == MountState::WYRDEER_OFF){ pbf_press_button(context, BUTTON_PLUS, 20, 105); error = false; break; } if (mount == MountState::WYRDEER_ON){ pbf_wait(context, 5 * TICKS_PER_SECOND); error = false; break; } pbf_press_dpad(context, DPAD_LEFT, 20, 50); context.wait_for_all_requests(); } if (error){ throw OperationFailedException(env.console, "Unable to find Wyrdeer after 10 attempts."); } env.console.log("Beginning Shiny Detection..."); // start the shiny detection, there's nothing initially { float shiny_coefficient = 1.0; std::atomic<ShinyDetectedActionOption*> shiny_action = &SHINY_DETECTED_ENROUTE; ShinySoundDetector shiny_detector(env.console.logger(), env.console, [&](float error_coefficient) -> bool{ // Warning: This callback will be run from a different thread than this function. stats.shinies++; shiny_coefficient = error_coefficient; ShinyDetectedActionOption* action = shiny_action.load(std::memory_order_acquire); return on_shiny_callback(env, env.console, *action, error_coefficient); }); int ret = run_until( env.console, context, [&](BotBaseContext& context){ // FORWARD PORTION OF CAVE UNTIL LEDGE pbf_press_button(context, BUTTON_B, (uint16_t)(2.2 * TICKS_PER_SECOND), 80); // wyrdeer sprint pbf_move_left_joystick(context, 0, 128, 10, 20); // turn left pbf_press_button(context, BUTTON_ZL, 20, 50); // align camera // ASCEND THE LEDGE WITH BRAVIARY pbf_press_dpad(context, DPAD_RIGHT, 20, 50); // swap to braviary pbf_wait(context, (uint16_t)(0.6 * TICKS_PER_SECOND)); // wait for the ascent pbf_press_button(context, BUTTON_Y, (uint16_t)(2.4 * TICKS_PER_SECOND), 20); // descend to swap to Wyrdeer automatically // TO CROBAT PORTION pbf_press_button(context, BUTTON_B, (uint16_t)(1.05 * TICKS_PER_SECOND), 80); // sprint forward for a split second pbf_move_left_joystick(context, 255, 150, 10, 20); // rotate slightly right pbf_press_button(context, BUTTON_ZL, 20, 70); // align camera context.wait_for_all_requests(); shiny_action.store(&SHINY_DETECTED_DESTINATION, std::memory_order_release); pbf_move_left_joystick(context, 128, 0, (uint16_t)(3.8 * TICKS_PER_SECOND), 0); // forward to crobat check }, {{shiny_detector}} ); shiny_detector.throw_if_no_sound(); if (ret == 0){ ShinyDetectedActionOption* action = shiny_action.load(std::memory_order_acquire); on_shiny_sound(env, env.console, context, *action, shiny_coefficient); } }; // then reset since no shiny was found env.console.log("No shiny detected, restarting the game!"); pbf_press_button(context, BUTTON_HOME, 20, GameSettings::instance().GAME_TO_HOME_DELAY); reset_game_from_home(env, env.console, context, ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST); } void CrobatFinder::program(SingleSwitchProgramEnvironment& env, BotBaseContext& context){ Stats& stats = env.stats<Stats>(); // Connect the controller. pbf_press_button(context, BUTTON_LCLICK, 5, 5); while (true){ env.update_stats(); send_program_status_notification( env.logger(), NOTIFICATION_STATUS, env.program_info(), "", stats.to_str() ); try{ run_iteration(env, context); }catch (OperationFailedException&){ stats.errors++; pbf_press_button(context, BUTTON_HOME, 20, GameSettings::instance().GAME_TO_HOME_DELAY); reset_game_from_home(env, env.console, context, ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST); } } env.update_stats(); send_program_finished_notification( env.logger(), NOTIFICATION_PROGRAM_FINISH, env.program_info(), "", stats.to_str() ); } } } }
37.716216
137
0.655798
Gin890
be20ee6191c0133a8fd3b2c9cd606ddd40ee012b
1,733
cpp
C++
src/basic/adt/ApSInt.cpp
PHP-OPEN-HUB/polarphp
70ff4046e280fd99d718d4761686168fa8012aa5
[ "PHP-3.01" ]
null
null
null
src/basic/adt/ApSInt.cpp
PHP-OPEN-HUB/polarphp
70ff4046e280fd99d718d4761686168fa8012aa5
[ "PHP-3.01" ]
null
null
null
src/basic/adt/ApSInt.cpp
PHP-OPEN-HUB/polarphp
70ff4046e280fd99d718d4761686168fa8012aa5
[ "PHP-3.01" ]
null
null
null
// This source file is part of the polarphp.org open source project // // Copyright (c) 2017 - 2019 polarphp software foundation // Copyright (c) 2017 - 2019 zzu_softboy <zzu_softboy@163.com> // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://polarphp.org/LICENSE.txt for license information // See https://polarphp.org/CONTRIBUTORS.txt for the list of polarphp project authors // // Created by polarboy on 2018/06/16. //===----------------------------------------------------------------------===// // // This file implements the ApSInt class, which is a simple class that // represents an arbitrary sized integer that knows its signedness. // //===----------------------------------------------------------------------===// #include "polarphp/basic/adt/ApSInt.h" #include "polarphp/basic/adt/FoldingSet.h" #include "polarphp/basic/adt/StringRef.h" namespace polar { namespace basic { ApSInt::ApSInt(StringRef str) { assert(!str.empty() && "Invalid string length"); // (Over-)estimate the required number of bits. unsigned numBits = ((str.getSize() * 64) / 19) + 2; ApInt temp(numBits, str, /*Radix=*/10); if (str[0] == '-') { unsigned minBits = temp.getMinSignedBits(); if (minBits > 0 && minBits < numBits) { temp = temp.trunc(minBits); } *this = ApSInt(temp, /*isUnsigned=*/false); return; } unsigned activeBits = temp.getActiveBits(); if (activeBits > 0 && activeBits < numBits) { temp = temp.trunc(activeBits); } *this = ApSInt(temp, /*isUnsigned=*/true); } void ApSInt::profile(FoldingSetNodeId &id) const { id.addInteger((unsigned) (m_isUnsigned ? 1 : 0)); ApInt::profile(id); } } // basic } // polar
30.946429
85
0.612233
PHP-OPEN-HUB
be23611dc134a0bacfb74518ac7874cb12086dd1
2,988
cc
C++
Geometry/CaloEventSetup/test/CaloAlignmentRcdWrite.cc
knash/cmssw
d4f63ec2b2c322e3be4c4d78ce20ebddbcd88ca7
[ "Apache-2.0" ]
null
null
null
Geometry/CaloEventSetup/test/CaloAlignmentRcdWrite.cc
knash/cmssw
d4f63ec2b2c322e3be4c4d78ce20ebddbcd88ca7
[ "Apache-2.0" ]
1
2021-06-28T14:25:47.000Z
2021-06-30T10:12:29.000Z
Geometry/CaloEventSetup/test/CaloAlignmentRcdWrite.cc
knash/cmssw
d4f63ec2b2c322e3be4c4d78ce20ebddbcd88ca7
[ "Apache-2.0" ]
null
null
null
#include <string> #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "Utilities/General/interface/ClassName.h" #include "FWCore/Utilities/interface/ESGetToken.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" #include "CondFormats/Alignment/interface/Alignments.h" #include "CondFormats/Alignment/interface/AlignTransform.h" #include "CondFormats/AlignmentRecord/interface/EBAlignmentRcd.h" #include "CondFormats/AlignmentRecord/interface/EEAlignmentRcd.h" #include "CondFormats/AlignmentRecord/interface/ESAlignmentRcd.h" class CaloAlignmentRcdWrite : public edm::one::EDAnalyzer<> { public: explicit CaloAlignmentRcdWrite(const edm::ParameterSet& /*iConfig*/) :ebToken_{esConsumes<Alignments, EBAlignmentRcd>(edm::ESInputTag{})}, eeToken_{esConsumes<Alignments, EEAlignmentRcd>(edm::ESInputTag{})}, esToken_{esConsumes<Alignments, ESAlignmentRcd>(edm::ESInputTag{})}, nEventCalls_(0) {} ~CaloAlignmentRcdWrite() override {} template<typename T> void writeAlignments(const edm::EventSetup& evtSetup, edm::ESGetToken<Alignments, T>& token); void beginJob() override {} void analyze(edm::Event const& iEvent, edm::EventSetup const&) override; void endJob() override {} private: edm::ESGetToken<Alignments, EBAlignmentRcd> ebToken_; edm::ESGetToken<Alignments, EEAlignmentRcd> eeToken_; edm::ESGetToken<Alignments, ESAlignmentRcd> esToken_; unsigned int nEventCalls_; }; template<typename T> void CaloAlignmentRcdWrite::writeAlignments(const edm::EventSetup& evtSetup, edm::ESGetToken<Alignments, T>& token) { const auto& alignmentsES = evtSetup.getData(token); std::string recordName = Demangle(typeid(T).name())(); std::cout << "Uploading alignments to the database: " << recordName << std::endl; edm::Service<cond::service::PoolDBOutputService> poolDbService; if (!poolDbService.isAvailable()) throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; Alignments * alignments = new Alignments(alignmentsES); poolDbService->writeOne<Alignments>(&(*alignments), poolDbService->currentTime(), recordName); } void CaloAlignmentRcdWrite::analyze(const edm::Event& /*evt*/, const edm::EventSetup& evtSetup) { if (nEventCalls_ > 0) { std::cout << "Writing to DB to be done only once, " << "set 'untracked PSet maxEvents = {untracked int32 input = 1}'." << "(Your writing should be fine.)" << std::endl; return; } writeAlignments<EBAlignmentRcd>(evtSetup, ebToken_); writeAlignments<EEAlignmentRcd>(evtSetup, eeToken_); writeAlignments<ESAlignmentRcd>(evtSetup, esToken_); std::cout << "done!" << std::endl; nEventCalls_++; } DEFINE_FWK_MODULE(CaloAlignmentRcdWrite);
35.152941
115
0.745315
knash
be2573d5eb880e484668a4b198ee5040d92238b7
5,352
cpp
C++
LeetCode/C++/884. Uncommon Words from Two Sentences.cpp
shreejitverma/GeeksforGeeks
d7bcb166369fffa9a031a258e925b6aff8d44e6c
[ "MIT" ]
2
2022-02-18T05:14:28.000Z
2022-03-08T07:00:08.000Z
LeetCode/C++/884. Uncommon Words from Two Sentences.cpp
shivaniverma1/Competitive-Programming-1
d7bcb166369fffa9a031a258e925b6aff8d44e6c
[ "MIT" ]
6
2022-01-13T04:31:04.000Z
2022-03-12T01:06:16.000Z
LeetCode/C++/884. Uncommon Words from Two Sentences.cpp
shivaniverma1/Competitive-Programming-1
d7bcb166369fffa9a031a258e925b6aff8d44e6c
[ "MIT" ]
2
2022-02-14T19:53:53.000Z
2022-02-18T05:14:30.000Z
/** We are given two sentences A and B. (A sentence is a string of space separated words. Each word consists only of lowercase letters.) A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence. Return a list of all uncommon words. You may return the list in any order. Example 1: Input: A = "this apple is sweet", B = "this apple is sour" Output: ["sweet","sour"] Example 2: Input: A = "apple apple", B = "banana" Output: ["banana"] **/ //Runtime: 8 ms, faster than 66.46% of C++ online submissions for Uncommon Words from Two Sentences. //Memory Usage: 11.4 MB, less than 5.55% of C++ online submissions for Uncommon Words from Two Sentences. class Solution { public: vector<string> string_split(string str){ size_t pos = 0; string token; string delimiter = " "; vector<string> str_vec; while ((pos = str.find(delimiter)) != string::npos) { token = str.substr(0, pos); str_vec.push_back(token); str.erase(0, pos + delimiter.length()); } //add the last token str_vec.push_back(str); return str_vec; } vector<set<string>> removeDuplicates(vector<string>& v){ set<string> dup; for(string s : v){ if(count(v.begin(), v.end(), s) > 1){ dup.insert(s); //cannot erase element while iterating it // v.erase(remove(v.begin(), v.end(), s), v.end()); } } for(string s : dup){ v.erase(remove(v.begin(), v.end(), s), v.end()); } return vector<set<string>> {set<string> (v.begin(), v.end()), dup}; } vector<string> uncommonFromSentences(string A, string B) { vector<string> vA = string_split(A); vector<string> vB = string_split(B); //remove duplicate elements vector<set<string>> udA = removeDuplicates(vA); vector<set<string>> udB = removeDuplicates(vB); set<string> uA = udA[0]; set<string> uB = udB[0]; set<string> dA = udA[1]; set<string> dB = udB[1]; //symmetric difference //allocate vector size as sA.size()+sB.size(), // because if sA and sB are all different, // it will need that amount of space set<string> uncommons; set<string>::iterator s_it; // the xor of two sets set_symmetric_difference(uA.begin(), uA.end(), uB.begin(), uB.end(), inserter(uncommons, uncommons.begin())); // remove duplicate from dA set<string> tmp; set_difference(make_move_iterator(uncommons.begin()), make_move_iterator(uncommons.end()), dA.begin(), dA.end(), inserter(tmp, tmp.begin())); uncommons.swap(tmp); tmp.clear(); // remove duplicate from dB set_difference(make_move_iterator(uncommons.begin()), make_move_iterator(uncommons.end()), dB.begin(), dB.end(), inserter(tmp, tmp.begin())); uncommons.swap(tmp); tmp.clear(); return vector<string> (uncommons.begin(), uncommons.end()); } }; /** Approach 1: Counting Intuition and Algorithm Every uncommon word occurs exactly once in total. We can count the number of occurrences of every word, then return ones that occur exactly once. **/ /** Complexity Analysis Time Complexity: O(M+N), where M, N are the lengths of A and B respectively. Space Complexity: O(M+N), the space used by count. **/ //Runtime: 4 ms, faster than 100.00% of C++ online submissions for Uncommon Words from Two Sentences. //Memory Usage: 9.6 MB, less than 11.11% of C++ online submissions for Uncommon Words from Two Sentences. class Solution { public: vector<string> string_split(string str){ size_t pos = 0; string token; string delimiter = " "; vector<string> str_vec; while ((pos = str.find(delimiter)) != string::npos) { token = str.substr(0, pos); str_vec.push_back(token); str.erase(0, pos + delimiter.length()); } //add the last token str_vec.push_back(str); return str_vec; } template <class K, class V> void insert_or_increment(map<K,V>& mymap, K key, V inc){ if(mymap.find(key)==mymap.end()){ mymap[key] = 0+inc; }else{ mymap[key] += inc; } } vector<string> uncommonFromSentences(string A, string B) { vector<string> vA = string_split(A); vector<string> vB = string_split(B); map<string, int> mymap; vector<string> ans; for(string e : vA){ insert_or_increment(mymap, e, 1); } for(string e : vB){ insert_or_increment(mymap, e, 1); } for(pair<string, int> p : mymap){ if(p.second==1){ ans.push_back(p.first); } } return ans; } };
31.857143
134
0.545217
shreejitverma
be26304c1812023d42cb498cbf7686409bc6d23a
7,933
cpp
C++
src/BldRecons/SPB2OBJ/MeshGrid.cpp
liuxinren/UrbanReconstruction
079d9b0c9089aa9cdb15d31d76155e50a5e72f00
[ "MIT" ]
94
2017-07-20T05:32:07.000Z
2022-03-02T03:38:54.000Z
src/BldRecons/SPB2OBJ/MeshGrid.cpp
GucciPrada/UrbanReconstruction
8b058349fd860ea9029623a92d705dd93a4e4878
[ "MIT" ]
3
2017-09-12T00:07:05.000Z
2020-03-08T21:12:36.000Z
src/BldRecons/SPB2OBJ/MeshGrid.cpp
GucciPrada/UrbanReconstruction
8b058349fd860ea9029623a92d705dd93a4e4878
[ "MIT" ]
38
2017-07-25T06:00:52.000Z
2022-03-19T10:01:06.000Z
#include "StdAfx.h" #include "MeshGrid.h" #include "ParamManager.h" #include "Miscs\TimeMeter.h" CMeshGrid::CMeshGrid(void) { } CMeshGrid::~CMeshGrid(void) { } void CMeshGrid::Mesh() { CParamManager * manager = CParamManager::GetParamManager(); CTimeMeter timer; timer.Start(); fprintf_s( stderr, "==================== Pass 1, meshing ====================\n" ); Init(); fprintf_s( stderr, "Processing progress ... " ); InitPrintProgress(); int index; while ( ( index = ReadNextChunk() ) != -1 ) { PrintProgress( ); CMeshChunk * chunk = m_vecPointer[ index ]; chunk->BuildGridIndex(); ComputeGroundHeight( chunk ); delete m_vecPointer[ index ]; m_vecPointer[ index ] = NULL; } fprintf_s( stderr, " ... done!\n" ); Fin(); fprintf_s( stderr, "Total processing time is " ); timer.End(); timer.Print(); fprintf_s( stderr, ".\n\n" ); timer.Start(); fprintf_s( stderr, "==================== Pass 2, interpolate holes ====================\n" ); fprintf_s( stderr, "Processing ... " ); Interpolate(); fprintf_s( stderr, "done!\n" ); fprintf_s( stderr, "Total processing time is " ); timer.End(); timer.Print(); fprintf_s( stderr, ".\n\n" ); timer.Start(); fprintf_s( stderr, "==================== Pass 3, output ====================\n" ); fprintf_s( stderr, "Writing %s ...", manager->m_pOutputFile ); WriteMesh( manager->m_nSampleGrid ); fprintf_s( stderr, "succeed!\n" ); fprintf_s( stderr, "Total %d vertices and %d faces written in ", m_nVertexNumber, m_nFaceNumber ); timer.End(); timer.Print(); fprintf_s( stderr, ".\n" ); } int CMeshGrid::ReadNextChunk() { // return the index of the finalized chunk // return -1 indicating a EOF has been read bool bNoneChunkEnd = true; int index; while ( bNoneChunkEnd ) { if ( m_cReader.ReadNextElement() ) { // read chunk information SPBCell * cell = m_cReader.GetCell(); switch ( cell->type ) { case 0: // begin chunk m_vecPointer[ cell->chunk_index ] = new CMeshChunk( cell->chunk_index, cell->point_number, this ); break; case 1: // end chunk bNoneChunkEnd = false; index = cell->chunk_index; break; case -1: // EOF bNoneChunkEnd = false; index = -1; break; } } else { SPBPoint * point = m_cReader.GetPoint(); CVector3D v( point->pos[0], point->pos[1], point->pos[2] ); CMeshChunk * chunk = m_vecPointer[ Index( v ) ]; chunk->PushPoint( point ); IncReadNumber(); } } return index; } ////////////////////////////////////////////////////////////////////////// // main functions ////////////////////////////////////////////////////////////////////////// void CMeshGrid::Init() { CParamManager * manager = CParamManager::GetParamManager(); m_cReader.OpenFile( manager->m_pInputFile ); m_cReader.RegisterGrid( this ); m_cReader.ReadHeader(); m_vecPointer.clear(); m_vecPointer.resize( m_nSideNumber * m_nSideNumber, NULL ); InitClip(); } void CMeshGrid::ComputeGroundHeight( CMeshChunk * chunk ) { for ( int x = 0; x < m_nUnitNumber[ 0 ]; x++ ) for ( int y = 0; y < m_nUnitNumber[ 1 ]; y++ ) { int index = ClipIndex( x + chunk->m_iX * m_nUnitNumber[ 0 ], y + chunk->m_iY * m_nUnitNumber[ 1 ] ); if ( index != -1 ) { PatchPointDataVector & cell_vector = chunk->m_vecGridIndex[ chunk->Index( x, y ) ]; m_vecHeight[ index ] = 1e300; for ( int i = 0; i < ( int )cell_vector.size(); i++ ) { PatchPointData & point = *( cell_vector[ i ] ); if ( point.type == PT_Ground && point.v[ 2 ] < m_vecHeight[ index ] ) { m_vecHeight[ index ] = point.v[ 2 ]; } } } } } void CMeshGrid::Fin() { m_cReader.CloseFile(); } void CMeshGrid::Interpolate() { int last_solid; double last_height, height; for ( int y = m_nClip[ 1 ][ 0 ]; y <= m_nClip[ 1 ][ 1 ]; y++ ) { last_solid = m_nClip[ 0 ][ 0 ] - 1; for ( int x = m_nClip[ 0 ][ 0 ]; x <= m_nClip[ 0 ][ 1 ]; x++ ) { int index = ClipIndex( x, y ); if ( m_vecHeight[ index ] != 1e300 ) { // has data, solid! height = m_vecHeight[ index ]; if ( last_solid == m_nClip[ 0 ][ 0 ] - 1 ) { last_height = height; } else { last_height = m_vecHeight[ ClipIndex( last_solid, y ) ]; } for ( int i = last_solid + 1; i < x; i++ ) { m_vecHeight[ ClipIndex( i, y ) ] = height * ( double )( i - last_solid ) / ( double )( x - last_solid ) + last_height * ( double )( x - i ) / ( double )( x - last_solid ); } last_solid = x; } } if ( last_solid != m_nClip[ 0 ][ 1 ] ) { int x = m_nClip[ 0 ][ 1 ] + 1; if ( last_solid == m_nClip[ 0 ][ 0 ] - 1 ) { last_height = height = 0.0; // default height } else { last_height = height = m_vecHeight[ ClipIndex( last_solid, y ) ]; } for ( int i = last_solid + 1; i < x; i++ ) { m_vecHeight[ ClipIndex( i, y ) ] = height * ( double )( i - last_solid ) / ( double )( x - last_solid ) + last_height * ( double )( x - i ) / ( double )( x - last_solid ); } } } } void CMeshGrid::WriteMesh( int sample_grid ) { CParamManager * manager = CParamManager::GetParamManager(); m_cWriter.OpenFile( manager->m_pOutputFile ); m_cWriter.WriteHeader(); m_nVertexNumber = m_nFaceNumber = 0; double data[3]; int idata[3]; for ( int x = m_nClip[ 0 ][ 0 ]; x <= m_nClip[ 0 ][ 1 ]; x += sample_grid ) for ( int y = m_nClip[ 1 ][ 0 ]; y <= m_nClip[ 1 ][ 1 ]; y += sample_grid ) { data[0] = m_cBoundingBox.m_vMin[0] + m_dbGridLength * ( x + 0.5 ); data[1] = m_cBoundingBox.m_vMin[1] + m_dbGridLength * ( y + 0.5 ); data[2] = m_vecHeight[ ClipIndex( x, y ) ]; m_cWriter.WriteVertex( data ); m_nVertexNumber++; } int y_range = ( m_nClip[ 1 ][ 1 ] - m_nClip[ 1 ][ 0 ] ) / sample_grid + 1; for ( int x = m_nClip[ 0 ][ 0 ]; x <= m_nClip[ 0 ][ 1 ] - sample_grid; x += sample_grid ) for ( int y = m_nClip[ 1 ][ 0 ]; y <= m_nClip[ 1 ][ 1 ] - sample_grid; y += sample_grid ) { int truex = ( x - m_nClip[ 0 ][ 0 ] ) / sample_grid; int truey = ( y - m_nClip[ 1 ][ 0 ] ) / sample_grid; idata[0] = ( truex ) * y_range + ( truey ); idata[1] = ( truex + 1 ) * y_range + ( truey ); idata[2] = ( truex + 1 ) * y_range + ( truey + 1 ); m_cWriter.WriteFace( idata ); m_nFaceNumber++; idata[0] = ( truex ) * y_range + ( truey ); idata[1] = ( truex + 1 ) * y_range + ( truey + 1 ); idata[2] = ( truex ) * y_range + ( truey + 1 ); m_cWriter.WriteFace( idata ); m_nFaceNumber++; } m_cWriter.CloseFile(); } ////////////////////////////////////////////////////////////////////////// // auxiliary functions ////////////////////////////////////////////////////////////////////////// void CMeshGrid::InitClip() { CParamManager * manager = CParamManager::GetParamManager(); if ( manager->m_bClip == false ) { manager->m_dbClip[ 0 ][ 0 ] = m_cBoundingBox.m_vMin[ 0 ]; manager->m_dbClip[ 0 ][ 1 ] = m_cBoundingBox.m_vMax[ 0 ]; manager->m_dbClip[ 1 ][ 0 ] = m_cBoundingBox.m_vMin[ 1 ]; manager->m_dbClip[ 1 ][ 1 ] = m_cBoundingBox.m_vMax[ 1 ]; } m_nClip[ 0 ][ 0 ] = ( int )( ( manager->m_dbClip[ 0 ][ 0 ] - m_cBoundingBox.m_vMin[ 0 ] ) / m_dbGridLength ); m_nClip[ 0 ][ 1 ] = ( int )( ( manager->m_dbClip[ 0 ][ 1 ] - m_cBoundingBox.m_vMin[ 0 ] ) / m_dbGridLength ); m_nClip[ 1 ][ 0 ] = ( int )( ( manager->m_dbClip[ 1 ][ 0 ] - m_cBoundingBox.m_vMin[ 1 ] ) / m_dbGridLength ); m_nClip[ 1 ][ 1 ] = ( int )( ( manager->m_dbClip[ 1 ][ 1 ] - m_cBoundingBox.m_vMin[ 1 ] ) / m_dbGridLength ); m_vecHeight.clear(); m_vecHeight.resize( ( m_nClip[ 0 ][ 1 ] - m_nClip[ 0 ][ 0 ] + 1 ) * ( m_nClip[ 1 ][ 1 ] - m_nClip[ 1 ][ 0 ] + 1 ), 1e300 ); } int CMeshGrid::ClipIndex( int x, int y ) { if ( x < m_nClip[ 0 ][ 0 ] || x > m_nClip[ 0 ][ 1 ] || y < m_nClip[ 1 ][ 0 ] || y > m_nClip[ 1 ][ 1 ] ) return -1; else return ( ( x - m_nClip[ 0 ][ 0 ] ) * ( m_nClip[ 1 ][ 1 ] - m_nClip[ 1 ][ 0 ] + 1 ) + ( y - m_nClip[ 1 ][ 0 ] ) ); }
26.982993
124
0.556284
liuxinren
be27d9ac8acb3f9a5aaa1968cd7eced13c4325e2
5,471
cpp
C++
src/WWWAPIHandler.cpp
backuperator/daemon
ae30bb57ceb5a989752cdde322c300c9208d3a50
[ "BSD-2-Clause" ]
null
null
null
src/WWWAPIHandler.cpp
backuperator/daemon
ae30bb57ceb5a989752cdde322c300c9208d3a50
[ "BSD-2-Clause" ]
null
null
null
src/WWWAPIHandler.cpp
backuperator/daemon
ae30bb57ceb5a989752cdde322c300c9208d3a50
[ "BSD-2-Clause" ]
null
null
null
#include "WWWAPIHandler.hpp" #include "IOLib.h" #include <stdlib.h> #include <glog/logging.h> #include <boost/regex.hpp> using json = nlohmann::json; using namespace boost; using namespace std; // Create regexes for all URLs we support. static regex _exprLibraries("^\\/api\\/libraries$"); /** * Initializes the handler. */ WWWAPIHandler::WWWAPIHandler() { } WWWAPIHandler::~WWWAPIHandler() { } /** * Handles a request. * * @param method HTTP method; may be GET or POST. * @param params Input parameters for the request. */ json WWWAPIHandler::handle(string method, string url, json params) { cmatch what; // Print LOG(INFO) << "API Request " << method << " " << url << ": " << params; // Listing all libraries? if(regex_match(url.c_str(), what, _exprLibraries)) { return _getAllLibraries(); } // Unknown API request; log it. else { LOG(WARNING) << "Unknown API Request " << method << " " << url << ": " << params; } // We should never get down here return { { "error", "Unknown API request" } }; } /** * Fetches all libraries, including drives and loaders. */ json WWWAPIHandler::_getAllLibraries() { vector<json> libraries; vector<json> drives; vector<json> loaders; vector<json> elements; // Fetch all libraries iolib_library_t libs[8]; size_t numLibs = iolibEnumerateDevices((iolib_library_t *) &libs, 8, NULL); for(size_t i = 0; i < numLibs; i++) { vector<string> driveIds; vector<string> loaderIds; // Create JSON objects for any drives. for(size_t j = 0; j < libs[i].numDrives; j++) { iolib_drive_t drive = libs[i].drives[j]; // Get UUID string uuid = _stdStringFromIoLibString(iolibDriveGetUuid(drive)); // Create drive object drives.push_back({ {"id", uuid}, {"name", _stdStringFromIoLibString(iolibDriveGetName(drive))}, {"file", _stdStringFromIoLibString(iolibDriveGetDevFile(drive))} // {"library", libs[i].id} }); driveIds.push_back(uuid); } // Create JSON objects for any loaders. for(size_t j = 0; j < libs[i].numLoaders; j++) { iolib_loader_t loader = libs[i].loaders[j]; string uuid = _stdStringFromIoLibString(iolibLoaderGetUuid(loader)); // Process all of the elements vector<string> loaderElementIds; size_t numElements = 0; static const iolib_storage_element_type_t types[] = { kStorageElementTransport, kStorageElementDrive, kStorageElementPortal, kStorageElementSlot }; for(size_t i = 0; i < (sizeof(types) / sizeof(*types)); i++) { // Get the number of elements size_t elmsOfType = iolibLoaderGetNumElements(loader, types[i]); numElements += elmsOfType; iolib_storage_element_t elms[elmsOfType]; // Get all the elements iolibLoaderGetElements(loader, types[i], reinterpret_cast<iolib_storage_element_t *>(&elms), elmsOfType); // ...and now, process them. for(size_t j = 0; j < elmsOfType; j++) { iolib_storage_element_t element = elms[j]; json elementJson = _jsonForElement(element); elements.push_back(elementJson); loaderElementIds.push_back(elementJson["id"]); } } // Create loader entry loaders.push_back({ {"id", uuid}, {"name", _stdStringFromIoLibString(iolibLoaderGetName(loader))}, {"file", _stdStringFromIoLibString(iolibLoaderGetDevFile(loader))}, {"elements", loaderElementIds} // {"library", libs[i].id} }); loaderIds.push_back(uuid); } // Insert the JSON object for the library. libraries.push_back({ {"id", _stdStringFromIoLibString(libs[i].id)}, {"name", _stdStringFromIoLibString(libs[i].name)}, {"drives", driveIds}, {"loaders", loaderIds}, }); } // Construct the response return { {"libraries", libraries}, {"drives", drives}, {"loaders", loaders}, {"elements", elements}, }; } /** * Constructs a json object for a loader's storage element. */ json WWWAPIHandler::_jsonForElement(iolib_storage_element_t element) { json elementJson; // Get UUID elementJson["id"] = _stdStringFromIoLibString(iolibElementGetUuid(element)); // Get logical element address elementJson["address"] = iolibElementGetAddress(element); // Check the flags - is it empty? elementJson["isEmpty"] = !(iolibElementGetFlags(element) & kStorageElementFull); // Populate the type switch(iolibElementGetType(element)) { case kStorageElementDrive: elementJson["kind"] = "drive"; break; case kStorageElementSlot: elementJson["kind"] = "storage"; break; case kStorageElementPortal: elementJson["kind"] = "portal"; break; case kStorageElementTransport: elementJson["kind"] = "transport"; break; default: break; } // And lastly, the volume tag. iolib_string_t rawLabel = iolibElementGetLabel(element); string label = string(rawLabel); iolibStringFree(rawLabel); elementJson["label"] = label; return elementJson; } /** * Creates a standard library string from an iolib string, freeing that iolib * string once done. */ string WWWAPIHandler::_stdStringFromIoLibString(iolib_string_t in) { string out = string(in); iolibStringFree(in); return out; }
25.211982
89
0.640468
backuperator
be27fe93d77b6389d9ad019f2b1fda05c4348c84
277
cpp
C++
LearnC++ForProgramingDevelopement/Part_I_ProgramacionProcedural/Chapter06/TheIfStatement.cpp
Gabroide/TextAdvenure
d2fc9b2ef21d66a17b9b716975087093c592abbc
[ "MIT" ]
null
null
null
LearnC++ForProgramingDevelopement/Part_I_ProgramacionProcedural/Chapter06/TheIfStatement.cpp
Gabroide/TextAdvenure
d2fc9b2ef21d66a17b9b716975087093c592abbc
[ "MIT" ]
null
null
null
LearnC++ForProgramingDevelopement/Part_I_ProgramacionProcedural/Chapter06/TheIfStatement.cpp
Gabroide/TextAdvenure
d2fc9b2ef21d66a17b9b716975087093c592abbc
[ "MIT" ]
null
null
null
#include <iostream> int main(int argc, char** argv[]) { if (true) { std::cout << "Print This!" << std::endl; } std::cout << std::endl; std::cout << std::endl; std::cout << "Enter a 0 to finish the program" << std::endl; int number; std::cin >> number; return 0; }
16.294118
61
0.581227
Gabroide
be28b458b28ca656e1ada7977e8fadb8c5308ce3
19,229
cpp
C++
ImportantExample/Cutegram-master/Cutegram/asemantools/asemandesktoptools.cpp
xiaohaijin/Qt
54d961c6a8123d8e4daf405b7996aba4be9ab7ed
[ "MIT" ]
3
2018-12-24T19:35:52.000Z
2022-02-04T14:45:59.000Z
ImportantExample/Cutegram-master/Cutegram/asemantools/asemandesktoptools.cpp
xiaohaijin/Qt
54d961c6a8123d8e4daf405b7996aba4be9ab7ed
[ "MIT" ]
null
null
null
ImportantExample/Cutegram-master/Cutegram/asemantools/asemandesktoptools.cpp
xiaohaijin/Qt
54d961c6a8123d8e4daf405b7996aba4be9ab7ed
[ "MIT" ]
1
2019-05-09T02:42:40.000Z
2019-05-09T02:42:40.000Z
/* Copyright (C) 2014 Aseman http://aseman.co This project is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "asemandesktoptools.h" #include <QProcess> #include <QStringList> #include <QPalette> #include <QEventLoop> #include <QFontDatabase> #include <QDebug> #ifdef DESKTOP_DEVICE #include <QInputDialog> #include <QColorDialog> #include <QFileDialog> #include <QFontDialog> #include <QMenu> #include <QAction> #include <QMessageBox> #endif class AsemanDesktopToolsPrivate { public: QFontDatabase *font_db; QString style; #ifdef DESKTOP_DEVICE QList<QMenu*> currentMenuObjects; #endif }; AsemanDesktopTools::AsemanDesktopTools(QObject *parent) : QObject(parent) { p = new AsemanDesktopToolsPrivate; p->font_db = 0; } int AsemanDesktopTools::desktopSession() const { static int result = -1; if( result != -1 ) return result; #ifdef Q_OS_MAC result = AsemanDesktopTools::Mac; #else #ifdef Q_OS_WIN result = AsemanDesktopTools::Windows; #else static QString *desktop_session = 0; if(!desktop_session) { desktop_session = new QString( qgetenv("DESKTOP_SESSION")); } if(desktop_session->contains("kde",Qt::CaseInsensitive)) { result = AsemanDesktopTools::Kde; } else if(desktop_session->contains("ubuntu",Qt::CaseInsensitive)) { result = AsemanDesktopTools::Unity; } else if(desktop_session->contains("gnome-fallback",Qt::CaseInsensitive)) { result = AsemanDesktopTools::GnomeFallBack; } else { result = AsemanDesktopTools::Gnome; } #endif #endif if( result == -1 ) { result = AsemanDesktopTools::Unknown; } return result; } QColor AsemanDesktopTools::titleBarColor() const { #ifdef DESKTOP_DEVICE const int dsession = desktopSession(); switch( dsession ) { case AsemanDesktopTools::Mac: return QColor("#C8C8C8"); break; case AsemanDesktopTools::Windows: return QColor("#E5E5E5"); break; case AsemanDesktopTools::Kde: return QPalette().window().color(); break; case AsemanDesktopTools::Unity: case AsemanDesktopTools::GnomeFallBack: case AsemanDesktopTools::Gnome: { static QColor *res = 0; if(!res) { QProcess prc; prc.start( "dconf", QStringList()<< "read"<< "/org/gnome/desktop/interface/gtk-theme" ); prc.waitForStarted(); prc.waitForFinished(); QString sres = prc.readAll(); sres.remove("\n").remove("'"); sres = sres.toLower(); if( sres == "ambiance" ) { res = new QColor("#403F3A"); } else if( sres == "radiance" ) { res = new QColor("#DFD7CF"); } else if( sres == "adwaita" ) { res = new QColor("#EDEDED"); } else if( dsession == AsemanDesktopTools::Unity ) { res = new QColor("#403F3A"); } else { res = new QColor("#EDEDED"); } } return *res; } break; } return QColor("#EDEDED"); #else return QColor("#111111"); #endif } QColor AsemanDesktopTools::titleBarTransparentColor() const { QColor color = titleBarColor(); color.setAlpha(160); return color; } QColor AsemanDesktopTools::titleBarTextColor() const { #ifdef DESKTOP_DEVICE const int dsession = desktopSession(); switch(dsession) { case AsemanDesktopTools::Mac: return QColor("#333333"); break; case AsemanDesktopTools::Windows: return QColor("#333333"); break; case AsemanDesktopTools::Kde: return QPalette().windowText().color(); break; case AsemanDesktopTools::Unity: case AsemanDesktopTools::GnomeFallBack: case AsemanDesktopTools::Gnome: { static QColor *res = 0; if(!res) { QProcess prc; prc.start( "dconf", QStringList()<< "read"<< "/org/gnome/desktop/interface/gtk-theme" ); prc.waitForStarted(); prc.waitForFinished(); QString sres = prc.readAll(); sres.remove("\n").remove("'"); sres = sres.toLower(); if(sres == "ambiance") { res = new QColor("#eeeeee"); } else if(sres == "radiance" ) { res = new QColor("#333333"); } else if(sres == "adwaita" ) { res = new QColor("#333333"); } else if(dsession == AsemanDesktopTools::Unity ) { res = new QColor("#eeeeee"); } else { res = new QColor("#333333"); } } return *res; } break; } return QColor("#333333"); #else return QColor("#ffffff"); #endif } bool AsemanDesktopTools::titleBarIsDark() const { const QColor & clr = titleBarColor(); qreal middle = (clr.green()+clr.red()+clr.blue())/3.0; if(middle > 128) { return false; } else { return true; } } QStringList AsemanDesktopTools::fontFamilies() const { if(!p->font_db) { p->font_db = new QFontDatabase(); } return p->font_db->families(); } void AsemanDesktopTools::setMenuStyle(const QString &style) { if(p->style == style) { return; } p->style = style; emit menuStyleChanged(); } QString AsemanDesktopTools::menuStyle() const { return p->style; } QObject *AsemanDesktopTools::currentMenuObject() const { #ifdef DESKTOP_DEVICE if(p->currentMenuObjects.isEmpty()) { return 0; } return p->currentMenuObjects.last(); #else return 0; #endif } QString AsemanDesktopTools::getOpenFileName(QWindow *window, const QString & title, const QString &filter, const QString &startPath) { #ifdef DESKTOP_DEVICE const int dsession = desktopSession(); switch(dsession) { case AsemanDesktopTools::Kde: if(QFileInfo::exists("/usr/bin/kdialog")) { QStringList args = QStringList()<< "--title" << title << "--getopenfilename" << startPath << filter; if( window ) { args << "--attach" << QString::number(window->winId()); } QProcess process; QEventLoop loop; connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()), Qt::QueuedConnection ); process.start("/usr/bin/kdialog", args ); loop.exec(QEventLoop::ExcludeUserInputEvents); if( process.exitStatus() == QProcess::NormalExit ) { return QString(process.readAll()).remove("\n"); } else { return QFileDialog::getOpenFileName(0, title, startPath, filter); } } else { return QFileDialog::getOpenFileName(0, title, startPath, filter); } break; case AsemanDesktopTools::Unity: case AsemanDesktopTools::GnomeFallBack: case AsemanDesktopTools::Gnome: if(QFileInfo::exists("/usr/bin/zenity")) { QStringList args = QStringList()<< "--title=" << "--file-selection" << "--class=Cutegram" << "--name=Cutegram"; if(!filter.isEmpty()) { args << "--file-filter=" + filter; } QProcess process; QEventLoop loop; connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()), Qt::QueuedConnection ); process.start("/usr/bin/zenity", args ); loop.exec(QEventLoop::ExcludeUserInputEvents); if( process.exitStatus() == QProcess::NormalExit ) { return QString(process.readAll()).remove("\n"); } else { return QFileDialog::getOpenFileName(0, title, startPath, filter); } } else { return QFileDialog::getOpenFileName(0, title, startPath, filter); } break; case AsemanDesktopTools::Mac: case AsemanDesktopTools::Windows: return QFileDialog::getOpenFileName(0, title, startPath, filter); break; } return QString(); #else Q_UNUSED(window) Q_UNUSED(title) Q_UNUSED(filter) Q_UNUSED(startPath) return QString(); #endif } QString AsemanDesktopTools::getSaveFileName(QWindow *window, const QString &title, const QString &filter, const QString &startPath) { #ifdef DESKTOP_DEVICE const int dsession = desktopSession(); switch(dsession) { case AsemanDesktopTools::Kde: if(QFileInfo::exists("/usr/bin/kdialog")) { QStringList args = QStringList()<< "--title" << title << "--getsavefilename" << startPath << filter; if( window ) { args << "--attach" << QString::number(window->winId()); } QProcess process; QEventLoop loop; connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()), Qt::QueuedConnection ); process.start("/usr/bin/kdialog", args ); loop.exec(QEventLoop::ExcludeUserInputEvents); if( process.exitStatus() == QProcess::NormalExit ) { return QString(process.readAll()).remove("\n"); } else { return QFileDialog::getSaveFileName(0, title, startPath, filter); } } else { return QFileDialog::getSaveFileName(0, title, startPath, filter); } break; case AsemanDesktopTools::Unity: case AsemanDesktopTools::GnomeFallBack: case AsemanDesktopTools::Gnome: if(QFileInfo::exists("/usr/bin/zenity")) { QStringList args = QStringList()<< "--title=" << "--file-selection" << "--save" << "--class=Cutegram" << "--name=Cutegram"; if(!filter.isEmpty()) { args << "--file-filter=" + filter; } QProcess process; QEventLoop loop; connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()), Qt::QueuedConnection ); process.start("/usr/bin/zenity", args ); loop.exec(QEventLoop::ExcludeUserInputEvents); if( process.exitStatus() == QProcess::NormalExit ) { return QString(process.readAll()).remove("\n"); } else { return QFileDialog::getSaveFileName(0, title, startPath, filter); } } else { return QFileDialog::getSaveFileName(0, title, startPath, filter); } break; case AsemanDesktopTools::Mac: case AsemanDesktopTools::Windows: return QFileDialog::getSaveFileName(0, title, startPath, filter); break; } return QString(); #else Q_UNUSED(window) Q_UNUSED(title) Q_UNUSED(filter) Q_UNUSED(startPath) return QString(); #endif } QString AsemanDesktopTools::getExistingDirectory(QWindow *window, const QString &title, const QString &startPath) { #ifdef DESKTOP_DEVICE const int dsession = desktopSession(); switch(dsession) { case AsemanDesktopTools::Kde: if(QFileInfo::exists("/usr/bin/kdialog")) { QStringList args = QStringList()<< "--title" << title << "--getexistingdirectory" << startPath; if( window ) { args << "--attach" << QString::number(window->winId()); } QProcess process; QEventLoop loop; connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()), Qt::QueuedConnection ); process.start("/usr/bin/kdialog", args ); loop.exec(QEventLoop::ExcludeUserInputEvents); if( process.exitStatus() == QProcess::NormalExit ) { return QString(process.readAll()).remove("\n"); } else { return QFileDialog::getExistingDirectory(0, title, startPath); } } else { return QFileDialog::getExistingDirectory(0, title, startPath); } break; case AsemanDesktopTools::Unity: case AsemanDesktopTools::GnomeFallBack: case AsemanDesktopTools::Gnome: if(QFileInfo::exists("/usr/bin/zenity")) { QStringList args = QStringList()<< "--title=" << "--file-selection" << "--directory" << "--class=Cutegram" << "--name=Cutegram"; QProcess process; QEventLoop loop; connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()), Qt::QueuedConnection ); process.start("/usr/bin/zenity", args ); loop.exec(QEventLoop::ExcludeUserInputEvents); if( process.exitStatus() == QProcess::NormalExit ) { return QString(process.readAll()).remove("\n"); } else { return QFileDialog::getExistingDirectory(0, title, startPath); } } else { return QFileDialog::getExistingDirectory(0, title, startPath); } break; case AsemanDesktopTools::Mac: case AsemanDesktopTools::Windows: return QFileDialog::getExistingDirectory(0, title, startPath); break; } return QString(); #else Q_UNUSED(window) Q_UNUSED(title) Q_UNUSED(startPath) return QString(); #endif } QFont AsemanDesktopTools::getFont(QWindow *window, const QString &title, const QFont &font) { #ifdef DESKTOP_DEVICE Q_UNUSED(window) bool ok = false; return QFontDialog::getFont(&ok, font, 0, title); #else Q_UNUSED(window) Q_UNUSED(title) Q_UNUSED(font) return font; #endif } QColor AsemanDesktopTools::getColor(const QColor &color) const { #ifdef DESKTOP_DEVICE return QColorDialog::getColor(color); #else return color; #endif } QString AsemanDesktopTools::getText(QWindow *window, const QString &title, const QString &text, const QString &defaultText) { Q_UNUSED(window) Q_UNUSED(title) Q_UNUSED(text) Q_UNUSED(defaultText) #ifdef DESKTOP_DEVICE bool ok = false; const QString &result = QInputDialog::getText(0, title, text, QLineEdit::Normal, defaultText, &ok); if(!ok) { return QString(); } return result; #else return QString(); #endif } int AsemanDesktopTools::showMenu(const QVariantList &actions, QPoint point) { #ifdef DESKTOP_DEVICE if( point.isNull() ) { point = QCursor::pos(); } QList<QAction*> pointers; QMenu *menu = menuOf(actions, &pointers); menu->setStyleSheet(p->style); p->currentMenuObjects.append(menu); emit currentMenuObjectChanged(); QAction *res = menu->exec(point); p->currentMenuObjects.removeAll(menu); emit currentMenuObjectChanged(); menu->deleteLater(); return pointers.indexOf(res); #else Q_UNUSED(actions) Q_UNUSED(point) return -1; #endif } QMenu *AsemanDesktopTools::menuOf(const QVariantList &list, QList<QAction *> *actions, QMenu *parent) { #ifdef DESKTOP_DEVICE QMenu *result = new QMenu(parent); foreach(const QVariant &var, list) { QString txt; bool checkable = false; bool checked = false; QVariantList list; switch(static_cast<int>(var.type())) { case QVariant::Map: { const QVariantMap &map = var.toMap(); checkable = map["checkable"].toBool(); checked = map["checked"].toBool(); txt = map["text"].toString(); list = map["list"].toList(); } break; default: txt = var.toString(); break; } QAction *act; if(list.isEmpty()) { act = (txt.isEmpty()? result->addSeparator() : result->addAction(txt)); act->setCheckable(checkable); if(checkable) act->setChecked(checked); } else { QMenu *menu = menuOf(list, actions, result); menu->setTitle(txt); act = result->addMenu(menu); } (*actions) << act; } return result; #else Q_UNUSED(list) Q_UNUSED(actions) Q_UNUSED(parent) return 0; #endif } bool AsemanDesktopTools::yesOrNo(QWindow *window, const QString &title, const QString &text, int type) { Q_UNUSED(window) #ifdef DESKTOP_DEVICE switch(type) { case Warning: return QMessageBox::warning(0, title, text, QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes; break; case Information: return QMessageBox::information(0, title, text, QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes; break; case Question: return QMessageBox::question(0, title, text, QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes; break; case Critical: return QMessageBox::critical(0, title, text, QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes; break; } return false; #else Q_UNUSED(title) Q_UNUSED(text) Q_UNUSED(type) return false; #endif } void AsemanDesktopTools::showMessage(QWindow *window, const QString &title, const QString &text, int type) { Q_UNUSED(window) #ifdef DESKTOP_DEVICE switch(type) { case Warning: QMessageBox::warning(0, title, text, QMessageBox::Ok); break; case Information: QMessageBox::information(0, title, text, QMessageBox::Ok); break; case Question: QMessageBox::question(0, title, text, QMessageBox::Ok); break; case Critical: QMessageBox::critical(0, title, text, QMessageBox::Ok); break; } #else Q_UNUSED(title) Q_UNUSED(text) Q_UNUSED(type) return; #endif } AsemanDesktopTools::~AsemanDesktopTools() { if(p->font_db) { delete p->font_db; } delete p; }
25.268068
132
0.567112
xiaohaijin
be2bdfa47de831bcc65f7d59d91ed114576d0441
594
cpp
C++
ITP2/ITP2_9_D.cpp
felixny/AizuOnline
8ff399d60077e08961845502d4a99244da580cd2
[ "MIT" ]
null
null
null
ITP2/ITP2_9_D.cpp
felixny/AizuOnline
8ff399d60077e08961845502d4a99244da580cd2
[ "MIT" ]
null
null
null
ITP2/ITP2_9_D.cpp
felixny/AizuOnline
8ff399d60077e08961845502d4a99244da580cd2
[ "MIT" ]
null
null
null
// ITP2_9_D #include <algorithm> #include <iostream> #include <map> #include <numeric> #include <set> #include <tuple> #include <utility> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } int m; cin >> m; vector<int> b(m); for(int i = 0; i < m; i++){ cin >> b[i]; } vector<int> c; auto it = set_symmetric_difference(a.begin(), a.end(), b.begin(),b.end(),back_inserter(c)); for (auto it = c.begin() ; it != c.end(); it++){ cout << *it << endl; } return 0; }
15.631579
93
0.538721
felixny
be2d3ee6ae6cf6ff3465d3636ffa7fe6d5463a99
15,152
inl
C++
src/fonts/stb_font_arial_bold_11_usascii.inl
stetre/moonfonts
5c8010c02ea62edcf42902e09478b0cd14af56ea
[ "MIT" ]
3
2018-03-13T12:51:57.000Z
2021-10-11T11:32:17.000Z
src/fonts/stb_font_arial_bold_11_usascii.inl
stetre/moonfonts
5c8010c02ea62edcf42902e09478b0cd14af56ea
[ "MIT" ]
null
null
null
src/fonts/stb_font_arial_bold_11_usascii.inl
stetre/moonfonts
5c8010c02ea62edcf42902e09478b0cd14af56ea
[ "MIT" ]
null
null
null
// Font generated by stb_font_inl_generator.c (4/1 bpp) // // Following instructions show how to use the only included font, whatever it is, in // a generic way so you can replace it with any other font by changing the include. // To use multiple fonts, replace STB_SOMEFONT_* below with STB_FONT_arial_bold_11_usascii_*, // and separately install each font. Note that the CREATE function call has a // totally different name; it's just 'stb_font_arial_bold_11_usascii'. // /* // Example usage: static stb_fontchar fontdata[STB_SOMEFONT_NUM_CHARS]; static void init(void) { // optionally replace both STB_SOMEFONT_BITMAP_HEIGHT with STB_SOMEFONT_BITMAP_HEIGHT_POW2 static unsigned char fontpixels[STB_SOMEFONT_BITMAP_HEIGHT][STB_SOMEFONT_BITMAP_WIDTH]; STB_SOMEFONT_CREATE(fontdata, fontpixels, STB_SOMEFONT_BITMAP_HEIGHT); ... create texture ... // for best results rendering 1:1 pixels texels, use nearest-neighbor sampling // if allowed to scale up, use bilerp } // This function positions characters on integer coordinates, and assumes 1:1 texels to pixels // Appropriate if nearest-neighbor sampling is used static void draw_string_integer(int x, int y, char *str) // draw with top-left point x,y { ... use texture ... ... turn on alpha blending and gamma-correct alpha blending ... glBegin(GL_QUADS); while (*str) { int char_codepoint = *str++; stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR]; glTexCoord2f(cd->s0, cd->t0); glVertex2i(x + cd->x0, y + cd->y0); glTexCoord2f(cd->s1, cd->t0); glVertex2i(x + cd->x1, y + cd->y0); glTexCoord2f(cd->s1, cd->t1); glVertex2i(x + cd->x1, y + cd->y1); glTexCoord2f(cd->s0, cd->t1); glVertex2i(x + cd->x0, y + cd->y1); // if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct x += cd->advance_int; } glEnd(); } // This function positions characters on float coordinates, and doesn't require 1:1 texels to pixels // Appropriate if bilinear filtering is used static void draw_string_float(float x, float y, char *str) // draw with top-left point x,y { ... use texture ... ... turn on alpha blending and gamma-correct alpha blending ... glBegin(GL_QUADS); while (*str) { int char_codepoint = *str++; stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR]; glTexCoord2f(cd->s0f, cd->t0f); glVertex2f(x + cd->x0f, y + cd->y0f); glTexCoord2f(cd->s1f, cd->t0f); glVertex2f(x + cd->x1f, y + cd->y0f); glTexCoord2f(cd->s1f, cd->t1f); glVertex2f(x + cd->x1f, y + cd->y1f); glTexCoord2f(cd->s0f, cd->t1f); glVertex2f(x + cd->x0f, y + cd->y1f); // if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct x += cd->advance; } glEnd(); } */ #ifndef STB_FONTCHAR__TYPEDEF #define STB_FONTCHAR__TYPEDEF typedef struct { // coordinates if using integer positioning float s0,t0,s1,t1; signed short x0,y0,x1,y1; int advance_int; // coordinates if using floating positioning float s0f,t0f,s1f,t1f; float x0f,y0f,x1f,y1f; float advance; } stb_fontchar; #endif #define STB_FONT_arial_bold_11_usascii_BITMAP_WIDTH 128 #define STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT 50 #define STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT_POW2 64 #define STB_FONT_arial_bold_11_usascii_FIRST_CHAR 32 #define STB_FONT_arial_bold_11_usascii_NUM_CHARS 95 #define STB_FONT_arial_bold_11_usascii_LINE_SPACING 7 static unsigned int stb__arial_bold_11_usascii_pixels[]={ 0x0881008c,0x00020020,0x02026098,0x00018400,0x200800a0,0x5a820000, 0xf53441fb,0x50953d49,0xfe89dddb,0x5761ff34,0x3bfa60f9,0x6cc9b00b, 0x506fec78,0x30ffec0f,0x260b21dd,0x2eea85ee,0x2e8ba4a8,0x1444c9a2, 0x846d41f1,0x79a6c4c8,0x3e25cbd4,0x9b04ea9d,0x4c3af722,0x05ea4d8e, 0xbb8af3aa,0x1b9068bc,0x84b9f81f,0x23d8f12c,0x8f513268,0xbb71d13d, 0xf34d8f3f,0x7d45f5f0,0xda6c1ae0,0x74c1efef,0x997f7ea1,0x4eed40ef, 0x89df302c,0x21d02af9,0x6886e46a,0x647a85d1,0x5eab7754,0x43cd361c, 0x263dc7ec,0x23a4d80f,0x2a1ec82d,0x3ee2f89f,0xab45542f,0x84cffe40, 0x3444dcfb,0xd13f98d7,0xb71ea1f6,0x5b54b672,0xf9879a6c,0x4d70fcc4, 0x3bf69b08,0x2a6b81ef,0x0d790fa7,0xfa9b2eb2,0x2f51fec8,0x8d525479, 0x1745a25c,0x2ae991ea,0xd8979d3d,0x03f30f34,0x649d53bd,0xf5d73f9d, 0x9723aa13,0xd71f8afa,0x36d10d5b,0xf31f51e9,0x1ae7e21f,0x8f63c459, 0x8f513668,0xbbd3b32d,0x1e69b03d,0x3f2609f7,0x37fa60be,0xfb0b5970, 0x27efd43d,0x4b207bf6,0x6ffe46db,0xd0bbee4d,0x45d12d81,0x7b837268, 0xd503723c,0x0079a6c1,0x11110000,0x20480000,0x20000040,0x41db5981, 0x7d53e668,0x3b6a0ea4,0x53fa0cee,0x00000ff9,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x21002000,0x00080608,0x40000800,0x88200000, 0x00442011,0x40cfc800,0x7e4c1efc,0x7efec0be,0xdf9303a2,0xf00dfb87, 0x306ffec5,0xe88be21f,0x41e60dff,0xfa9ff479,0x777ec5fe,0x49ffff72, 0x3aa7ea6c,0x323e63e8,0x2754ef45,0x645f31f3,0x97d46f42,0xf843d9f8, 0x49d13f32,0x225f10f9,0x265e99de,0x3e628817,0x4be27ea2,0x312f98f9, 0xa7c45f93,0x8972b94e,0x83e63dbf,0x22f9ae6b,0x2083e24a,0x6fecb76a, 0x815bf12f,0x265f10f9,0xd9f3021f,0xffe9e61d,0x5d361f51,0x07f30be6, 0x5fccdbf5,0x70ff6c7e,0x3f31f98f,0xf73445f7,0xf37bb5c0,0x7ecc5f31, 0x7c43e62f,0x33774f72,0x9e63f13f,0x22bea1f8,0x5f51f31f,0x5fb02fc4, 0x5ae5cb98,0x2223e66b,0x3efae0fa,0x21f98742,0x5d6ed50b,0xc894cbe6, 0x8fc43e67,0x4cf951f9,0xf13ccbe7,0x227efd43,0x1ba2fdfc,0xd8d98f70, 0xd1b23ea3,0x64cbff5b,0xd1641f88,0x3e23f73b,0xf53f33d8,0x9f62be65, 0x20fb9cf8,0x267d99ee,0xf13ccbe7,0x2f803d43,0x701335f9,0xd819fd0f, 0x7fe4c1ef,0x17ff61ee,0x3efc992a,0xbf906fdc,0x0fff645d,0xb10fffee, 0xf3cc5dff,0x21f89e65,0x3a5f007a,0x7b86ffff,0x05c00000,0x00000200, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x005c0000,0xd91fa800,0x9a7cd3a1, 0x2f897a0f,0x3fff60f5,0x7fccf36f,0x987d44ff,0x3e22ffff,0x997c7f32, 0xf70ff67f,0x3ee1f307,0xff907ea2,0x45f07cc9,0x5b22f9ed,0xfb8d76fc, 0x18bd4f70,0x4c277662,0x3ea6be67,0x57cc3ea2,0x4cbe27d9,0x3e65f0ff, 0xfe87ff1f,0x3fa8f986,0x11f33ff4,0x2f83e65d,0x2f517fe2,0x444d8fce, 0x47d49b2f,0x3cc5d85e,0x43f311f3,0x2e1f30fa,0x4ef98fc7,0x26f7e65f, 0x3ebe63ee,0x427dfcc1,0x25f100f9,0x42f99af9,0x7d7c42fd,0xdd82fae9, 0x177ea1f8,0xf99e62ec,0x87d43fff,0x7c4ffef9,0x5f3f3f30,0x3b2f6fe6, 0x26275723,0x0f986fff,0x3fe64f88,0x3bea2fff,0xfd97ee86,0xa8f7f503, 0x98bb06ff,0x0bee3e67,0x2afe61f5,0x32f30e80,0xdf3f32fe,0x7f7fc7d5, 0x3e6fe60f,0x2dc07cc3,0xf12f83e6,0x4fc87f19,0x27fc0ff5,0x360fa3ea, 0x21f33cc5,0x4c3ea0fc,0xbcc3200f,0x3ef32ff8,0x55f53e8f,0xc87cc7f5, 0x503fe20f,0x4be0f985,0x543f70fc,0x640bf12f,0x0fabd41f,0xf99e62ec, 0x87d4bd10,0x4c7e00f9,0xdbccbea7,0xd91767d7,0x05f887cc,0x20f98b90, 0x0000002f,0x00000000,0x00000000,0x00000000,0x00000000,0x80001800, 0x03e66ffd,0x00010104,0x10040002,0x08ffff70,0xfff317c4,0x3fffe69f, 0x0bfffe67,0x98fc3df9,0x6c84ffff,0x0f98aafe,0x7447e798,0x43d502fe, 0x076e4ffc,0x3f20f76c,0x176aa23f,0xf317f43f,0x2be61335,0x267e6199, 0xd91f50fc,0xf535f30c,0x7c5bf623,0x203e60bc,0x57547e79,0x8fbae209, 0x911f88fa,0x5ab545df,0x220e63e6,0xfdb84c0e,0x9866be62,0x3e6099af, 0x0d908fe0,0x89ee6be6,0xbb7d36bb,0xf3cc07cc,0xf71ffe43,0x21ecd707, 0xddf91fd8,0x0f6035cd,0x262f8f98,0xdf30ffff,0xd07cc7dd,0x42a2fa89, 0xb85ffff9,0x1f30f986,0x23f31f30,0x7dc4d73a,0x3e67ea3e,0x547df911, 0x547cc536,0x45407c46,0xf30dfced,0x2601f301,0x3f98fe0f,0xf10f98fc, 0x71d36b87,0x04cd7ccd,0x3a23fbfd,0x43d502ef,0x0b6e3efc,0x3f21775c, 0x9f834c2e,0xf30dfccb,0x3335f301,0x87dccfcc,0x43219cf8,0x43f99af9, 0x9877f66b,0x0005ffff,0x00000000,0x5f002dc0,0x7fcc07cc,0x3ffe67ff, 0x9ffff22e,0x17fffe61,0x000001ae,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x40880000,0x08844220,0x88820882,0x01042088, 0x44222021,0x00880888,0x82101079,0x10866028,0x42882233,0x442eeeee, 0x7cf63fee,0x7cd367d4,0x64bb1f50,0xf9d53fff,0x67ccbfdb,0x2bdf30ee, 0x741ffffc,0x305ec445,0x3e7ea137,0xfcb5cf30,0x2ff92eff,0x2001e669, 0x36e5c8a8,0xf30f8ef8,0x01ffb172,0x2a3ea1d9,0x27e6799f,0x213f31f8, 0x75408888,0x3ffff20f,0x3ea3bd51,0x36b960f9,0x20888aa2,0x6c400008, 0x32fe26ee,0x0fd746bf,0x83ee17e6,0x99e6f37a,0x323cc7e7,0x2ba1ffff, 0x82f6224c,0x11ca25c9,0x00001441,0x1b2d7000,0xb87f95fd,0x21fde86f, 0x2f509bfa,0xf3ccf379,0x33311e63,0xd849a443,0x00000003,0x3a600000, 0x547dc7de,0x2e1fc41f,0x3ffa1d96,0x4de6f55f,0xf31f9e67,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000, }; static signed short stb__arial_bold_11_usascii_x[95]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,0,0,0,0,0,0, -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; static signed short stb__arial_bold_11_usascii_y[95]={ 8,0,0,0,0,0,0,0,0,0,0,2,6,4, 6,0,0,0,0,0,0,1,0,1,0,0,2,2,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,2,0,2,0,2,0,2,0,0, 0,0,0,2,2,2,2,2,2,2,1,2,2,2,2,2,2,0,0,0,3, }; static unsigned short stb__arial_bold_11_usascii_w[95]={ 0,3,5,6,6,9,7,2,3,3,4,6,3,3, 3,4,5,4,5,6,6,6,6,6,6,6,3,3,6,6,6,6,10,8,7,7,7,7,6,8,7,3,5,8, 6,8,7,8,7,8,8,7,6,7,8,10,7,8,6,4,4,3,6,7,3,6,6,6,6,6,4,6,6,3, 4,6,3,9,6,6,6,6,4,6,4,6,6,8,6,6,5,4,2,4,6, }; static unsigned short stb__arial_bold_11_usascii_h[95]={ 0,8,4,9,9,9,9,4,11,11,5,5,4,3, 2,9,9,8,8,9,8,8,9,7,9,9,6,8,7,5,7,8,11,8,8,9,8,8,8,9,8,8,9,8, 7,8,8,9,8,9,8,9,8,9,8,8,8,8,8,10,9,10,5,1,3,7,9,7,9,7,8,9,8,8, 11,8,8,6,6,7,8,8,6,7,8,7,6,6,6,9,6,11,11,11,3, }; static unsigned short stb__arial_bold_11_usascii_s[95]={ 127,68,85,69,90,97,107,95,1,23,80, 73,91,105,113,122,44,49,31,76,1,54,115,117,8,1,124,37,82,59,96, 112,27,89,41,36,23,15,8,73,119,56,63,98,61,80,72,54,60,15,47, 57,36,65,20,9,1,119,112,42,31,38,66,117,109,1,83,110,50,103,93, 24,82,89,18,29,43,37,47,89,98,105,54,75,107,68,17,8,24,47,31, 13,10,5,98, }; static unsigned short stb__arial_bold_11_usascii_t[95]={ 1,23,41,1,1,1,1,41,1,1,41, 41,41,41,41,1,13,32,32,1,32,32,1,32,13,13,32,32,32,41,32, 23,1,23,32,13,32,32,32,13,23,23,1,23,32,23,23,1,23,13,23, 13,23,13,23,23,23,13,13,1,13,1,41,41,41,41,1,32,13,32,13, 13,13,13,1,23,23,41,41,32,13,13,41,32,23,32,41,41,41,1,41, 1,1,1,41, }; static unsigned short stb__arial_bold_11_usascii_a[95]={ 44,52,75,88,88,140,114,37, 52,52,61,92,44,52,44,44,88,88,88,88,88,88,88,88, 88,88,52,52,92,92,92,96,154,114,114,114,114,105,96,123, 114,44,88,114,96,131,114,123,105,123,114,105,96,114,105,149, 105,105,96,52,44,52,92,88,52,88,96,88,96,88,52,96, 96,44,44,88,44,140,96,96,96,96,61,88,52,96,88,123, 88,88,79,61,44,61,92, }; // Call this function with // font: NULL or array length // data: NULL or specified size // height: STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT or STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT_POW2 // return value: spacing between lines static void stb_font_arial_bold_11_usascii(stb_fontchar font[STB_FONT_arial_bold_11_usascii_NUM_CHARS], unsigned char data[STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT][STB_FONT_arial_bold_11_usascii_BITMAP_WIDTH], int height) { int i,j; if (data != 0) { unsigned int *bits = stb__arial_bold_11_usascii_pixels; unsigned int bitpack = *bits++, numbits = 32; for (i=0; i < STB_FONT_arial_bold_11_usascii_BITMAP_WIDTH*height; ++i) data[0][i] = 0; // zero entire bitmap for (j=1; j < STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT-1; ++j) { for (i=1; i < STB_FONT_arial_bold_11_usascii_BITMAP_WIDTH-1; ++i) { unsigned int value; if (numbits==0) bitpack = *bits++, numbits=32; value = bitpack & 1; bitpack >>= 1, --numbits; if (value) { if (numbits < 3) bitpack = *bits++, numbits = 32; data[j][i] = (bitpack & 7) * 0x20 + 0x1f; bitpack >>= 3, numbits -= 3; } else { data[j][i] = 0; } } } } // build font description if (font != 0) { float recip_width = 1.0f / STB_FONT_arial_bold_11_usascii_BITMAP_WIDTH; float recip_height = 1.0f / height; for (i=0; i < STB_FONT_arial_bold_11_usascii_NUM_CHARS; ++i) { // pad characters so they bilerp from empty space around each character font[i].s0 = (stb__arial_bold_11_usascii_s[i]) * recip_width; font[i].t0 = (stb__arial_bold_11_usascii_t[i]) * recip_height; font[i].s1 = (stb__arial_bold_11_usascii_s[i] + stb__arial_bold_11_usascii_w[i]) * recip_width; font[i].t1 = (stb__arial_bold_11_usascii_t[i] + stb__arial_bold_11_usascii_h[i]) * recip_height; font[i].x0 = stb__arial_bold_11_usascii_x[i]; font[i].y0 = stb__arial_bold_11_usascii_y[i]; font[i].x1 = stb__arial_bold_11_usascii_x[i] + stb__arial_bold_11_usascii_w[i]; font[i].y1 = stb__arial_bold_11_usascii_y[i] + stb__arial_bold_11_usascii_h[i]; font[i].advance_int = (stb__arial_bold_11_usascii_a[i]+8)>>4; font[i].s0f = (stb__arial_bold_11_usascii_s[i] - 0.5f) * recip_width; font[i].t0f = (stb__arial_bold_11_usascii_t[i] - 0.5f) * recip_height; font[i].s1f = (stb__arial_bold_11_usascii_s[i] + stb__arial_bold_11_usascii_w[i] + 0.5f) * recip_width; font[i].t1f = (stb__arial_bold_11_usascii_t[i] + stb__arial_bold_11_usascii_h[i] + 0.5f) * recip_height; font[i].x0f = stb__arial_bold_11_usascii_x[i] - 0.5f; font[i].y0f = stb__arial_bold_11_usascii_y[i] - 0.5f; font[i].x1f = stb__arial_bold_11_usascii_x[i] + stb__arial_bold_11_usascii_w[i] + 0.5f; font[i].y1f = stb__arial_bold_11_usascii_y[i] + stb__arial_bold_11_usascii_h[i] + 0.5f; font[i].advance = stb__arial_bold_11_usascii_a[i]/16.0f; } } } #ifndef STB_SOMEFONT_CREATE #define STB_SOMEFONT_CREATE stb_font_arial_bold_11_usascii #define STB_SOMEFONT_BITMAP_WIDTH STB_FONT_arial_bold_11_usascii_BITMAP_WIDTH #define STB_SOMEFONT_BITMAP_HEIGHT STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT #define STB_SOMEFONT_BITMAP_HEIGHT_POW2 STB_FONT_arial_bold_11_usascii_BITMAP_HEIGHT_POW2 #define STB_SOMEFONT_FIRST_CHAR STB_FONT_arial_bold_11_usascii_FIRST_CHAR #define STB_SOMEFONT_NUM_CHARS STB_FONT_arial_bold_11_usascii_NUM_CHARS #define STB_SOMEFONT_LINE_SPACING STB_FONT_arial_bold_11_usascii_LINE_SPACING #endif
56.118519
127
0.716473
stetre
be2fc81cea460806903605b49557b1c34b4f1610
610
hpp
C++
include/RED4ext/Types/generated/CMaterialParameterHairParameters.hpp
Cyberpunk-Extended-Development-Team/RED4ext.SDK
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
[ "MIT" ]
1
2021-02-01T23:07:50.000Z
2021-02-01T23:07:50.000Z
include/RED4ext/Types/generated/CMaterialParameterHairParameters.hpp
Cyberpunk-Extended-Development-Team/RED4ext.SDK
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
[ "MIT" ]
null
null
null
include/RED4ext/Types/generated/CMaterialParameterHairParameters.hpp
Cyberpunk-Extended-Development-Team/RED4ext.SDK
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
[ "MIT" ]
null
null
null
#pragma once // This file is generated from the Game's Reflection data #include <cstdint> #include <RED4ext/Common.hpp> #include <RED4ext/REDhash.hpp> #include <RED4ext/Types/SimpleTypes.hpp> #include <RED4ext/Types/generated/CMaterialParameter.hpp> namespace RED4ext { struct CHairProfile; struct CMaterialParameterHairParameters : CMaterialParameter { static constexpr const char* NAME = "CMaterialParameterHairParameters"; static constexpr const char* ALIAS = NAME; Ref<CHairProfile> hairProfile; // 40 }; RED4EXT_ASSERT_SIZE(CMaterialParameterHairParameters, 0x58); } // namespace RED4ext
25.416667
75
0.786885
Cyberpunk-Extended-Development-Team
be315af64055a1a6c8ebdc94fb12af8c9b1ebaa7
8,534
cc
C++
core/scene-manager.cc
bourdenas/troll
0c00a993ecca95fa33a2a1bc39f912be1cfff960
[ "MIT" ]
null
null
null
core/scene-manager.cc
bourdenas/troll
0c00a993ecca95fa33a2a1bc39f912be1cfff960
[ "MIT" ]
null
null
null
core/scene-manager.cc
bourdenas/troll
0c00a993ecca95fa33a2a1bc39f912be1cfff960
[ "MIT" ]
null
null
null
#include "core/scene-manager.h" #include <glog/logging.h> #include <range/v3/action/push_back.hpp> #include <range/v3/action/sort.hpp> #include <range/v3/view/filter.hpp> #include <range/v3/view/map.hpp> #include <range/v3/view/transform.hpp> #include "core/collision-checker.h" #include "core/geometry.h" #include "core/resource-manager.h" #include "sdl/renderer.h" namespace troll { void SceneManager::SetupScene(const Scene& scene) { scene_ = scene; RenderAll(); } void SceneManager::AddSceneNode(const SceneNode& node) { const auto res = scene_nodes_.emplace(node.id(), node); LOG_IF(ERROR, !res.second) << "AddSceneNode() SceneNode with id='" << node.id() << "' already exists."; const auto it = res.first; Dirty(it->second); } void SceneManager::RemoveSceneNode(const std::string& id) { const auto it = scene_nodes_.find(id); LOG_IF(ERROR, it == scene_nodes_.end()) << "RemoveSceneNode() cannot find SceneNode with id='" << id << "'."; dirty_boxes_.push_back(GetSceneNodeBoundingBox(it->second)); dead_scene_nodes_.insert(id); } void SceneManager::Dirty(const SceneNode& scene_node) { dirty_boxes_.push_back(GetSceneNodeBoundingBox(scene_node)); core_->collision_checker()->Dirty(scene_node); } const SceneNode* SceneManager::GetSceneNodeById(const std::string& id) const { const auto it = scene_nodes_.find(id); return it != scene_nodes_.end() ? &it->second : nullptr; } SceneNode* SceneManager::GetSceneNodeById(const std::string& id) { return const_cast<SceneNode*>( static_cast<const SceneManager*>(this)->GetSceneNodeById(id)); } std::vector<std::string> SceneManager::GetSceneNodesAt(const Vector& at) const { std::vector<std::string> filtered_nodes; filtered_nodes |= ranges::push_back( scene_nodes_ | ranges::view::values | ranges::view::filter([this, &at](const SceneNode& node) { return geo::Contains(GetSceneNodeBoundingBox(node), at); }) | ranges::view::transform([](const SceneNode& node) { return node.id(); })); return filtered_nodes; } std::vector<std::string> SceneManager::GetSceneNodesBySpriteId( const std::string& sprite_id) const { std::vector<std::string> filtered_nodes; filtered_nodes |= ranges::push_back( scene_nodes_ | ranges::view::values | ranges::view::filter([&sprite_id](const SceneNode& node) { return node.sprite_id() == sprite_id; }) | ranges::view::transform([](const SceneNode& node) { return node.id(); })); return filtered_nodes; } std::vector<std::string> SceneManager::GetSceneNodesByPattern( const SceneNode& pattern) const { std::vector<std::string> filtered_nodes; filtered_nodes |= ranges::push_back( scene_nodes_ | ranges::view::values | ranges::view::filter([pattern](const SceneNode& node) { return SceneManager::NodePatternMatching(pattern, node); }) | ranges::view::transform([](const SceneNode& node) { return node.id(); })); return filtered_nodes; } std::vector<std::string> SceneManager::GetSceneNodesByPattern( const SceneNode& pattern, const std::vector<std::string>& node_ids) const { std::vector<std::string> filtered_nodes; filtered_nodes |= ranges::push_back( node_ids | ranges::view::transform([this](const std::string& id) { return GetSceneNodeById(id); }) | ranges::view::filter([pattern](const SceneNode* node) { return node != nullptr && SceneManager::NodePatternMatching(pattern, *node); }) | ranges::view::transform( [](const SceneNode* node) { return node->id(); })); return filtered_nodes; } void SceneManager::SetViewport(const Box& view) { viewport_ = view; // TODO(bourdenas): Render everything. } void SceneManager::ScrollViewport(const Vector& by) { // TODO(bourdenas): translate(viewport, by) // TODO(bourdenas): Render everything. } void SceneManager::Render() { // Collect scene nodes that overlap with dirty bounding boxes. std::unordered_set<const SceneNode*> dirty_nodes; for (int i = 0; i < dirty_boxes_.size(); ++i) { const std::vector<const SceneNode*> overlap_nodes = scene_nodes_ | ranges::view::values | ranges::view::filter([&dirty_nodes](const SceneNode& node) { return dirty_nodes.find(&node) == dirty_nodes.end(); }) | ranges::view::filter([this, i](const SceneNode& node) { return geo::Collide(dirty_boxes_[i], GetSceneNodeBoundingBox(node)); }) | ranges::view::transform([](const SceneNode& node) { return &node; }); for (const SceneNode* node : overlap_nodes) { dirty_nodes.insert(node); dirty_boxes_.push_back(GetSceneNodeBoundingBox(*node)); } } // Render behind bounding boxes. for (const auto& box : dirty_boxes_) { renderer_->FillColour(scene_.bitmap_config().background_colour(), box); } dirty_boxes_.clear(); // Render dirty nodes. std::vector<const SceneNode*> z_ordered_nodes = dirty_nodes | ranges::view::filter([](const SceneNode* node) { return node->visible(); }) | ranges::view::filter([this](const SceneNode* node) { return dead_scene_nodes_.find(node->id()) == dead_scene_nodes_.end(); }); z_ordered_nodes |= ranges::action::sort([](const SceneNode* lhs, const SceneNode* rhs) { return lhs->position().z() < rhs->position().z(); }); for (const auto* node : z_ordered_nodes) { BlitSceneNode(*node); } renderer_->Flip(); CleanUpDeletedSceneNodes(); } void SceneManager::RenderAll() { renderer_->ClearScreen(); renderer_->FillColour(scene_.bitmap_config().background_colour(), scene_.viewport()); if (scene_.bitmap_config().has_bitmap()) { renderer_->BlitTexture( resource_manager_->GetTexture(scene_.bitmap_config().bitmap()), Box(), Box()); } // Render all nodes based on their z-ordering. std::vector<const SceneNode*> z_ordered_nodes = scene_nodes_ | ranges::view::values | ranges::view::filter( [](const SceneNode& node) { return node.visible(); }) | ranges::view::filter([this](const SceneNode& node) { return dead_scene_nodes_.find(node.id()) == dead_scene_nodes_.end(); }) | ranges::view::transform([](const SceneNode& node) { return &node; }); z_ordered_nodes |= ranges::action::sort([](const SceneNode* lhs, const SceneNode* rhs) { return lhs->position().z() < rhs->position().z(); }); for (const auto* node : z_ordered_nodes) { BlitSceneNode(*node); } renderer_->Flip(); CleanUpDeletedSceneNodes(); } Box SceneManager::GetSceneNodeBoundingBox(const SceneNode& node) const { const auto& sprite = resource_manager_->GetSprite(node.sprite_id()); auto bounding_box = sprite.film(node.frame_index()); bounding_box.set_left(node.position().x()); bounding_box.set_top(node.position().y()); return bounding_box; } void SceneManager::BlitSceneNode(const SceneNode& node) const { const auto& sprite = resource_manager_->GetSprite(node.sprite_id()); const auto& bounding_box = sprite.film(node.frame_index()); Box destination = bounding_box; destination.set_left(node.position().x()); destination.set_top(node.position().y()); renderer_->BlitTexture(resource_manager_->GetTexture(sprite.resource()), bounding_box, destination); } void SceneManager::CleanUpDeletedSceneNodes() { for (const auto& id : dead_scene_nodes_) { const auto it = scene_nodes_.find(id); LOG_IF(ERROR, it == scene_nodes_.end()) << "CleanUpDeletedSceneNodes() SceneNode with id='" << id << "' was not found."; scene_nodes_.erase(it); } dead_scene_nodes_.clear(); } bool SceneManager::NodePatternMatching(const SceneNode& pattern, const SceneNode& node) { if (pattern.has_id() && node.id() != pattern.id()) return false; if (pattern.has_sprite_id() && node.sprite_id() != pattern.sprite_id()) { return false; } if (pattern.has_frame_index() && node.frame_index() != pattern.frame_index()) { return false; } if (pattern.has_position() && (node.position().x() != pattern.position().x() || node.position().y() != pattern.position().y() || node.position().z() != pattern.position().z())) { return false; } if (pattern.has_visible() && node.visible() != pattern.visible()) { return false; } return true; } } // namespace troll
33.865079
80
0.663698
bourdenas
be346571c9a043d8b44d62c4df674e382526b73a
923
cpp
C++
console/src/boost_1_78_0/libs/lexical_cast/test/typedefed_wchar_test.cpp
vany152/FilesHash
39f282807b7f1abc56dac389e8259ee3bb557a8d
[ "MIT" ]
106
2015-08-07T04:23:50.000Z
2020-12-27T18:25:15.000Z
console/src/boost_1_78_0/libs/lexical_cast/test/typedefed_wchar_test.cpp
vany152/FilesHash
39f282807b7f1abc56dac389e8259ee3bb557a8d
[ "MIT" ]
130
2016-06-22T22:11:25.000Z
2020-11-29T20:24:09.000Z
Libs/boost_1_76_0/libs/lexical_cast/test/typedefed_wchar_test.cpp
Antd23rus/S2DE
47cc7151c2934cd8f0399a9856c1e54894571553
[ "MIT" ]
64
2015-01-21T19:08:51.000Z
2021-07-16T19:32:11.000Z
// Unit test for boost::lexical_cast. // // See http://www.boost.org for most recent version, including documentation. // // Copyright Antony Polukhin, 2011-2021. // // Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). #include <boost/config.hpp> #include <boost/static_assert.hpp> #include <boost/lexical_cast.hpp> #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/posix_time/posix_time.hpp> void parseDate() { std::locale locale; boost::date_time::format_date_parser<boost::gregorian::date, wchar_t> parser(L"", locale); boost::date_time::special_values_parser<boost::gregorian::date, wchar_t> svp; boost::gregorian::date date = parser.parse_date(L"", L"", svp); (void)date; } int main() { parseDate(); return ::boost::lexical_cast<int>(L"1000") == 1000; }
24.945946
92
0.717226
vany152
be3471da2d0d6fcd161b03f087c27d73fff0a7bb
698
cpp
C++
SpaceBomber/Linux/graph/MyEventReceiver.cpp
667MARTIN/Epitech
81095d8e7d54e9abd95541ee3dfcc3bc85d5cf0e
[ "MIT" ]
40
2018-01-28T14:23:27.000Z
2022-03-05T15:57:47.000Z
SpaceBomber/Linux/graph/MyEventReceiver.cpp
667MARTIN/Epitech
81095d8e7d54e9abd95541ee3dfcc3bc85d5cf0e
[ "MIT" ]
1
2021-10-05T09:03:51.000Z
2021-10-05T09:03:51.000Z
SpaceBomber/Linux/graph/MyEventReceiver.cpp
667MARTIN/Epitech
81095d8e7d54e9abd95541ee3dfcc3bc85d5cf0e
[ "MIT" ]
73
2019-01-07T18:47:00.000Z
2022-03-31T08:48:38.000Z
#include "MyEventReceiver.hpp" #include <iostream> MyEventReceiver::MyEventReceiver() { for (irr::u32 i=0; i<irr::KEY_KEY_CODES_COUNT; ++i) KeyIsDown[i] = false; } MyEventReceiver& MyEventReceiver::operator=(const MyEventReceiver&) { return *this; } bool MyEventReceiver::IsKeyDown(irr::EKEY_CODE keyCode) const { return KeyIsDown[keyCode % irr::KEY_KEY_CODES_COUNT]; } bool MyEventReceiver::OnEvent(const irr::SEvent& event) { if (event.EventType == irr::EET_KEY_INPUT_EVENT) KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; return false; } void MyEventReceiver::restart() { for (irr::u32 i=0; i<irr::KEY_KEY_CODES_COUNT; ++i) KeyIsDown[i] = false; }
25.851852
69
0.72063
667MARTIN
be39ac2f62d4f7ba6242103dc37ce23beade3f44
1,310
cpp
C++
codeforces/contests/round/601-div2/d.cpp
tysm/cpsols
262212646203e516d1706edf962290de93762611
[ "MIT" ]
4
2020-10-05T19:24:10.000Z
2021-07-15T00:45:43.000Z
codeforces/contests/round/601-div2/d.cpp
tysm/cpsols
262212646203e516d1706edf962290de93762611
[ "MIT" ]
null
null
null
codeforces/contests/round/601-div2/d.cpp
tysm/cpsols
262212646203e516d1706edf962290de93762611
[ "MIT" ]
null
null
null
#include <cpplib/stdinc.hpp> int32_t main(){ desync(); int t; cin >> t; while(t--){ int n, m, k; cin >> n >> m >> k; int acc = 0; vector<string> ans(n); for(string &s:ans){ cin >> s; for(char c:s) acc += (c == 'R'); } vi cnt(k, acc/k); for(int i=0; i<acc%k; ++i) cnt[i]++; int cur = 0; for(int i=0; i<n; ++i){ string &s = ans[i]; if(i%2 == 0){ for(int j=0; j<m; ++j){ if(s[j] == 'R' and cnt[cur]) cnt[cur]--; s[j] = (cur + '0' <= '9'? cur + '0' : (cur - 10 + 'a' <= 'z'? cur - 10 + 'a' : cur - 36 + 'A')); if(!cnt[cur] and cur < k-1) cur++; } } else{ for(int j=m-1; j>=0; --j){ if(s[j] == 'R' and cnt[cur]) cnt[cur]--; s[j] = (cur + '0' <= '9'? cur + '0' : (cur - 10 + 'a' <= 'z'? cur - 10 + 'a' : cur - 36 + 'A')); if(!cnt[cur] and cur < k-1) cur++; } } cout << s << endl; } } return 0; }
26.734694
116
0.276336
tysm
be3bb8db30b8f4b1dc95bc0b404a5b7bacdcb7c2
1,535
cpp
C++
Sources/core/core/data_utils.cpp
GoodAI/ArnoldSimulator
ee99633db0a2ad773ec365ad0677888b46f78f9d
[ "Apache-2.0" ]
47
2016-11-21T15:36:00.000Z
2021-11-08T13:06:03.000Z
Sources/core/core/data_utils.cpp
boltofdeathbeam/ArnoldSimulator
ee99633db0a2ad773ec365ad0677888b46f78f9d
[ "Apache-2.0" ]
1
2016-11-24T04:43:42.000Z
2017-01-26T15:23:51.000Z
Sources/core/core/data_utils.cpp
boltofdeathbeam/ArnoldSimulator
ee99633db0a2ad773ec365ad0677888b46f78f9d
[ "Apache-2.0" ]
11
2016-11-24T03:44:55.000Z
2021-08-15T02:15:06.000Z
#include "log.h" #include <memory> #include "data_utils.h" void PutFloatToByteVector(std::vector<uint8_t> &targetByteVector, float item) { uint8_t *bytes = reinterpret_cast<uint8_t *>(&item); for (int i = 0; i < sizeof(float); ++i) targetByteVector.push_back(bytes[i]); } void AssingBufferToFloatVector(uint8_t *dataBuffer, size_t dataSize, std::vector<float> &targetFloatVector) { auto floatDataSize = dataSize / sizeof(float); if (dataSize != floatDataSize * sizeof(float)) { Log(LogLevel::Warn, "Observer data size not multiple of sizeof(float). Truncating."); } if (reinterpret_cast<uintptr_t>(dataBuffer) % sizeof(float) == 0) { // Check alignment. float * floatDataBuffer = reinterpret_cast<float*>(dataBuffer); targetFloatVector.assign(floatDataBuffer, floatDataBuffer + floatDataSize); } else { Log(LogLevel::Warn, "Observer float data not alligned. Extra alloc & copy needed."); // I doubt this ever happens. std::unique_ptr<float[]> tempFloatBuffer(new float[floatDataSize]); // NOTE: Allowing clients to provide a buffer would enable its reuse. memcpy(tempFloatBuffer.get(), dataBuffer, floatDataSize * sizeof(float)); targetFloatVector.assign(tempFloatBuffer.get(), tempFloatBuffer.get() + floatDataSize); } } void ConvertByteToFloatVector(std::vector<uint8_t> &byteVector, std::vector<float> &targetFloatVector) { AssingBufferToFloatVector(&byteVector[0], byteVector.size(), targetFloatVector); }
39.358974
146
0.704886
GoodAI
be3c374db0c2ae1e2ebec5ee0a71cf325b97320a
6,069
cpp
C++
src/vns/tb2localsearch.cpp
Pierre-Mont/toulbar2
623b92d593eab2dc1e21df9f853c28cc84626ed6
[ "MIT" ]
null
null
null
src/vns/tb2localsearch.cpp
Pierre-Mont/toulbar2
623b92d593eab2dc1e21df9f853c28cc84626ed6
[ "MIT" ]
null
null
null
src/vns/tb2localsearch.cpp
Pierre-Mont/toulbar2
623b92d593eab2dc1e21df9f853c28cc84626ed6
[ "MIT" ]
null
null
null
/* * tb2localsearch.cpp * * Created on: 3 mars 2015 * Author: Abdelkader Ouali * Phd. Student : LITIO, University of Oran. GREYC, University of Caen. */ #include "tb2localsearch.hpp" #include "core/tb2wcsp.hpp" LocalSearch::LocalSearch(Cost initUpperBound) : Solver(initUpperBound) , bestUb(MAX_COST) , lastUb(MAX_COST) { } LocalSearch::~LocalSearch() { } void LocalSearch::newSolution() { Solver::newSolution(); // static_cast<WCSP*>(wcsp)->registerConflicts(); lastSolution.clear(); for (unsigned int i = 0; i < wcsp->numberOfVariables(); ++i) { lastSolution[i] = wcsp->getValue(i); } lastUb = wcsp->getLb(); if (ToulBar2::lds) throw TimeOut(); // force VNS to restart with smallest search parameters at each solution } /// This function generates the initial solution /// \param mode : the generation method /// \param solutionInit : a map to store the initial solution Cost LocalSearch::generateInitSolution(VNSSolutionInitMethod mode, map<int, Value>& solutionInit, bool& complete) { if (lastUb < MAX_COST && lastSolution.size() == wcsp->numberOfVariables()) { // reuse INCOP solution or any solution found for (map<int, Value>::iterator it = lastSolution.begin(); it != lastSolution.end(); ++it) { solutionInit[(*it).first] = (*it).second; } complete = (lastUb == wcsp->getLb()); return lastUb; } Cost cost = MAX_COST; complete = false; vector<int> dumvariables; vector<Value> dumvalues; int lds = ToulBar2::lds; switch (mode) { case LS_INIT_RANDOM: if (ToulBar2::verbose >= 1) cout << "solution init random" << endl; for (unsigned int i = 0; i < wcsp->numberOfVariables(); ++i) { int res; Value* val = new Value[wcsp->getDomainSize(i)]; wcsp->getEnumDomain(i, val); res = (myrand() % wcsp->getDomainSize(i)); solutionInit[i] = *(val + res); delete[] val; } cost = evaluate_partialInstantiation(solutionInit); break; case LS_INIT_INF: if (ToulBar2::verbose >= 1) cout << "solution init inf" << endl; for (unsigned int i = 0; i < wcsp->numberOfVariables(); ++i) { solutionInit[i] = wcsp->getInf(i); } cost = evaluate_partialInstantiation(solutionInit); break; case LS_INIT_SUP: if (ToulBar2::verbose >= 1) cout << "solution init sup" << endl; for (unsigned int i = 0; i < wcsp->numberOfVariables(); ++i) { solutionInit[i] = wcsp->getSup(i); } cost = evaluate_partialInstantiation(solutionInit); break; case LS_INIT_DFBB: if (ToulBar2::verbose >= 1) cout << "solution init DFBB" << endl; ToulBar2::lds = 1; // ensures DFBB will stop after the first solution is found if any exists complete = repair_recursiveSolve(dumvariables, dumvalues, wcsp->getUb()); // forbidden assignments are NOT allowed! assert(complete || lastUb < MAX_COST); for (map<int, Value>::iterator it = lastSolution.begin(); it != lastSolution.end(); ++it) { solutionInit[(*it).first] = (*it).second; } cost = lastUb; ToulBar2::lds = lds; break; case LS_INIT_LDS0: default: // search using LDS with 0 or more discrepancies if (ToulBar2::verbose >= 1) cout << "solution init LDS " << mode << endl; ToulBar2::lds = 0; // ensures LDS will explore without stopping at the first solution complete = repair_recursiveSolve(abs(mode), dumvariables, dumvalues, wcsp->getUb()); // first, forbidden assignments are NOT allowed! if (!complete && lastUb == MAX_COST) { complete = repair_recursiveSolve(abs(mode), dumvariables, dumvalues, MAX_COST); // if nothing found, forbidden assignments are allowed! } assert(complete || lastUb < MAX_COST); for (map<int, Value>::iterator it = lastSolution.begin(); it != lastSolution.end(); ++it) { solutionInit[(*it).first] = (*it).second; } cost = lastUb; ToulBar2::lds = lds; break; } return cost; } Cost LocalSearch::evaluate_partialInstantiation( vector<int>& variables, vector<Value>& values) { Cost cost = MAX_COST; int storedepth = Store::getDepth(); Store::store(); try { wcsp->setUb(MAX_COST); wcsp->assignLS(variables, values); cost = wcsp->getLb(); } catch (const Contradiction&) { wcsp->whenContradiction(); } Store::restore(storedepth); return cost; } bool LocalSearch::repair_recursiveSolve(int discrepancy, vector<int>& variables, vector<Value>& values, Cost ls_ub) { lastUb = MAX_COST; lastSolution.clear(); ToulBar2::limited = false; ToulBar2::hbfs = 0; // HBFS not compatible with LDS int storedepth = Store::getDepth(); Cost lb = wcsp->getLb(); Store::store(); try { wcsp->setUb(ls_ub); wcsp->enforceUb(); wcsp->propagate(); lb = wcsp->getLb(); int nbvar = unassignedVars->getSize(); ToulBar2::limited = true; wcsp->assignLS(variables, values); if (unassignedVars->getSize() == nbvar) ToulBar2::limited = false; if (ToulBar2::DEE == 4) ToulBar2::DEE_ = 0; // only PSNS in preprocessing try { if (discrepancy >= 0) recursiveSolveLDS(discrepancy); else recursiveSolve(); } catch (const TimeOut&) { assert(ToulBar2::limited == true); if (ToulBar2::interrupted) throw TimeOut(); } } catch (const Contradiction&) { wcsp->whenContradiction(); } Store::restore(storedepth); return (!ToulBar2::limited || lastUb == lb); } /* Local Variables: */ /* c-basic-offset: 4 */ /* tab-width: 4 */ /* indent-tabs-mode: nil */ /* c-default-style: "k&r" */ /* End: */
34.288136
147
0.593508
Pierre-Mont
be3e221677a67d6866b9af51ec40836e36a5b8a6
56
cpp
C++
test/autogen/smp@algorithm@adjacent_difference.cpp
jonathanpoelen/jln.mp
e5f05fc4467f14ac0047e3bdc75a04076e689985
[ "MIT" ]
9
2020-07-04T16:46:13.000Z
2022-01-09T21:59:31.000Z
test/autogen/smp@algorithm@adjacent_difference.cpp
jonathanpoelen/jln.mp
e5f05fc4467f14ac0047e3bdc75a04076e689985
[ "MIT" ]
null
null
null
test/autogen/smp@algorithm@adjacent_difference.cpp
jonathanpoelen/jln.mp
e5f05fc4467f14ac0047e3bdc75a04076e689985
[ "MIT" ]
1
2021-05-23T13:37:40.000Z
2021-05-23T13:37:40.000Z
#include "jln/mp/smp/algorithm/adjacent_difference.hpp"
28
55
0.821429
jonathanpoelen
be3e9424cfd5c64c7b7e70853359c0e8cfa1c0f0
3,434
cc
C++
chrome/browser/media_galleries/win/recursive_mtp_device_object_enumerator.cc
GnorTech/chromium
e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2018-03-10T13:08:49.000Z
2018-03-10T13:08:49.000Z
chrome/browser/media_galleries/win/recursive_mtp_device_object_enumerator.cc
GnorTech/chromium
e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/browser/media_galleries/win/recursive_mtp_device_object_enumerator.cc
GnorTech/chromium
e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2020-11-04T07:19:31.000Z
2020-11-04T07:19:31.000Z
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // RecursiveMTPDeviceObjectEnumerator implementation. #include "chrome/browser/media_galleries/win/recursive_mtp_device_object_enumerator.h" #include "base/files/file_path.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" #include "chrome/browser/media_galleries/win/mtp_device_object_enumerator.h" #include "chrome/browser/media_galleries/win/mtp_device_operations_util.h" #include "content/public/browser/browser_thread.h" namespace chrome { RecursiveMTPDeviceObjectEnumerator::RecursiveMTPDeviceObjectEnumerator( IPortableDevice* device, const MTPDeviceObjectEntries& entries) : device_(device) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(!entries.empty()); current_enumerator_.reset(new MTPDeviceObjectEnumerator(entries)); } RecursiveMTPDeviceObjectEnumerator::~RecursiveMTPDeviceObjectEnumerator() { DCHECK(thread_checker_.CalledOnValidThread()); } base::FilePath RecursiveMTPDeviceObjectEnumerator::Next() { DCHECK(thread_checker_.CalledOnValidThread()); base::FilePath path = current_enumerator_->Next(); if (path.empty()) { // Reached the end of |current_enumerator_|. scoped_ptr<MTPDeviceObjectEnumerator> next_enumerator = GetNextSubdirectoryEnumerator(); if (next_enumerator) { current_enumerator_ = next_enumerator.Pass(); path = current_enumerator_->Next(); } else { // Traversed all the sub directories. return base::FilePath(); } } if (IsDirectory()) { // If the current entry is a directory, add it to // |untraversed_directory_object_ids_| to scan after scanning this // directory. string16 dir_object_entry_id = current_enumerator_->GetObjectId(); if (!dir_object_entry_id.empty()) untraversed_directory_object_ids_.push(dir_object_entry_id); } return path; } int64 RecursiveMTPDeviceObjectEnumerator::Size() { DCHECK(thread_checker_.CalledOnValidThread()); return current_enumerator_->Size(); } bool RecursiveMTPDeviceObjectEnumerator::IsDirectory() { DCHECK(thread_checker_.CalledOnValidThread()); return current_enumerator_->IsDirectory(); } base::Time RecursiveMTPDeviceObjectEnumerator::LastModifiedTime() { DCHECK(thread_checker_.CalledOnValidThread()); return current_enumerator_->LastModifiedTime(); } scoped_ptr<MTPDeviceObjectEnumerator> RecursiveMTPDeviceObjectEnumerator::GetNextSubdirectoryEnumerator() { while (!untraversed_directory_object_ids_.empty()) { // Create a MTPReadDirectoryWorker object to enumerate sub directories. string16 dir_entry_id = untraversed_directory_object_ids_.front(); untraversed_directory_object_ids_.pop(); MTPDeviceObjectEntries curr_object_entries; if (media_transfer_protocol::GetDirectoryEntries(device_.get(), dir_entry_id, &curr_object_entries) && !curr_object_entries.empty()) { return scoped_ptr<MTPDeviceObjectEnumerator>( new MTPDeviceObjectEnumerator(curr_object_entries)); } } // Reached the end. Traversed all the sub directories. return scoped_ptr<MTPDeviceObjectEnumerator>(); } } // namespace chrome
36.531915
86
0.751893
GnorTech
be3ee158571ba3a744909f43b7b0a59de1b5d321
1,501
hpp
C++
android-28/android/database/MergeCursor.hpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
12
2020-03-26T02:38:56.000Z
2022-03-14T08:17:26.000Z
android-28/android/database/MergeCursor.hpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
1
2021-01-27T06:07:45.000Z
2021-11-13T19:19:43.000Z
android-30/android/database/MergeCursor.hpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
3
2021-02-02T12:34:55.000Z
2022-03-08T07:45:57.000Z
#pragma once #include "./AbstractCursor.hpp" class JByteArray; class JArray; class JArray; namespace android::database { class ContentObserver; } namespace android::database { class DataSetObserver; } class JString; namespace android::database { class MergeCursor : public android::database::AbstractCursor { public: // Fields // QJniObject forward template<typename ...Ts> explicit MergeCursor(const char *className, const char *sig, Ts...agv) : android::database::AbstractCursor(className, sig, std::forward<Ts>(agv)...) {} MergeCursor(QJniObject obj); // Constructors MergeCursor(JArray arg0); // Methods void close() const; void deactivate() const; JByteArray getBlob(jint arg0) const; JArray getColumnNames() const; jint getCount() const; jdouble getDouble(jint arg0) const; jfloat getFloat(jint arg0) const; jint getInt(jint arg0) const; jlong getLong(jint arg0) const; jshort getShort(jint arg0) const; JString getString(jint arg0) const; jint getType(jint arg0) const; jboolean isNull(jint arg0) const; jboolean onMove(jint arg0, jint arg1) const; void registerContentObserver(android::database::ContentObserver arg0) const; void registerDataSetObserver(android::database::DataSetObserver arg0) const; jboolean requery() const; void unregisterContentObserver(android::database::ContentObserver arg0) const; void unregisterDataSetObserver(android::database::DataSetObserver arg0) const; }; } // namespace android::database
27.290909
178
0.752831
YJBeetle
be42514fd2c22eaf4d1378c2510877bf09f607ed
1,667
cpp
C++
src/1.1.3/Stack.cpp
minhdangphuoc/Stack_Profix_Calculator
b9b05dabb7e77039437eac4c93846b00355acf61
[ "MIT" ]
null
null
null
src/1.1.3/Stack.cpp
minhdangphuoc/Stack_Profix_Calculator
b9b05dabb7e77039437eac4c93846b00355acf61
[ "MIT" ]
null
null
null
src/1.1.3/Stack.cpp
minhdangphuoc/Stack_Profix_Calculator
b9b05dabb7e77039437eac4c93846b00355acf61
[ "MIT" ]
null
null
null
#include "Stack.hpp" #include "iostream" Error_code Stack::push(const Stack_entry &item) /* Pre: None. Post: If the Stack is not full, item is added to the top of the Stack. If the Stack is full, an Error code of overflow is returned and the Stack is left unchanged. */ { Error_code outcome = success; if (count >= maxstack) outcome = overflow; else entry[count++] = item; return outcome; } Error_code Stack::pop( ) /* Pre: None. Post: If the Stack is not empty, the top of the Stack is removed. If the Stack is empty, an Error code of underflow is returned. */ { Error_code outcome = success; if (count == 0) outcome = underflow; else --count; return outcome; } Error_code Stack::top(Stack_entry &item) const /* Pre: None. Post: If the Stack is not empty, the top of the Stack is returned in item. If the Stack is empty an Error code of underflow is returned. */ { Error_code outcome = success; if (count == 0) outcome = underflow; else item = entry[count - 1]; return outcome; } Error_code copy_stack(Stack &dest, Stack &source) { Error_code outcome = success; if (source.count == 0) outcome = underflow; else{ dest.count = source.count; for(int i = 0; i < source.count; i++){ dest.entry[i] = source.entry[i]; } } return outcome; } bool Stack::empty( ) const /* Pre: None. Post: If the Stack is empty, true is returned. Otherwise false is returned. */ { bool outcome = true; if (count > 0) outcome = false; return outcome; } Stack::Stack( ) /* Pre: None. Post: The stack is initialized to be empty. */ { count = 0; }
23.814286
87
0.643671
minhdangphuoc
be476c16b432110068fc6f158452c0c9d0480535
1,508
hpp
C++
RubetekIOS-CPP.framework/Versions/A/Headers/libnet/msw/asio/resolver.hpp
yklishevich/RubetekIOS-CPP-releases
7dfbbb45b8de7dbb6fa995ff5dcbca4ec06c2bdb
[ "MIT" ]
null
null
null
RubetekIOS-CPP.framework/Versions/A/Headers/libnet/msw/asio/resolver.hpp
yklishevich/RubetekIOS-CPP-releases
7dfbbb45b8de7dbb6fa995ff5dcbca4ec06c2bdb
[ "MIT" ]
null
null
null
RubetekIOS-CPP.framework/Versions/A/Headers/libnet/msw/asio/resolver.hpp
yklishevich/RubetekIOS-CPP-releases
7dfbbb45b8de7dbb6fa995ff5dcbca4ec06c2bdb
[ "MIT" ]
null
null
null
#pragma once #include <memory> #include <msw/zzz/asio/resolver.hpp> namespace msw { template <typename Protocol> struct resolver : noncopyable { typedef typename zzz::resolver<Protocol>::iterator iterator ; typedef typename zzz::resolver<Protocol>::query query ; typedef typename zzz::resolver<Protocol>::on_resolved on_resolved ; resolver (boost::asio::io_service&, query, on_resolved, on_error = nullptr) ; ~resolver () ; query resolve_query () const ; private: std::shared_ptr<zzz::resolver<Protocol>> resolver_; }; typedef resolver<boost::asio::ip::tcp> tcp_resolver ; typedef resolver<boost::asio::ip::udp> udp_resolver ; } namespace msw { template <typename Protocol> resolver<Protocol>::resolver(boost::asio::io_service& io_service, query query, on_resolved on_resolved, on_error on_error) : resolver_(std::make_shared<zzz::resolver<Protocol>>(io_service, query, on_resolved, on_error)) { resolver_->start(); } template <typename Protocol> resolver<Protocol>::~resolver() { resolver_->cancel(); } template <typename Protocol> typename resolver<Protocol>::query resolver<Protocol>::resolve_query() const { return resolver_->resolve_query(); } }
30.16
126
0.587533
yklishevich
be49b48e7d1d077fcd0571dc4032f61ce949414d
106,218
ipp
C++
REDSI_1160929_1161573/boost_1_67_0/libs/math/test/bessel_j_prime_data.ipp
Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo
eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8
[ "MIT" ]
85
2015-02-08T20:36:17.000Z
2021-11-14T20:38:31.000Z
libs/boost/libs/math/test/bessel_j_prime_data.ipp
flingone/frameworks_base_cmds_remoted
4509d9f0468137ed7fd8d100179160d167e7d943
[ "Apache-2.0" ]
9
2015-01-28T16:33:19.000Z
2020-04-12T23:03:28.000Z
libs/boost/libs/math/test/bessel_j_prime_data.ipp
flingone/frameworks_base_cmds_remoted
4509d9f0468137ed7fd8d100179160d167e7d943
[ "Apache-2.0" ]
27
2015-01-28T16:33:30.000Z
2021-08-12T05:04:39.000Z
// Copyright (c) 2014 Anton Bikineev // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) static const boost::array<boost::array<typename table_type<T>::type, 3>, 720 #if LDBL_MAX_10_EXP < 370 - 5 #endif > bessel_j_prime_data = {{ {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.553809732082299888134002685546875e-4), SC_(7.9648978910149220644314151981633892502393579865714) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.69304020144045352935791015625e-4), SC_(6.3653848991988529988220477650241685520191503142332) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.23264062474481761455535888671875e-3), SC_(1.8971705960000986690398059822421160899926699465394) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.4480001516640186309814453125e-3), SC_(0.98529897246253853844800411025777530163752073502973) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.5502865533344447612762451171875e-3), SC_(0.80213378584577808385371731269994831627611100850731) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.19227224402129650115966796875e-2), SC_(0.22881945446922959370415245044176092614274648710909) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.37370622158050537109375e-2), SC_(0.11639238325218579687879378821010964741303634572024) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.47696642577648162841796875e-2), SC_(0.090285635947979939708760228970288288400405507095951) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.1275280676782131195068359375e-1), SC_(0.028310110253065767611367722783039281567929780822508) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.20440109074115753173828125e-1), SC_(0.011437832630785135189848926023917028888883030118541) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.3429813683032989501953125e-1), SC_(-0.0042186780829510697643927657163520133060777440127718) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.96701286733150482177734375e-1), SC_(-0.043654403685014564129834014054367553568659669792961) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.159812271595001220703125e0), SC_(-0.076795076483668747332489412246651051532303741843621) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.297095477581024169921875e0), SC_(-0.14530589560654803595230285920771334403536798001997) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.77344071865081787109375e0), SC_(-0.35781255859257494677870346599515476750516695439221) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.1992881298065185546875e1), SC_(-0.57709619128762175849182337519495024595142653978034) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.3915013790130615234375e1), SC_(0.032874697176171305159599881134984554120579875033562) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.79858455657958984375e1), SC_(-0.23248455952535491176666424888090762133592541368724) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.1571910858154296875e2), SC_(-0.13744744338917036209493697966640300199111782413145) }}, {{ SC_(0.4430477856658399105072021484375e-3), SC_(0.31483119964599609375e2), SC_(0.092384054297253080189500208979099324382934270491253) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.553809732082299888134002685546875e-4), SC_(9.9563140737354415945593422946525211226319134399898) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.69304020144045352935791015625e-4), SC_(7.9570862305908154157502670767893857144258643910134) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.23264062474481761455535888671875e-3), SC_(2.3719155181483651140283794679798873388028215296304) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.4480001516640186309814453125e-3), SC_(1.2319894744844574970516920107312783189510124193957) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.5502865533344447612762451171875e-3), SC_(1.0030112034602294475985095364967567453689835477452) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.19227224402129650115966796875e-2), SC_(0.28638350069997314241293417948854845587335617752927) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.37370622158050537109375e-2), SC_(0.14602972396377771654216460801323111364027557644216) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.47696642577648162841796875e-2), SC_(0.11351290994319074087410492441665358190230772804358) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.1275280676782131195068359375e-1), SC_(0.037008791924439581267986370097571362280888733460166) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.20440109074115753173828125e-1), SC_(0.016870508777086141024636797643775059196570100354985) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.3429813683032989501953125e-1), SC_(-0.0009748286242877649280689834700793092180965082559188) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.96701286733150482177734375e-1), SC_(-0.042489525327810393709078101729898351459510301627119) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.159812271595001220703125e0), SC_(-0.076077771654874512175725382541977707974494001219809) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.297095477581024169921875e0), SC_(-0.1449016974533794537266458225037915821627831419956) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.77344071865081787109375e0), SC_(-0.35763606304629819698651497909483012152923309977282) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.1992881298065185546875e1), SC_(-0.57707668367484666209769235993304653592448524328446) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.3915013790130615234375e1), SC_(0.032803565971798883663621750338601798771900853737723) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.79858455657958984375e1), SC_(-0.23245627383271580403946117793068576486562704835183) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.1571910858154296875e2), SC_(-0.13747319597155377972477306724918905968623791762052) }}, {{ SC_(0.554432161152362823486328125e-3), SC_(0.31483119964599609375e2), SC_(0.092402972740382015495412561744044435050456817053477) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.553809732082299888134002685546875e-4), SC_(32.991155195510662374452228181394207719668827912585) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.69304020144045352935791015625e-4), SC_(26.374288085785808071594815766184735941437037668361) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.23264062474481761455535888671875e-3), SC_(7.8745670452285410777433428652060226596690838235756) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.4480001516640186309814453125e-3), SC_(4.0939888412516262352091077877368046329988231549179) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.5502865533344447612762451171875e-3), SC_(3.3341891189206161618889782248584501135265038836937) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.19227224402129650115966796875e-2), SC_(0.95560384937570815980175679166160209025653903976137) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.37370622158050537109375e-2), SC_(0.49090952938765514533182157874449576923325297005204) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.47696642577648162841796875e-2), SC_(0.38389476017333637199587327253156428168993195132975) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.1275280676782131195068359375e-1), SC_(0.138409389156362855297988849958748604218151741016) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.20440109074115753173828125e-1), SC_(0.080241816559198872765517481865392895830572812371149) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.3429813683032989501953125e-1), SC_(0.036892112652472221644586526213180260842441269686804) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.96701286733150482177734375e-1), SC_(-0.02887110612739140483997421990789250909295516887439) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.159812271595001220703125e0), SC_(-0.067685739169149094863754883494101630051701749161209) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.297095477581024169921875e0), SC_(-0.14016851381502971127112075638647269597367135444309) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.77344071865081787109375e0), SC_(-0.35556632184765282255617154328610427789832356622214) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.1992881298065185546875e1), SC_(-0.57684653674632859345467293924518112947171640665078) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.3915013790130615234375e1), SC_(0.031969124632149993427358514338814374853801046758595) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.79858455657958984375e1), SC_(-0.23212392987235794473256668897443830855028454545551) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.1571910858154296875e2), SC_(-0.13777498598113913007808999712256844131654804580519) }}, {{ SC_(0.186112499795854091644287109375e-2), SC_(0.31483119964599609375e2), SC_(0.092624697644537533475041370994881579560890987351129) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.553809732082299888134002685546875e-4), SC_(62.454904613305025985092541568718072298279856562443) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.69304020144045352935791015625e-4), SC_(49.947950666961749968398510500237745648681418603404) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.23264062474481761455535888671875e-3), SC_(14.944193661627905898455586863695741230110016599631) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.4480001516640186309814453125e-3), SC_(7.7784129572206297283822428686304106551362644795044) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.5502865533344447612762451171875e-3), SC_(6.3371526780999425820466081747816869557736781837329) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.19227224402129650115966796875e-2), SC_(1.820993665575078594500973453282200116278151251087) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.37370622158050537109375e-2), SC_(0.9377936281725870885241868271005730443425730711559) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.47696642577648162841796875e-2), SC_(0.73450867711905500446374700000456510885348368932524) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.1275280676782131195068359375e-1), SC_(0.27029553238094754272834952547486499293865621939941) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.20440109074115753173828125e-1), SC_(0.16278442505650975565354006872279918590899945301714) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.3429813683032989501953125e-1), SC_(0.086292944004707690950589840564950857129632612299699) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.96701286733150482177734375e-1), SC_(-0.01104782892769029720544801382986554239946069854045) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.159812271595001220703125e0), SC_(-0.05668535469393136238714153940266293419595207886607) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.297095477581024169921875e0), SC_(-0.13395208202148233977338620116710632764449019915955) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.77344071865081787109375e0), SC_(-0.35283962535090438998824674990498799699024494912424) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.1992881298065185546875e1), SC_(-0.57653944367953511466145604243653167683836799979183) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.3915013790130615234375e1), SC_(0.030868990724401199078667741038245477603972593270015) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.79858455657958984375e1), SC_(-0.23168428917079507517559801618314290273647233672929) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.1571910858154296875e2), SC_(-0.13817198405516350060106646524335248058260389189795) }}, {{ SC_(0.35840012133121490478515625e-2), SC_(0.31483119964599609375e2), SC_(0.092916436595105559391595180151309343563751077592049) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.553809732082299888134002685546875e-4), SC_(76.094037091452672841408919517251753935599130990416) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.69304020144045352935791015625e-4), SC_(60.86694014763617381883362484413204002437988483891) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.23264062474481761455535888671875e-3), SC_(18.229182783832605707598240444273148205330129326374) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.4480001516640186309814453125e-3), SC_(9.4933663212904445110802371668553605819628244021874) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.5502865533344447612762451171875e-3), SC_(7.7356648564267450544222554441272100183990241145299) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.19227224402129650115966796875e-2), SC_(2.2253316945948961542743895239623228539455376609079) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.37370622158050537109375e-2), SC_(1.1469531280898255753143802718054167596670751930758) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.47696642577648162841796875e-2), SC_(0.8987138042469555955140638448947036336020766497208) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.1275280676782131195068359375e-1), SC_(0.33222006268427673176001775575327506626793624720047) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.20440109074115753173828125e-1), SC_(0.20158797802098065441112035562918896779201063031557) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.3429813683032989501953125e-1), SC_(0.10954754542608689498762692934343451061816281331611) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.96701286733150482177734375e-1), SC_(-0.0026352030152986806285640288099372676975308652569059) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.159812271595001220703125e0), SC_(-0.051486300229518660533195827724135883555923546965981) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.297095477581024169921875e0), SC_(-0.13100921711901138238440294338076135399910977624865) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.77344071865081787109375e0), SC_(-0.35154547252275810168236545554332529311171223761341) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.1992881298065185546875e1), SC_(-0.57639213881628347984110125372663315128642382553447) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.3915013790130615234375e1), SC_(0.030346508334070453430651975727124470878861233027065) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.79858455657958984375e1), SC_(-0.23147490443190245853754535262108083070463877602731) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.1571910858154296875e2), SC_(-0.13836017664760414231270840005996432417492176750639) }}, {{ SC_(0.44022924266755580902099609375e-2), SC_(0.31483119964599609375e2), SC_(0.093054758085530830928594196942552871371673202587369) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.553809732082299888134002685546875e-4), SC_(238.40366837144969439786103525601379114477677307153) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.69304020144045352935791015625e-4), SC_(191.16712873573625819054755770058932780852989850252) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.23264062474481761455535888671875e-3), SC_(58.019648524540935308440305137519165694212527314843) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.4480001516640186309814453125e-3), SC_(30.43392563287949994188281672966817873020334162581) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.5502865533344447612762451171875e-3), SC_(24.85533168119730302852076771558049252631942520417) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.19227224402129650115966796875e-2), SC_(7.2510627068545058442709465549514403544652820845905) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.37370622158050537109375e-2), SC_(3.7677615674740978933153881013861943903635063551538) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.47696642577648162841796875e-2), SC_(2.962324331943341100101643624061007763061585442363) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.1275280676782131195068359375e-1), SC_(1.1197441963909279005647512732082270829583516807172) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.20440109074115753173828125e-1), SC_(0.69788572344937366417209880630068985545559719963545) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.3429813683032989501953125e-1), SC_(0.40883500813978713691656188814831957578718243471079) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.96701286733150482177734375e-1), SC_(0.10700157693081281268315564619716643090427720046237) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.159812271595001220703125e0), SC_(0.016686833954731293114143419204690913686819214571699) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.297095477581024169921875e0), SC_(-0.092124902842593660026469490242650431046031191860855) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.77344071865081787109375e0), SC_(-0.33423965946999394482766889004297913580285873083183) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.1992881298065185546875e1), SC_(-0.57432599769968961776379817247419230653628340804375) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.3915013790130615234375e1), SC_(0.023338620631847629186573253547315649793186094107388) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.79858455657958984375e1), SC_(-0.22862990513409971505075485840350294504759601811506) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.1571910858154296875e2), SC_(-0.1408624244371769854856489920229138227673726479075) }}, {{ SC_(0.153817795217037200927734375e-1), SC_(0.31483119964599609375e2), SC_(0.094895516987968244278180735467242514989968258763469) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.553809732082299888134002685546875e-4), SC_(401.03396568589946004426626518285877552588221703456) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.69304020144045352935791015625e-4), SC_(322.62287318261062067717298841026124993076998674488) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.23264062474481761455535888671875e-3), SC_(99.653154993389532146468468431109235573777170772011) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.4480001516640186309814453125e-3), SC_(52.772263261102197213931020894608318973782604772283) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.5502865533344447612762451171875e-3), SC_(43.227918910310427346951401482833588864302431474419) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.19227224402129650115966796875e-2), SC_(12.842688059620175274882027252980428180593090063375) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.37370622158050537109375e-2), SC_(6.7390274818843771110431882385099223900918335630655) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.47696642577648162841796875e-2), SC_(5.3179544066533640875307065878216351879107714339398) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.1275280676782131195068359375e-1), SC_(2.0435872586177536078792092041967345862250992458715) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.20440109074115753173828125e-1), SC_(1.2876735976248464722948927962724955876009337432191) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.3429813683032989501953125e-1), SC_(0.7695517710363719560199084953580644660557370801408) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.96701286733150482177734375e-1), SC_(0.24290377631717472590521846883415245818694289017361) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.159812271595001220703125e0), SC_(0.10235005529723907433661732235444859781219501249974) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.297095477581024169921875e0), SC_(-0.042435615294286794584933169804436673619316094085801) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.77344071865081787109375e0), SC_(-0.31153951624955756434303873284759634801131236594004) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.1992881298065185546875e1), SC_(-0.57134179001101895426174918063867092457941541295507) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.3915013790130615234375e1), SC_(0.014084292266465387671395167120939259589073512924039) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.79858455657958984375e1), SC_(-0.22476853968317214175668684393591069876083251260042) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.1571910858154296875e2), SC_(-0.14410426741350497805067959400220228144811652583962) }}, {{ SC_(0.298964977264404296875e-1), SC_(0.31483119964599609375e2), SC_(0.097284960842721393212129686759239789256691963503028) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.553809732082299888134002685546875e-4), SC_(471.37166027199904636448992655317335001891374159055) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.69304020144045352935791015625e-4), SC_(379.91116285051480646999270370930575306961149889076) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.23264062474481761455535888671875e-3), SC_(118.5284534444992075821831811768895269929912679192) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.4480001516640186309814453125e-3), SC_(63.108590829623409668728674133337195241661276845369) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.5502865533344447612762451171875e-3), SC_(51.782740477944861994269980994470261382762600222885) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.19227224402129650115966796875e-2), SC_(15.544268928226126013996693399734864212029429548413) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.37370622158050537109375e-2), SC_(8.201851891655569453083763318076996379118826086076) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.47696642577648162841796875e-2), SC_(6.4855739049686344648114313800340052759496043249306) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.1275280676782131195068359375e-1), SC_(2.5138871135928275926305029572436771696322567881157) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.20440109074115753173828125e-1), SC_(1.5916781747744183611274648494292175428501268833477) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.3429813683032989501953125e-1), SC_(0.95799797262309709141604993694108452124333919330399) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.96701286733150482177734375e-1), SC_(0.31579947123617941869611707561671330150093828419791) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.159812271595001220703125e0), SC_(0.14888173291743319960009767579178948429207967528609) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.297095477581024169921875e0), SC_(-0.015024472899673308434232353549495206900642161504769) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.77344071865081787109375e0), SC_(-0.29871719574571292554481591851730285072696777681315) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.1992881298065185546875e1), SC_(-0.5695170506150984259661777633403544300740993771699) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.3915013790130615234375e1), SC_(0.0088241564811086707700323604495282469314479926180765) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.79858455657958984375e1), SC_(-0.22252074121304244082814905021275049155573635418883) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.1571910858154296875e2), SC_(-0.14591516715942387781225219256610088658797868602279) }}, {{ SC_(0.381573140621185302734375e-1), SC_(0.31483119964599609375e2), SC_(0.098622081487985938170665823000958903932402318502123) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.553809732082299888134002685546875e-4), SC_(664.32533220017027254391971447388193587419000066854) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.69304020144045352935791015625e-4), SC_(543.14993593518730741749191498326451276400043639821) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.23264062474481761455535888671875e-3), SC_(183.08336288980652399978057154064375325217723169095) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.4480001516640186309814453125e-3), SC_(101.64612195822514506176998699703728506643345094973) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.5502865533344447612762451171875e-3), SC_(84.506782718783720410448144330858098521084558727765) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.19227224402129650115966796875e-2), SC_(27.478220778710823046480038139592344032974668283707) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.37370622158050537109375e-2), SC_(15.128612926718659706649583727766003486783508333581) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.47696642577648162841796875e-2), SC_(12.151610485805330583680296655400661422227790007773) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.1275280676782131195068359375e-1), SC_(5.0211988998270532788268629016500275009843181242807) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.20440109074115753173828125e-1), SC_(3.2833219226395894112637198307152793560437862511832) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.3429813683032989501953125e-1), SC_(2.0554845436111618577861954626046424038152843282732) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.96701286733150482177734375e-1), SC_(0.77926568698038937491970225128994882478930938769704) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.159812271595001220703125e0), SC_(0.45721448413953804880695655665538011048753399905673) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.297095477581024169921875e0), SC_(0.17595838820313970743143597894791134659072435368234) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.77344071865081787109375e0), SC_(-0.20234566166487137369485686737700596512087693740505) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.1992881298065185546875e1), SC_(-0.55245918030755774838887327767713821647691140899172) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.3915013790130615234375e1), SC_(-0.031569198201922343172110667422174391061517226818925) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.79858455657958984375e1), SC_(-0.2039691459012116792448785415127453560623250119731) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.1571910858154296875e2), SC_(-0.15904726852684046112032774465846226271684901212158) }}, {{ SC_(0.10202245414257049560546875e0), SC_(0.31483119964599609375e2), SC_(0.10837642621725891831814701112308531098361497776006) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.553809732082299888134002685546875e-4), SC_(571.56461253029527068669000527929821362358876374892) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.69304020144045352935791015625e-4), SC_(473.79891993387176204277266117549424341033534115977) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.23264062474481761455535888671875e-3), SC_(172.05485839720109929947386950671741510964174125916) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.4480001516640186309814453125e-3), SC_(99.451419236599843003505543369104449891542801629795) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.5502865533344447612762451171875e-3), SC_(83.734472657295616189146164005523297644578211848323) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.19227224402129650115966796875e-2), SC_(29.404772483993622542588632660044020277977277726233) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.37370622158050537109375e-2), SC_(16.864978089537872687292665548563751461942199756629) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.47696642577648162841796875e-2), SC_(13.751298647148757554892114002160659377601354266307) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.1275280676782131195068359375e-1), SC_(6.0380360220553402596187004316610073017626864386626) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.20440109074115753173828125e-1), SC_(4.0663497714573359019588027393685113619794756585739) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.3429813683032989501953125e-1), SC_(2.6316996446281341936928939605476135172192414133571) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.96701286733150482177734375e-1), SC_(1.0800675534525642651799516999243058856882873167878) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.159812271595001220703125e0), SC_(0.67608209128463307278540094735467713432457749748998) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.297095477581024169921875e0), SC_(0.32608584374570126390899798719606813371587094547022) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.77344071865081787109375e0), SC_(-0.11501166816312720077701173878978907536708382694762) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.1992881298065185546875e1), SC_(-0.5314728961847169395439663807244209484201806638345) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.3915013790130615234375e1), SC_(-0.069744289285064377675956918739400471810698462043296) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.79858455657958984375e1), SC_(-0.18428739558678179918427752660934248572747222415676) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.1571910858154296875e2), SC_(-0.1701631830918606829888917633341779466808057826876) }}, {{ SC_(0.163520872592926025390625e0), SC_(0.31483119964599609375e2), SC_(0.11673308889048171105260368484675293209410925971813) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.553809732082299888134002685546875e-4), SC_(308.58717356564466122617332899775649932714521649465) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.69304020144045352935791015625e-4), SC_(262.24338485799954579780263297984006371132805035765) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.23264062474481761455535888671875e-3), SC_(108.9140590822161623522014027028903621483296652945) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.4480001516640186309814453125e-3), SC_(67.698524590607803770047215956766889859219483667364) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.5502865533344447612762451171875e-3), SC_(58.314147078221691243234467406671269644673760065121) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.19227224402129650115966796875e-2), SC_(23.524741367197420763016782522906886655519879108938) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.37370622158050537109375e-2), SC_(14.524298936061566153087691391710501642546074047005) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.47696642577648162841796875e-2), SC_(12.167592249583090776182625308742942167019780554995) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.1275280676782131195068359375e-1), SC_(5.9591275776624168861248857531487249839683845595979) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.20440109074115753173828125e-1), SC_(4.2299993011890053254279767431385415972934287315434) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.3429813683032989501953125e-1), SC_(2.901983653662807706186712037814246852226231939235) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.96701286733150482177734375e-1), SC_(1.3496909380852439982995232509799172125294458203756) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.159812271595001220703125e0), SC_(0.91242525126551893446034914814532227010185508362973) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.297095477581024169921875e0), SC_(0.52064973039523048311960600009969390809510145563536) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.77344071865081787109375e0), SC_(0.02608182887713046998809955385365744878009456148488) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.1992881298065185546875e1), SC_(-0.48404394822521381052237521035874668152259518700201) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.3915013790130615234375e1), SC_(-0.13570201616386784215064959012924578121705433926688) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.79858455657958984375e1), SC_(-0.14498096948845041264536656900929936579020113377736) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.1571910858154296875e2), SC_(-0.18612546203267788136068772916555345383472834252897) }}, {{ SC_(0.27438509464263916015625e0), SC_(0.31483119964599609375e2), SC_(0.12899781806261234090869739907021396206645515298816) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.553809732082299888134002685546875e-4), SC_(4.5011877008533588406242902236972176812286396782147) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.69304020144045352935791015625e-4), SC_(4.2783592963711542722485419051158488559847591811376) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.23264062474481761455535888671875e-3), SC_(3.2524659231367346417319767900467632749684587310339) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.4480001516640186309814453125e-3), SC_(2.8040379463680128740339422361998161891966695531645) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.5502865533344447612762451171875e-3), SC_(2.6764851124726492809937356104371686943624485612184) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.19227224402129650115966796875e-2), SC_(2.0163238633002003883069078490143730782017724876012) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.37370622158050537109375e-2), SC_(1.7346779498572830113915766279181497675283514219914) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.47696642577648162841796875e-2), SC_(1.6414560048736575318308206797185026809228580164098) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.1275280676782131195068359375e-1), SC_(1.3137218795657822490779781671024980814327832331883) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.20440109074115753173828125e-1), SC_(1.180498075807418501180599163023571364750679628292) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.3429813683032989501953125e-1), SC_(1.0495646967259391880319945252197306235384421843019) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.96701286733150482177734375e-1), SC_(0.82660826007368357107844931444771102363686958247508) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.159812271595001220703125e0), SC_(0.731697482250621946652780569750887216236363899678) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.297095477581024169921875e0), SC_(0.61562951899129792899436180038485577042502506518948) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.77344071865081787109375e0), SC_(0.36903938849520530212100602283754257446521956733474) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.1992881298065185546875e1), SC_(-0.19291140031800296501062914346386249321856024518691) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.3915013790130615234375e1), SC_(-0.35154036868679467260867304469480385731081099786064) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.79858455657958984375e1), SC_(0.059788933964965057005597574789855169709617546272128) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.1571910858154296875e2), SC_(-0.18723724545953900368479270357924724748499087579889) }}, {{ SC_(0.773610293865203857421875e0), SC_(0.31483119964599609375e2), SC_(0.13400966478970684572882507496313188732146052204823) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.553809732082299888134002685546875e-4), SC_(0.029850558043384652101507429968555915143293202103747) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.69304020144045352935791015625e-4), SC_(0.031774415911652133140438383435382850754016739448122) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.23264062474481761455535888671875e-3), SC_(0.044519196152686710899624947084732057474064859756012) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.4480001516640186309814453125e-3), SC_(0.05343253965558058233007650357966646952486068878882) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.5502865533344447612762451171875e-3), SC_(0.056582050509995888920320047141538194664133884681765) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.19227224402129650115966796875e-2), SC_(0.080166705694688052505251448743101310730920964564891) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.37370622158050537109375e-2), SC_(0.096465313480839719026158485392665569685381937552601) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.47696642577648162841796875e-2), SC_(0.10324738754283731303233215056391131014396578323982) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.1275280676782131195068359375e-1), SC_(0.13577304320543918389355602959763206583957881062266) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.20440109074115753173828125e-1), SC_(0.15482474065003848502331515636750756782541403873783) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.3429813683032989501953125e-1), SC_(0.17879300147557342620703893492988364828644117397711) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.96701286733150482177734375e-1), SC_(0.23807839596703794694358205999845219045526959814198) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.159812271595001220703125e0), SC_(0.27258280278021451601361913139001300975146484153291) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.297095477581024169921875e0), SC_(0.3182433247889726108818474117334822562641936486915) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.77344071865081787109375e0), SC_(0.35683698469364376739850271914475103829253363482033) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.1992881298065185546875e1), SC_(0.070741464135753463004945635716734698943142968309161) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.3915013790130615234375e1), SC_(-0.39520273941287401008062462430234282654359660068325) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.79858455657958984375e1), SC_(0.22731076694710148914187566403459737901915531083197) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.1571910858154296875e2), SC_(-0.084753297042445161674776706201678874508373230926603) }}, {{ SC_(0.1278498172760009765625e1), SC_(0.31483119964599609375e2), SC_(0.062225090158300477948826393889918289525552791431653) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.553809732082299888134002685546875e-4), SC_(2.1701155503596191995420732909718061056519326940212e-07) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.69304020144045352935791015625e-4), SC_(2.9551306553591138969355587313633131125997108375235e-07) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.23264062474481761455535888671875e-3), SC_(1.5655037999064767060378816153887775846765797047542e-06) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.4480001516640186309814453125e-3), SC_(3.8589657176343035828125278487873301105081231582557e-06) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.5502865533344447612762451171875e-3), SC_(5.1218954522128421501593736983874506030386512416042e-06) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.19227224402129650115966796875e-2), SC_(2.8672424699646570395201270796019428364107586215741e-05) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.37370622158050537109375e-2), SC_(7.1584131269989352016160990684310779348068505393798e-05) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.47696642577648162841796875e-2), SC_(0.00010016008067897047409150409831104755079644144359547) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.1275280676782131195068359375e-1), SC_(0.00038790640527498589848030243407349786907898487932215) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.20440109074115753173828125e-1), SC_(0.00074264228806456515397818291416507336565139941621982) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.3429813683032989501953125e-1), SC_(0.0015143065765106452690160624557993131465970744618239) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.96701286733150482177734375e-1), SC_(0.0063022557752983131925389842798930716204158533142837) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.159812271595001220703125e0), SC_(0.012557870640894605088772791192937453429777750849756) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.297095477581024169921875e0), SC_(0.029237072013682764068068954048522330751472665213812) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.77344071865081787109375e0), SC_(0.10168572061348920979793506543435383085628690885422) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.1992881298065185546875e1), SC_(0.22002878862596836274705220424499496372405634108772) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.3915013790130615234375e1), SC_(-0.10735465363172394169227652967155355244369432964178) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.79858455657958984375e1), SC_(0.18557681844475882257368896788898742437796376971596) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.1571910858154296875e2), SC_(0.18371304256631794662900176415524300546583527613927) }}, {{ SC_(0.2376763820648193359375e1), SC_(0.31483119964599609375e2), SC_(-0.132794081024849303698958724423239291321967763688) }}, {{ SC_(0.618752574920654296875e1), SC_(0.553809732082299888134002685546875e-4), SC_(6.8618859334909328064313466022394478855895492126519e-27) }}, {{ SC_(0.618752574920654296875e1), SC_(0.69304020144045352935791015625e-4), SC_(2.1963286138774191146212025856359161441752536770309e-26) }}, {{ SC_(0.618752574920654296875e1), SC_(0.23264062474481761455535888671875e-3), SC_(1.1747834954200665458190549366081650771028030041504e-23) }}, {{ SC_(0.618752574920654296875e1), SC_(0.4480001516640186309814453125e-3), SC_(3.5179470865688125605246868941659466149519669762622e-22) }}, {{ SC_(0.618752574920654296875e1), SC_(0.5502865533344447612762451171875e-3), SC_(1.0223298989181615516658896945180863312854077986829e-21) }}, {{ SC_(0.618752574920654296875e1), SC_(0.19227224402129650115966796875e-2), SC_(6.7315860122034580871008571630351185332456357893131e-19) }}, {{ SC_(0.618752574920654296875e1), SC_(0.37370622158050537109375e-2), SC_(2.1149902345470196631249308634396410671647936549547e-17) }}, {{ SC_(0.618752574920654296875e1), SC_(0.47696642577648162841796875e-2), SC_(7.4983438891842891949410561775177614183558926276208e-17) }}, {{ SC_(0.618752574920654296875e1), SC_(0.1275280676782131195068359375e-1), SC_(1.2321058610359859670269189410586432608108543114872e-14) }}, {{ SC_(0.618752574920654296875e1), SC_(0.20440109074115753173828125e-1), SC_(1.4238028742033350327295610376208111939565068601957e-13) }}, {{ SC_(0.618752574920654296875e1), SC_(0.3429813683032989501953125e-1), SC_(2.0870108710052736709734956183853084596264302832559e-12) }}, {{ SC_(0.618752574920654296875e1), SC_(0.96701286733150482177734375e-1), SC_(4.5142628098260017065921905421191994854871890889804e-10) }}, {{ SC_(0.618752574920654296875e1), SC_(0.159812271595001220703125e0), SC_(6.1103562371576358382673002203839388993107168425553e-09) }}, {{ SC_(0.618752574920654296875e1), SC_(0.297095477581024169921875e0), SC_(1.519636746861460104553494708390828117800452172163e-07) }}, {{ SC_(0.618752574920654296875e1), SC_(0.77344071865081787109375e0), SC_(2.1237148222110387293617790655585931062215718762736e-05) }}, {{ SC_(0.618752574920654296875e1), SC_(0.1992881298065185546875e1), SC_(0.0024588707692055920796691283803993300690882442105627) }}, {{ SC_(0.618752574920654296875e1), SC_(0.3915013790130615234375e1), SC_(0.046142562971005864860944948899495431154518217952264) }}, {{ SC_(0.618752574920654296875e1), SC_(0.79858455657958984375e1), SC_(-0.036548537606470732421518346681033426360824355915209) }}, {{ SC_(0.618752574920654296875e1), SC_(0.1571910858154296875e2), SC_(-0.037440476178607689137062960891986908987275885225747) }}, {{ SC_(0.618752574920654296875e1), SC_(0.31483119964599609375e2), SC_(-0.053576073500905579152051157218411132644761366492076) }}, {{ SC_(0.15943050384521484375e2), SC_(0.553809732082299888134002685546875e-4), SC_(3.5053748870324995265456069209257845719284000016634e-81) }}, {{ SC_(0.15943050384521484375e2), SC_(0.69304020144045352935791015625e-4), SC_(1.0003578068450191800043421410644801174017783442525e-79) }}, {{ SC_(0.15943050384521484375e2), SC_(0.23264062474481761455535888671875e-3), SC_(7.2295444983737221812617930416172046668810632639086e-72) }}, {{ SC_(0.15943050384521484375e2), SC_(0.4480001516640186309814453125e-3), SC_(1.2935778727519334502228823307340051077028641833215e-67) }}, {{ SC_(0.15943050384521484375e2), SC_(0.5502865533344447612762451171875e-3), SC_(2.7949076296376557021885976463896668140336092550744e-66) }}, {{ SC_(0.15943050384521484375e2), SC_(0.19227224402129650115966796875e-2), SC_(3.6757041380152731439397127857389554537960795984033e-58) }}, {{ SC_(0.15943050384521484375e2), SC_(0.37370622158050537109375e-2), SC_(7.5528355643960719116071021399542489454669220709129e-54) }}, {{ SC_(0.15943050384521484375e2), SC_(0.47696642577648162841796875e-2), SC_(2.8935963637630571857817897238455867910507638566588e-52) }}, {{ SC_(0.15943050384521484375e2), SC_(0.1275280676782131195068359375e-1), SC_(6.9804316898025259378717377799203520816940258467987e-46) }}, {{ SC_(0.15943050384521484375e2), SC_(0.20440109074115753173828125e-1), SC_(8.0421875393174843026599169482683520199102109359004e-43) }}, {{ SC_(0.15943050384521484375e2), SC_(0.3429813683032989501953125e-1), SC_(1.8381331544029745344694037671121786066061079707414e-39) }}, {{ SC_(0.15943050384521484375e2), SC_(0.96701286733150482177734375e-1), SC_(9.7973210467711664664952969673463280706045049213375e-33) }}, {{ SC_(0.15943050384521484375e2), SC_(0.159812271595001220703125e0), SC_(1.7833373802207954525116645092242418737555089885756e-29) }}, {{ SC_(0.15943050384521484375e2), SC_(0.297095477581024169921875e0), SC_(1.8824962469467906426300941758297149966409708294099e-25) }}, {{ SC_(0.15943050384521484375e2), SC_(0.77344071865081787109375e0), SC_(3.0224248046138209957759204404908493425528586816012e-19) }}, {{ SC_(0.15943050384521484375e2), SC_(0.1992881298065185546875e1), SC_(3.9661637521587291221956898563816149044021936980709e-13) }}, {{ SC_(0.15943050384521484375e2), SC_(0.3915013790130615234375e1), SC_(7.9002899016129279712962003653587507151377945199827e-09) }}, {{ SC_(0.15943050384521484375e2), SC_(0.79858455657958984375e1), SC_(0.00014361841243492096755775570171774438376661025382511) }}, {{ SC_(0.15943050384521484375e2), SC_(0.1571910858154296875e2), SC_(0.062984203221968378735689416171937661262267669219313) }}, {{ SC_(0.15943050384521484375e2), SC_(0.31483119964599609375e2), SC_(0.048726541788000567271971666259984984863708245546479) }}, {{ SC_(0.31320110321044921875e2), SC_(0.553809732082299888134002685546875e-4), SC_(4.0775347617763827917636312558685682614460296107351e-172) }}, {{ SC_(0.31320110321044921875e2), SC_(0.69304020144045352935791015625e-4), SC_(3.6602525887553747946846569939947031192010308649901e-169) }}, {{ SC_(0.31320110321044921875e2), SC_(0.23264062474481761455535888671875e-3), SC_(3.2335500910719629265098050470900045320840646714859e-153) }}, {{ SC_(0.31320110321044921875e2), SC_(0.4480001516640186309814453125e-3), SC_(1.375811039138230237509060754300309226643944989626e-144) }}, {{ SC_(0.31320110321044921875e2), SC_(0.5502865533344447612762451171875e-3), SC_(7.0221526672657324482881656358705892542540431557517e-142) }}, {{ SC_(0.31320110321044921875e2), SC_(0.19227224402129650115966796875e-2), SC_(2.0903831170965663042808465354655697911514904752221e-125) }}, {{ SC_(0.31320110321044921875e2), SC_(0.37370622158050537109375e-2), SC_(1.1776766990907131544102457790255832296878257403093e-116) }}, {{ SC_(0.31320110321044921875e2), SC_(0.47696642577648162841796875e-2), SC_(1.9216247227927533544279814467673995609976280557166e-113) }}, {{ SC_(0.31320110321044921875e2), SC_(0.1275280676782131195068359375e-1), SC_(1.7136891099016486824251149584090773081176918430606e-100) }}, {{ SC_(0.31320110321044921875e2), SC_(0.20440109074115753173828125e-1), SC_(2.7914984872320211168187337887690887640432614280739e-94) }}, {{ SC_(0.31320110321044921875e2), SC_(0.3429813683032989501953125e-1), SC_(1.8256226510148527935317893516684443597280757769692e-87) }}, {{ SC_(0.31320110321044921875e2), SC_(0.96701286733150482177734375e-1), SC_(8.1345764464977027290798421463540075558737704545228e-74) }}, {{ SC_(0.31320110321044921875e2), SC_(0.159812271595001220703125e0), SC_(3.3531596261917949046621108542546348529678441385801e-67) }}, {{ SC_(0.31320110321044921875e2), SC_(0.297095477581024169921875e0), SC_(4.8978868001918715331354461307339987339721794255557e-59) }}, {{ SC_(0.31320110321044921875e2), SC_(0.77344071865081787109375e0), SC_(1.9370088688037995439389481817923380471357651000902e-46) }}, {{ SC_(0.31320110321044921875e2), SC_(0.1992881298065185546875e1), SC_(5.4737238540903762602781816763163779144308589723619e-34) }}, {{ SC_(0.31320110321044921875e2), SC_(0.3915013790130615234375e1), SC_(3.881678194319896190940421213131620834895771313082e-25) }}, {{ SC_(0.31320110321044921875e2), SC_(0.79858455657958984375e1), SC_(6.3193787632639199392093155246439027531457067096666e-16) }}, {{ SC_(0.31320110321044921875e2), SC_(0.1571910858154296875e2), SC_(1.0757417878047579347014714535384238216124501720368e-07) }}, {{ SC_(0.31320110321044921875e2), SC_(0.31483119964599609375e2), SC_(0.040110799787632381784207142268257697341685918101293) }}, {{ SC_(0.638867645263671875e2), SC_(0.553809732082299888134002685546875e-4), SC_(9.7441627699885499410827511483200119322124780648042e-375) }}, {{ SC_(0.638867645263671875e2), SC_(0.69304020144045352935791015625e-4), SC_(1.2995106109464785944326424074902975173100812521663e-368) }}, {{ SC_(0.638867645263671875e2), SC_(0.23264062474481761455535888671875e-3), SC_(1.5404062639522853160415873118716407582565237381265e-335) }}, {{ SC_(0.638867645263671875e2), SC_(0.4480001516640186309814453125e-3), SC_(1.2154677714932701807701788654862612084731965495875e-317) }}, {{ SC_(0.638867645263671875e2), SC_(0.5502865533344447612762451171875e-3), SC_(5.0258196383445896775189854678057167837900551572717e-312) }}, {{ SC_(0.638867645263671875e2), SC_(0.19227224402129650115966796875e-2), SC_(7.4016350970405039598626088642455006858620983926416e-278) }}, {{ SC_(0.638867645263671875e2), SC_(0.37370622158050537109375e-2), SC_(1.0454698907387783780995294442636270647131473144215e-259) }}, {{ SC_(0.638867645263671875e2), SC_(0.47696642577648162841796875e-2), SC_(4.8154258474909796291892217560161879062331113459005e-253) }}, {{ SC_(0.638867645263671875e2), SC_(0.1275280676782131195068359375e-1), SC_(3.4890053812228262365551933998185601135755662319548e-226) }}, {{ SC_(0.638867645263671875e2), SC_(0.20440109074115753173828125e-1), SC_(2.6716519485260519907154162062382147851855142100751e-213) }}, {{ SC_(0.638867645263671875e2), SC_(0.3429813683032989501953125e-1), SC_(3.6553234108502009052689983290899255876096233293036e-199) }}, {{ SC_(0.638867645263671875e2), SC_(0.96701286733150482177734375e-1), SC_(7.4494817279246493182746623255291237577365435287533e-171) }}, {{ SC_(0.638867645263671875e2), SC_(0.159812271595001220703125e0), SC_(3.9137994342944840648848064301593067243483912784954e-157) }}, {{ SC_(0.638867645263671875e2), SC_(0.297095477581024169921875e0), SC_(3.3651957455367603520477072956196864467681836841573e-140) }}, {{ SC_(0.638867645263671875e2), SC_(0.77344071865081787109375e0), SC_(4.5449584997779609452485892006864158282660967869106e-114) }}, {{ SC_(0.638867645263671875e2), SC_(0.1992881298065185546875e1), SC_(3.1738690593564315149084568119212749276724766074797e-88) }}, {{ SC_(0.638867645263671875e2), SC_(0.3915013790130615234375e1), SC_(8.3876764286771252132826802696540899650253274908687e-70) }}, {{ SC_(0.638867645263671875e2), SC_(0.79858455657958984375e1), SC_(2.0360585647990444278788749162236601635563310041312e-50) }}, {{ SC_(0.638867645263671875e2), SC_(0.1571910858154296875e2), SC_(3.0526073572369540920510993833683057297997072099125e-32) }}, {{ SC_(0.638867645263671875e2), SC_(0.31483119964599609375e2), SC_(1.3013718253615034389340624948143462041150530900802e-14) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.553809732082299888134002685546875e-4), SC_(-8.0352542252744082481307789764332850495725489505518) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.69304020144045352935791015625e-4), SC_(-6.4203614240557396975159598870215603286914369267472) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.23264062474481761455535888671875e-3), SC_(-1.9117166148811325766281752377913954732416206414629) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.4480001516640186309814453125e-3), SC_(-0.99260548284661030715869392644415963191732106033528) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.5502865533344447612762451171875e-3), SC_(-0.80812102308096530154610129316254886762601435421338) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.19227224402129650115966796875e-2), SC_(-0.23204280558098084511900377653875824621676552518528) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.37370622158050537109375e-2), SC_(-0.12072881073365528081110447354284280286097688241442) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.47696642577648162841796875e-2), SC_(-0.09550482234825882986471274711567749300336105446854) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.1275280676782131195068359375e-1), SC_(-0.041200536588552429584692663160666456452528166189948) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.20440109074115753173828125e-1), SC_(-0.031953857997720357584406329160755725345223306098128) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.3429813683032989501953125e-1), SC_(-0.030114397251918849407455448148697810176670467012896) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.96701286733150482177734375e-1), SC_(-0.052943922496156634733598654692054268878542225130523) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.159812271595001220703125e0), SC_(-0.082512406889389859121119964777034049609087542474697) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.297095477581024169921875e0), SC_(-0.1485255232855737930936769690388900259610771996183) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.77344071865081787109375e0), SC_(-0.35921701000936262458882788686129315404924380806201) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.1992881298065185546875e1), SC_(-0.57725076140254553359619035776337545293419911217499) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.3915013790130615234375e1), SC_(0.03344057878006016634512803472601346746069423389441) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.79858455657958984375e1), SC_(-0.23270933528743421315094393225058324641266170812782) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.1571910858154296875e2), SC_(-0.13724241991231743790482116318841294154717999058952) }}, {{ SC_(-0.4430477856658399105072021484375e-3), SC_(0.31483119964599609375e2), SC_(0.09223345027076750470936443925038834150827279095626) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.553809732082299888134002685546875e-4), SC_(-10.066461933961981507792651012082779846170093092464) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.69304020144045352935791015625e-4), SC_(-8.0431411620505830001205801846984349465397924171235) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.23264062474481761455535888671875e-3), SC_(-2.3945631396997411883835874017501010814598653177206) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.4480001516640186309814453125e-3), SC_(-1.24317801002101410502924982177759462923499541887) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.5502865533344447612762451171875e-3), SC_(-1.0120758401869629091718060378244288438918105198374) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.19227224402129650115966796875e-2), SC_(-0.290343027908152859987594626260946647758968814052) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.37370622158050537109375e-2), SC_(-0.15070540484639218955142273115487939108948046279471) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.47696642577648162841796875e-2), SC_(-0.11898654024366730550988334200337880054318356808187) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.1275280676782131195068359375e-1), SC_(-0.0499772596852495244874245461700334882818390416664) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.20440109074115753173828125e-1), SC_(-0.037430108063425835799519590547664772219450450501968) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.3429813683032989501953125e-1), SC_(-0.033380876891004635328352864168353940029550374102897) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.96701286733150482177734375e-1), SC_(-0.054114477302162225953130009474375517188926951365292) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.159812271595001220703125e0), SC_(-0.083232467669685253061367673958149012193392848388591) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.297095477581024169921875e0), SC_(-0.14893075527015439332896904430547462629618745403482) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.77344071865081787109375e0), SC_(-0.35939360026382634840654742706922579497977841714828) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.1992881298065185546875e1), SC_(-0.57727011342927087551404477979110589721068173726712) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.3915013790130615234375e1), SC_(0.033511712938247184637368117516909474935042592541487) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.79858455657958984375e1), SC_(-0.23273755930250967807670274825488612930894587031682) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.1571910858154296875e2), SC_(-0.1372166286029628510440359619069144703727812571868) }}, {{ SC_(-0.554432161152362823486328125e-3), SC_(0.31483119964599609375e2), SC_(0.092214506134989611076380630559393619074408058160705) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.553809732082299888134002685546875e-4), SC_(-34.23181462635478507822028182175431717667781372624) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.69304020144045352935791015625e-4), SC_(-27.343305234815061782266099942561415206187905358958) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.23264062474481761455535888671875e-3), SC_(-8.1273848706336958801247737688897901209292092021741) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.4480001516640186309814453125e-3), SC_(-4.2154668275747577532914376948639503328977697483243) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.5502865533344447612762451171875e-3), SC_(-3.4306834084062242073710579346983737042959836829079) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.19227224402129650115966796875e-2), SC_(-0.98047811481492919485194315319699114598506569880073) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.37370622158050537109375e-2), SC_(-0.50522334567765460611684549984928050137085344804579) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.47696642577648162841796875e-2), SC_(-0.39659709058903377385769093723835590470045000851205) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.1275280676782131195068359375e-1), SC_(-0.15359498622072033524837235497894371364376142666273) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.20440109074115753173828125e-1), SC_(-0.10203933275007621452849842412025700533200021422624) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.3429813683032989501953125e-1), SC_(-0.071890730780152667728329364548984000561104628670664) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.96701286733150482177734375e-1), SC_(-0.067894161135302898753927696333004765903404565336037) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.159812271595001220703125e0), SC_(-0.091702795042273366918864368933079051253776349615004) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.297095477581024169921875e0), SC_(-0.15369330938238308353603724941747339435790440319313) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.77344071865081787109375e0), SC_(-0.36146603204720034107470261596786851111539114117332) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.1992881298065185546875e1), SC_(-0.57749584025045821649519328067660040724951358425785) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.3915013790130615234375e1), SC_(0.034346238192839986437454661389726380162962796912464) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.79858455657958984375e1), SC_(-0.23306815103996906158022747899333186165145736610782) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.1571910858154296875e2), SC_(-0.13691373838339331226340502813220267438067995036718) }}, {{ SC_(-0.186112499795854091644287109375e-2), SC_(0.31483119964599609375e2), SC_(0.0919920513180825947021514188521270090148213581859) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.553809732082299888134002685546875e-4), SC_(-67.056271870501367994225299855943649508994694008781) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.69304020144045352935791015625e-4), SC_(-53.54175363140112840600408722647405310378615327513) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.23264062474481761455535888671875e-3), SC_(-15.881207988567703715841269602542397948644528477246) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.4480001516640186309814453125e-3), SC_(-8.2277264602230928321577393634479731870258896542248) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.5502865533344447612762451171875e-3), SC_(-6.6935299793980016595106177046127151318109557942752) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.19227224402129650115966796875e-2), SC_(-1.9080343185556542996070263658766565867706699008104) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.37370622158050537109375e-2), SC_(-0.98075508769550439856427681584737488373549344454508) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.47696642577648162841796875e-2), SC_(-0.76869690974782950106133359949158417619515396821915) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.1275280676782131195068359375e-1), SC_(-0.29207097823754910281828673784976328503050496866988) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.20440109074115753173828125e-1), SC_(-0.18826130081197235022050368628059551681437423139242) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.3429813683032989501953125e-1), SC_(-0.12320242306806411399618773723522603088969456177809) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.96701286733150482177734375e-1), SC_(-0.086196741643040794918353323989169170469643966496374) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.159812271595001220703125e0), SC_(-0.10293588278606317172915919860376209690449043973811) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.297095477581024169921875e0), SC_(-0.15999703383708213928376998492609103192731212394886) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.77344071865081787109375e0), SC_(-0.36420072514576095375697021685081027415781263362758) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.1992881298065185546875e1), SC_(-0.5777897961065323135784411639495384785398961081964) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.3915013790130615234375e1), SC_(0.035446621494767570487811034376588469298122718716537) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.79858455657958984375e1), SC_(-0.23350258387760681986463355584579626915696673116663) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.1571910858154296875e2), SC_(-0.13651347032628514403227301964467648017065563110308) }}, {{ SC_(-0.35840012133121490478515625e-2), SC_(0.31483119964599609375e2), SC_(0.091698142960977290200573339181083827107643995436865) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.553809732082299888134002685546875e-4), SC_(-83.037093324551699684264024514810856743180212901972) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.69304020144045352935791015625e-4), SC_(-66.289631714700939041160686151256998148675866512178) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.23264062474481761455535888671875e-3), SC_(-19.642901163509752389779868654081295474333346675263) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.4480001516640186309814453125e-3), SC_(-10.171088008319663671664133300271419189326470432375) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.5502865533344447612762451171875e-3), SC_(-8.2731052285936332381740047283964449451220912606779) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.19227224402129650115966796875e-2), SC_(-2.3556822683937317247313924442328408419058805410856) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.37370622158050537109375e-2), SC_(-1.2098723277414120717362840825349623627912664595916) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.47696642577648162841796875e-2), SC_(-0.9478703513414677389752274599534819040946861477237) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.1275280676782131195068359375e-1), SC_(-0.35858625576974802550691928581679940729588638492127) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.20440109074115753173828125e-1), SC_(-0.22962801236819251757397379209933685966997055419062) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.3429813683032989501953125e-1), SC_(-0.14778817682245036702917674194825307709095027340792) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.96701286733150482177734375e-1), SC_(-0.094943256228300421415696973236887828585507524283866) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.159812271595001220703125e0), SC_(-0.10829704020665712735091858934626890105404920145588) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.297095477581024169921875e0), SC_(-0.16300070709542560570938729145871767601360179849028) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.77344071865081787109375e0), SC_(-0.3655004483031575939694898478341350666944952239863) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.1992881298065185546875e1), SC_(-0.57792794944990254997704488561736555219857438938245) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.3915013790130615234375e1), SC_(0.035969277603863220159373882638485036321550606702405) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.79858455657958984375e1), SC_(-0.23370834076421522509139405806963960754726703194536) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.1571910858154296875e2), SC_(-0.13632299983189670750128563440512332933275681273293) }}, {{ SC_(-0.44022924266755580902099609375e-2), SC_(0.31483119964599609375e2), SC_(0.091558310240599352987648819858958500654626497622027) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.553809732082299888134002685546875e-4), SC_(-323.45213945463234229013889680154351663561974016062) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.69304020144045352935791015625e-4), SC_(-257.58113725156369155776353286297851561131398667063) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.23264062474481761455535888671875e-3), SC_(-75.317853600830156764876591365747013181276745596686) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.4480001516640186309814453125e-3), SC_(-38.719511928695320833962932311070646235997196088527) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.5502865533344447612762451171875e-3), SC_(-31.422940951603923960515705608615289434032537674218) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.19227224402129650115966796875e-2), SC_(-8.8228739279443535003892578553342007432481062429613) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.37370622158050537109375e-2), SC_(-4.494723735604328765849150940140384573461736537374) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.47696642577648162841796875e-2), SC_(-3.5094625015210048661409444547047934231422637263711) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.1275280676782131195068359375e-1), SC_(-1.2987840043766237769332520032909456200005454056879) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.20440109074115753173828125e-1), SC_(-0.81115532009477097779611346576000499612899829740578) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.3429813683032989501953125e-1), SC_(-0.49133226391051353605553180300057321370516441349176) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.96701286733150482177734375e-1), SC_(-0.2156781193538221291294131700670540860931335417735) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.159812271595001220703125e0), SC_(-0.18185780425851551020497584257730950378764999765613) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.297095477581024169921875e0), SC_(-0.20390584764589693945869205722862488999236954450902) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.77344071865081787109375e0), SC_(-0.38299131775239725628819178645949094448183644930876) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.1992881298065185546875e1), SC_(-0.57968991614193627415054042875367289442368646934083) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.3915013790130615234375e1), SC_(0.042982933758334960569313811710720824706658812629693) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.79858455657958984375e1), SC_(-0.23643275937887443493821264201271578938035690601526) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.1571910858154296875e2), SC_(-0.13374504140868466884225855542680423136816728178356) }}, {{ SC_(-0.153817795217037200927734375e-1), SC_(0.31483119964599609375e2), SC_(0.089667322440366316066610578376619970625122122450226) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.553809732082299888134002685546875e-4), SC_(-725.60388812634502116497577581096174464417453225645) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.69304020144045352935791015625e-4), SC_(-575.95680685121341045918860034843655536920144089988) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.23264062474481761455535888671875e-3), SC_(-165.47781280790728282138565486596148860048073676555) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.4480001516640186309814453125e-3), SC_(-84.263583652514398857809003219385428308331914261355) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.5502865533344447612762451171875e-3), SC_(-68.180449557757530865047254894621656951671344565923) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.19227224402129650115966796875e-2), SC_(-18.798084691116705356273612415274160601829996663749) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.37370622158050537109375e-2), SC_(-9.4830284139916943844187972919233437926322988775231) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.47696642577648162841796875e-2), SC_(-7.3771153920678228700152931806394953960549947325041) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.1275280676782131195068359375e-1), SC_(-2.6855256727116933276782927513072232408947873802069) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.20440109074115753173828125e-1), SC_(-1.659202091637520422183682309841553410776457852149) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.3429813683032989501953125e-1), SC_(-0.98607609795233336610497632483947698925553853348121) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.96701286733150482177734375e-1), SC_(-0.38515834407554964739621903400858160980698817286248) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.159812271595001220703125e0), SC_(-0.28381588884959607872655877768989540276971009686577) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.297095477581024169921875e0), SC_(-0.25970485572060694094796989362887049565598977652468) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.77344071865081787109375e0), SC_(-0.40625023849997096854581923443441253397060457051724) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.1992881298065185546875e1), SC_(-0.58175396157051217096634558063818100887320516756666) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.3915013790130615234375e1), SC_(0.052254646856877522738100400866085077989749826572634) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.79858455657958984375e1), SC_(-0.23992935887127384086006384290591685783732754240095) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.1571910858154296875e2), SC_(-0.13027418083029205026658210487081901945580698823601) }}, {{ SC_(-0.298964977264404296875e-1), SC_(0.31483119964599609375e2), SC_(0.087125939160498837675593513567607234396386781832874) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.553809732082299888134002685546875e-4), SC_(-1004.6859486021017541023203743332692346106393511949) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.69304020144045352935791015625e-4), SC_(-796.00547333588938545445386365357077325403216751374) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.23264062474481761455535888671875e-3), SC_(-226.42336780202248510553958166136698643505130141032) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.4480001516640186309814453125e-3), SC_(-114.67538358156769735145875983000068890294406176426) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.5502865533344447612762451171875e-3), SC_(-92.630113579906723071779947466604561257835459190343) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.19227224402129650115966796875e-2), SC_(-25.276228587228107324012897838280646226306407820917) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.37370622158050537109375e-2), SC_(-12.680763595940505459347521762950057239490506764601) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.47696642577648162841796875e-2), SC_(-9.8445493267327168890329951149142804596902310323753) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.1275280676782131195068359375e-1), SC_(-3.5529657578107153662393107250209547708707297913846) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.20440109074115753173828125e-1), SC_(-2.1845957832490827861233138950362163012593492434232) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.3429813683032989501953125e-1), SC_(-1.289323015773201826960839436618104305738849066685) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.96701286733150482177734375e-1), SC_(-0.486777735591057263230139625364066590512939127167) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.159812271595001220703125e0), SC_(-0.34427980661032442140812840139010665226749007184295) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.297095477581024169921875e0), SC_(-0.29233716519329701131207248408313295340191228187593) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.77344071865081787109375e0), SC_(-0.41954921569620798110383102549818658320238954428757) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.1992881298065185546875e1), SC_(-0.58279172954206145900906677183569582602038176823114) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.3915013790130615234375e1), SC_(0.05752957287882339804261284805013815435471324917482) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.79858455657958984375e1), SC_(-0.2418651953573152386189066686655477217073650188379) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.1571910858154296875e2), SC_(-0.12826743181414229865637491792217895852855237873308) }}, {{ SC_(-0.381573140621185302734375e-1), SC_(0.31483119964599609375e2), SC_(0.085658882263130460924983003926708821343532049465639) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.553809732082299888134002685546875e-4), SC_(-5021.4388835985321077822197612494180215228611508713) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.69304020144045352935791015625e-4), SC_(-3921.8734307134052994591437509299821025250295550788) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.23264062474481761455535888671875e-3), SC_(-1032.5478352822006422528531545457632557402051621165) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.4480001516640186309814453125e-3), SC_(-501.51400874744938819546320667109536265200736389128) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.5502865533344447612762451171875e-3), SC_(-399.8166333544894648442811208436079709080356432968) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.19227224402129650115966796875e-2), SC_(-100.71848232122494924067861671571417782212617327175) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.37370622158050537109375e-2), SC_(-48.425426594435213772677350265517725377950510169043) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.47696642577648162841796875e-2), SC_(-37.01056268120809544427519087487383951231992638864) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.1275280676782131195068359375e-1), SC_(-12.529870507977695417379290742548380462554156354031) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.20440109074115753173828125e-1), SC_(-7.4600218209139626431874029585042163259340745663875) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.3429813683032989501953125e-1), SC_(-4.2336827459776509543039633593470530591144486647929) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.96701286733150482177734375e-1), SC_(-1.4076911758039395419438678561352416140994516102487) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.159812271595001220703125e0), SC_(-0.87364245158685752884071312682168379947181270610304) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.297095477581024169921875e0), SC_(-0.56581981271073774131848134488035157368952382106283) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.77344071865081787109375e0), SC_(-0.52334641335918569867220708820460190469418647348557) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.1992881298065185546875e1), SC_(-0.58733582447097000423159278592022563252973067325037) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.3915013790130615234375e1), SC_(0.098148426611487347492824812034647890766195227954355) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.79858455657958984375e1), SC_(-0.25545685118167396706373254697883910424384005529709) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.1571910858154296875e2), SC_(-0.11202340417340619861504442217252110116788114834578) }}, {{ SC_(-0.10202245414257049560546875e0), SC_(0.31483119964599609375e2), SC_(0.073839678247298834355739968654379935792127228391286) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.553809732082299888134002685546875e-4), SC_(-14591.064213061089165837423518828097507666158372983) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.69304020144045352935791015625e-4), SC_(-11239.902564268926556604507173940790761066763746957) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.23264062474481761455535888671875e-3), SC_(-2746.8530583911553657584614056005107923329244981864) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.4480001516640186309814453125e-3), SC_(-1281.4633935425504671800390512188925490804517939886) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.5502865533344447612762451171875e-3), SC_(-1008.7683405233342969507420679482719911493815317167) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.19227224402129650115966796875e-2), SC_(-235.30073204152926713716247008806375707592231157316) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.37370622158050537109375e-2), SC_(-108.60007981381217337152204100307858589475338051002) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.47696642577648162841796875e-2), SC_(-81.76344982413764784378525698316628482243640292672) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.1275280676782131195068359375e-1), SC_(-26.049679340717903315713103086676133509501408128064) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.20440109074115753173828125e-1), SC_(-15.058953341128067901598825812053678646049489146363) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.3429813683032989501953125e-1), SC_(-8.2670895889416687400487118206671710803622383007887) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.96701286733150482177734375e-1), SC_(-2.5425726441082783539097226104706324323282907944463) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.159812271595001220703125e0), SC_(-1.4914567252730700937853154883220220116181475377399) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.297095477581024169921875e0), SC_(-0.8632725176533903359858477333142360141675842731196) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.77344071865081787109375e0), SC_(-0.6234292886729097644681651354134756448566678345503) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.1992881298065185546875e1), SC_(-0.58558610668515311817834536848864645073035983132359) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.3915013790130615234375e1), SC_(0.13668651414168138934340967404720630620976656638158) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.79858455657958984375e1), SC_(-0.26612983518078324262431516120429976552320108816765) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.1571910858154296875e2), SC_(-0.095264523648592787444884232574176294732450669999133) }}, {{ SC_(-0.163520872592926025390625e0), SC_(0.31483119964599609375e2), SC_(0.06173752066484881976914818698955446252942030874574) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.553809732082299888134002685546875e-4), SC_(-70055.006417124017455883308196763018161565032369383) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.69304020144045352935791015625e-4), SC_(-52640.113594817198684386936391750444029168036133061) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.23264062474481761455535888671875e-3), SC_(-11248.203674019324536337199438466846592947765997285) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.4480001516640186309814453125e-3), SC_(-4879.8080035283893388040441594092795260474557634959) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.5502865533344447612762451171875e-3), SC_(-3754.7978085981910388267899865471598402118360736627) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.19227224402129650115966796875e-2), SC_(-762.39674662423880098867949611441126696630528369554) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.37370622158050537109375e-2), SC_(-326.87797411097895366160065584324895997801172344437) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.47696642577648162841796875e-2), SC_(-239.53186080281830983579670418013199291682381608593) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.1275280676782131195068359375e-1), SC_(-68.419850156793746757830431816786088124775866273892) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.20440109074115753173828125e-1), SC_(-37.525744669245238756963541430758905495168843320176) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.3429813683032989501953125e-1), SC_(-19.434623426150950622526401338014245375205379266868) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.96701286733150482177734375e-1), SC_(-5.278256043476905240140508445981318287783880252522) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.159812271595001220703125e0), SC_(-2.8777308956382304556048192286347294935922191210744) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.297095477581024169921875e0), SC_(-1.4710226796697763010123257766717571882497401271846) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.77344071865081787109375e0), SC_(-0.79642432308663174707004503487712244732812484279319) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.1992881298065185546875e1), SC_(-0.56612269402057352361688016332508188545049675733684) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.3915013790130615234375e1), SC_(0.20336091423685768783909328601206788571790985202848) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.79858455657958984375e1), SC_(-0.27894883313028255267330235996664759672024535305973) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.1571910858154296875e2), SC_(-0.062780398462795947357271687241684592413572950434451) }}, {{ SC_(-0.27438509464263916015625e0), SC_(0.31483119964599609375e2), SC_(0.03849732252340896827395694578850472049659073379106) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.553809732082299888134002685546875e-4), SC_(-11643371.160466587585669407134435084427919016477159) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.69304020144045352935791015625e-4), SC_(-7822272.1898300553801367114473307038320493340483874) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.23264062474481761455535888671875e-3), SC_(-913152.25026118026767706305376317815062318601678415) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.4480001516640186309814453125e-3), SC_(-285618.89217363187058048532649939516725880162268906) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.5502865533344447612762451171875e-3), SC_(-198328.24134808742495322686233204368763113096517048) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.19227224402129650115966796875e-2), SC_(-21564.309161499202266153010760285217055861424115293) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.37370622158050537109375e-2), SC_(-6635.2160485548545867927262596655119927287446001148) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.47696642577648162841796875e-2), SC_(-4304.6165067879596667544757848951548833552069326892) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.1275280676782131195068359375e-1), SC_(-752.48867462527562508752217575030123403028930518054) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.20440109074115753173828125e-1), SC_(-326.07771358935044259815120056192030387572987185451) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.3429813683032989501953125e-1), SC_(-130.38021269958001460550773617540933755870967270791) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.96701286733150482177734375e-1), SC_(-21.03494823343058616292489481214304589704518288651) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.159812271595001220703125e0), SC_(-8.8677490983754768902167272470145959243449594675605) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.297095477581024169921875e0), SC_(-3.2536197142376517989250287598790633341464382798799) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.77344071865081787109375e0), SC_(-0.97659448586055620157617924635446593965742594980785) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.1992881298065185546875e1), SC_(-0.20809799037495579932186690745545983420313992822374) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.3915013790130615234375e1), SC_(0.39703968367637254438174957792930593034151463586959) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.79858455657958984375e1), SC_(-0.22554028330521586002605540735602991496631898015283) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.1571910858154296875e2), SC_(0.093633855470003473208809563463409739430069350910437) }}, {{ SC_(-0.773610293865203857421875e0), SC_(0.31483119964599609375e2), SC_(-0.070461745595949681092731243985402876714254585230743) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.553809732082299888134002685546875e-4), SC_(3411563292.9669796968942111028927746747449026912013) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.69304020144045352935791015625e-4), SC_(2046598362.3380277794050000226232431427674677129183) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.23264062474481761455535888671875e-3), SC_(129630922.50446339331155017819677365672220689660444) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.4480001516640186309814453125e-3), SC_(29124927.143476381060749270075197015061256245381856) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.5502865533344447612762451171875e-3), SC_(18229319.979238976100645658531262040951818547006941) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.19227224402129650115966796875e-2), SC_(1053897.956929569185955175319621657818949265062221) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.37370622158050537109375e-2), SC_(231841.1058891395815352896585377817238414867631727) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.47696642577648162841796875e-2), SC_(132973.34058880932283158982294999835148475126525153) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.1275280676782131195068359375e-1), SC_(14143.154724499012452193671302600271852897387117945) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.20440109074115753173828125e-1), SC_(4827.0002138856521246867589597595652858439787350198) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.3429813683032989501953125e-1), SC_(1483.6553845873024913995747798876739824063717521137) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.96701286733150482177734375e-1), SC_(139.26739836871849880232137398143962623378368507862) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.159812271595001220703125e0), SC_(43.976463496518941763685458110029121972927739474599) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.297095477581024169921875e0), SC_(10.387458193796098091458741004438449603082306315889) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.77344071865081787109375e0), SC_(0.99240849019214068933320060350367869050615793023443) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.1992881298065185546875e1), SC_(0.38007621281164781816882276366718911085812475276781) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.3915013790130615234375e1), SC_(0.29403596953295701246022014094101894218001927703594) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.79858455657958984375e1), SC_(-0.01837951078983691561532112217348471277074821384291) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.1571910858154296875e2), SC_(0.19427115245753018672180398439230100630688488506532) }}, {{ SC_(-0.1278498172760009765625e1), SC_(0.31483119964599609375e2), SC_(-0.13799728876142446935574975446216803968015474106104) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.553809732082299888134002685546875e-4), SC_(-1052534856334011.1715539380253442490393529354168594) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.69304020144045352935791015625e-4), SC_(-493567972016271.98593229233453766283237137175644106) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.23264062474481761455535888671875e-3), SC_(-8268281865770.6799723507075477047670236530702536031) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.4480001516640186309814453125e-3), SC_(-904509767542.57871242723570720295130551599003784941) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.5502865533344447612762451171875e-3), SC_(-451681172344.62275199563178724755053271724610716152) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.19227224402129650115966796875e-2), SC_(-6609106181.9315655323865091360718866593066117802884) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.37370622158050537109375e-2), SC_(-700748933.32738239550418059678170023119352690168661) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.47696642577648162841796875e-2), SC_(-307446225.29443781072879309174993795877958539308929) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.1275280676782131195068359375e-1), SC_(-11104382.334915614447662856663000022842550526037284) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.20440109074115753173828125e-1), SC_(-2257745.0631981596507978280357107785541246723841944) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.3429813683032989501953125e-1), SC_(-393215.54108344107745778732644950546167752024313407) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.96701286733150482177734375e-1), SC_(-11875.215377301361527607788678372426690815266675372) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.159812271595001220703125e0), SC_(-2178.2043791543280008244860279137202543771878307036) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.297095477581024169921875e0), SC_(-268.80841515377336154846614677034462642010213198625) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.77344071865081787109375e0), SC_(-10.653831565503460653054171073382042711333639447853) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.1992881298065185546875e1), SC_(-0.46405184762078718718459838928519754469724229927788) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.3915013790130615234375e1), SC_(-0.37388358442212335882627303155170282309105103172024) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.79858455657958984375e1), SC_(0.2605248427954328669351611971306267348449505723959) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.1571910858154296875e2), SC_(-0.0044288367831751747332630422754772844341893323667545) }}, {{ SC_(-0.2376763820648193359375e1), SC_(0.31483119964599609375e2), SC_(-0.0034984374041546566085717607248133391319551924960149) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.553809732082299888134002685546875e-4), SC_(-51998884562397766833638082608780563.737710080783588) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.69304020144045352935791015625e-4), SC_(-10373958678561228310418298843892260.299325543471815) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.23264062474481761455535888671875e-3), SC_(-1721193673013960740632763534764.5228214424091055852) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.4480001516640186309814453125e-3), SC_(-15499334906533236567606620530.200191728031049025026) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.5502865533344447612762451171875e-3), SC_(-3535003298421510578639833490.1298202600643335995787) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.19227224402129650115966796875e-2), SC_(-439752257691660682841541.75551794749699979175321037) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.37370622158050537109375e-2), SC_(-3705011706337639112308.1152209359387228834835931875) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.47696642577648162841796875e-2), SC_(-641530904911065947149.99803989774066863308464555235) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.1275280676782131195068359375e-1), SC_(-546132673072666047.00762658792974245303347213408634) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.20440109074115753173828125e-1), SC_(-18396701945112916.384895654825593702168225876869444) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.3429813683032989501953125e-1), SC_(-445744577892577.55674541900235843479039451134156993) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.96701286733150482177734375e-1), SC_(-259210670573.87288769946854267773996879304687746878) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.159812271595001220703125e0), SC_(-7010082148.1406965960052632072139869221477975711535) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.297095477581024169921875e0), SC_(-81491453.188992740300521508908029235919983115000153) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.77344071865081787109375e0), SC_(-85445.976575401714336017146103914454068580259978837) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.1992881298065185546875e1), SC_(-105.85384695262030240377338945392033413256061144355) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.3915013790130615234375e1), SC_(-1.1183215030957860901241466804409166833411563137547) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.79858455657958984375e1), SC_(-0.15924647968524992013750712539382612404853915739277) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.1571910858154296875e2), SC_(-0.13646497651694413062087338033835273332177981957281) }}, {{ SC_(-0.618752574920654296875e1), SC_(0.31483119964599609375e2), SC_(0.027827355903320065863025843071254167156921275283086) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.553809732082299888134002685546875e-4), SC_(8.4001523341827038432231402722998721443142330918029e+88) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.69304020144045352935791015625e-4), SC_(1.8796222553522528946620379625259071351108320901138e+87) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.23264062474481761455535888671875e-3), SC_(2.3081325916347882778073752606750486492668025854818e+78) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.4480001516640186309814453125e-3), SC_(3.478515150118406691595592053627769982231673500328e+73) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.5502865533344447612762451171875e-3), SC_(1.0670813727575964549272980712377341426694937581102e+72) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.19227224402129650115966796875e-2), SC_(6.6461334772063947653408668199451299578982343030567e+62) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.37370622158050537109375e-2), SC_(8.5619384530651836961194424228825518552684541970703e+57) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.47696642577648162841796875e-2), SC_(1.3719213377554659464306815751401633848492260535841e+56) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.1275280676782131195068359375e-1), SC_(7955158190212178420335468368124232663880717342110.2) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.20440109074115753173828125e-1), SC_(2687830185054672115670778035161362230550317234.9171) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.3429813683032989501953125e-1), SC_(417660847046267243923149265721102299918747.3327615) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.96701286733150482177734375e-1), SC_(9857412566370820437179391176824948.4480973116452753) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.159812271595001220703125e0), SC_(1982746222928083889201392122860.5529495215191051141) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.297095477581024169921875e0), SC_(54342658614656265715301011.291462576149999975040162) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.77344071865081787109375e0), SC_(4989069325897041578.9287143951601924931745358960062) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.1992881298065185546875e1), SC_(568820654109.75213716307392588957540692056153767208) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.3915013790130615234375e1), SC_(7228733.3457096840440213548757017280593929621744697) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.79858455657958984375e1), SC_(85.218410883780746589554552518759217135548634643101) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.1571910858154296875e2), SC_(0.083138583238802217337982342423668412467885504693672) }}, {{ SC_(-0.15943050384521484375e2), SC_(0.31483119964599609375e2), SC_(0.026092609809789979593703213872413724681414333167314) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.553809732082299888134002685546875e-4), SC_(6.732265130331118411406210733134040868570474523393e+180) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.69304020144045352935791015625e-4), SC_(4.7890805105156653308354285280134561894764616686371e+177) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.23264062474481761455535888671875e-3), SC_(4.8109334124012977057393970639279785207684445563722e+160) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.4480001516640186309814453125e-3), SC_(3.049052750399900587178257099373852751425565819684e+151) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.5502865533344447612762451171875e-3), SC_(3.9594237279973587787148322093805851499714508240285e+148) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.19227224402129650115966796875e-2), SC_(1.0894842839824276085850763917542395186000660442094e+131) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.37370622158050537109375e-2), SC_(5.1190963995973892592278162982935522403814915185721e+121) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.47696642577648162841796875e-2), SC_(1.9259093785260067277950959762634816738979484178694e+118) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.1275280676782131195068359375e-1), SC_(3.0209004816077561502611340316195266897611051320687e+104) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.20440109074115753173828125e-1), SC_(7.2189850508763419944174046157635499799131383398434e+97) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.3429813683032989501953125e-1), SC_(3.9203759513806755842698539491059510914538050043793e+90) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.96701286733150482177734375e-1), SC_(1.1068238961489066737178853560695046742443653655441e+76) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.159812271595001220703125e0), SC_(9.8310501753961151205121686731703916211875717169597e+68) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.297095477581024169921875e0), SC_(1.9474201739442400194932589993162245643234473214871e+60) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.77344071865081787109375e0), SC_(72637648749801605640594500299031420664728634405.057) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.1992881298065185546875e1), SC_(3865026197564005029397831991829306.6380852182772186) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.3915013790130615234375e1), SC_(1404011109550035690853366.2231718837052560358837621) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.79858455657958984375e1), SC_(201998574478312.5859314533387877544464625179036473) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.1571910858154296875e2), SC_(273866.85062463153642269420825285461481145130239201) }}, {{ SC_(-0.31320110321044921875e2), SC_(0.31483119964599609375e2), SC_(0.040177706317001652135569144163854139601049432365744) }}, #if LDBL_MAX_10_EXP > 370 {{ SC_(-0.638867645263671875e2), SC_(0.553809732082299888134002685546875e-4), SC_(2.3698927678173738831066761972137110281877681762679e+383) }}, {{ SC_(-0.638867645263671875e2), SC_(0.69304020144045352935791015625e-4), SC_(1.1347435085188848198271269654218346241788725670797e+377) }}, {{ SC_(-0.638867645263671875e2), SC_(0.23264062474481761455535888671875e-3), SC_(8.4954816338456215028286500709836088758658594626306e+342) }}, {{ SC_(-0.638867645263671875e2), SC_(0.4480001516640186309814453125e-3), SC_(2.9033181046257357700429477801583184943123438667291e+324) }}, {{ SC_(-0.638867645263671875e2), SC_(0.5502865533344447612762451171875e-3), SC_(4.6538211817343001183895076979754694438753107525127e+318) }}, #endif {{ SC_(-0.638867645263671875e2), SC_(0.19227224402129650115966796875e-2), SC_(2.5884127570342517807802184680833064189350946360272e+283) }}, {{ SC_(-0.638867645263671875e2), SC_(0.37370622158050537109375e-2), SC_(4.8508986987836801234656433955696736929307399214621e+264) }}, {{ SC_(-0.638867645263671875e2), SC_(0.47696642577648162841796875e-2), SC_(6.4652313804985336441271270491093075957693244755895e+257) }}, {{ SC_(-0.638867645263671875e2), SC_(0.1275280676782131195068359375e-1), SC_(1.2481913994843204247151724194175209513818899114211e+230) }}, {{ SC_(-0.638867645263671875e2), SC_(0.20440109074115753173828125e-1), SC_(6.3452402812155401507978956824225465373086743151221e+216) }}, {{ SC_(-0.638867645263671875e2), SC_(0.3429813683032989501953125e-1), SC_(1.6471284344367667896225149421358528479494425365156e+202) }}, {{ SC_(-0.638867645263671875e2), SC_(0.96701286733150482177734375e-1), SC_(1.0167245949532858220681726036512131689235250729876e+173) }}, {{ SC_(-0.638867645263671875e2), SC_(0.159812271595001220703125e0), SC_(7.0855606144842314101921479749180352596328021493921e+158) }}, {{ SC_(-0.638867645263671875e2), SC_(0.297095477581024169921875e0), SC_(2.3844448492985196529635784175504063632397857898622e+141) }}, {{ SC_(-0.638867645263671875e2), SC_(0.77344071865081787109375e0), SC_(2.6048251069659582851724058248351336224666813212987e+114) }}, {{ SC_(-0.638867645263671875e2), SC_(0.1992881298065185546875e1), SC_(5.6160513564930999055692078692461392613591823835801e+87) }}, {{ SC_(-0.638867645263671875e2), SC_(0.3915013790130615234375e1), SC_(5.498812871670615045881011453415585469720132723112e+68) }}, {{ SC_(-0.638867645263671875e2), SC_(0.79858455657958984375e1), SC_(5411799740662393319191711873139592736080843868560.4) }}, {{ SC_(-0.638867645263671875e2), SC_(0.1571910858154296875e2), SC_(910129039949789177025388333870.53660912834462595725) }}, {{ SC_(-0.638867645263671875e2), SC_(0.31483119964599609375e2), SC_(477742493665.49170927134873191131936373256371654668) }}, }};
144.711172
161
0.787456
Wultyc
be5064e3921d036ba100e8519203df1bf50ec079
4,658
hpp
C++
Pods/Realm/include/core/realm/util/buffer_stream.hpp
Jethro87/DevSwitch
0ff977fb0e1225b58304e2b46ddb129abc5b9fbe
[ "MIT" ]
1,562
2020-08-19T00:30:37.000Z
2022-03-31T15:15:22.000Z
Pods/Realm/include/core/realm/util/buffer_stream.hpp
Jethro87/DevSwitch
0ff977fb0e1225b58304e2b46ddb129abc5b9fbe
[ "MIT" ]
1,472
2020-12-18T07:19:53.000Z
2022-03-31T15:34:27.000Z
Pods/Realm/include/core/realm/util/buffer_stream.hpp
Jethro87/DevSwitch
0ff977fb0e1225b58304e2b46ddb129abc5b9fbe
[ "MIT" ]
247
2020-09-06T18:34:40.000Z
2022-03-30T09:03:50.000Z
/************************************************************************* * * REALM CONFIDENTIAL * __________________ * * [2011] - [2016] Realm Inc * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Realm Incorporated and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Realm Incorporated * and its suppliers and may be covered by U.S. and Foreign Patents, * patents in process, and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Realm Incorporated. * **************************************************************************/ #ifndef REALM_UTIL_BUFFER_STREAM_HPP #define REALM_UTIL_BUFFER_STREAM_HPP #include <cstddef> #include <sstream> namespace realm { namespace util { template<class C, class T = std::char_traits<C>, class A = std::allocator<C> > class BasicResettableExpandableOutputStreambuf: public std::basic_stringbuf<C,T,A> { public: using char_type = typename std::basic_stringbuf<C,T,A>::char_type; /// Reset current writing position (std::basic_streambuf::pptr()) to the /// beginning of the output buffer without reallocating buffer memory. void reset() noexcept; //@{ /// Get a pointer to the beginning of the output buffer /// (std::basic_streambuf::pbase()). Note that this will change as the /// buffer is reallocated. char_type* data() noexcept; const char_type* data() const noexcept; //@} /// Get the number of bytes written to the output buffer since the creation /// of the stream buffer, or since the last invocation of reset() /// (std::basic_streambuf::pptr() - std::basic_streambuf::pbase()). std::size_t size() const noexcept; }; template<class C, class T = std::char_traits<C>, class A = std::allocator<C> > class BasicResettableExpandableBufferOutputStream: public std::basic_ostream<C,T> { public: using char_type = typename std::basic_ostream<C,T>::char_type; BasicResettableExpandableBufferOutputStream(); /// Calls BasicResettableExpandableOutputStreambuf::reset(). void reset() noexcept; //@{ /// Calls BasicResettableExpandableOutputStreambuf::data(). char_type* data() noexcept; const char_type* data() const noexcept; //@} /// Calls BasicResettableExpandableOutputStreambuf::size(). std::size_t size() const noexcept; private: BasicResettableExpandableOutputStreambuf<C,T,A> m_streambuf; }; using ResettableExpandableBufferOutputStream = BasicResettableExpandableBufferOutputStream<char>; // Implementation template<class C, class T, class A> inline void BasicResettableExpandableOutputStreambuf<C,T,A>::reset() noexcept { char_type* pbeg = this->pbase(); char_type* pend = this->epptr(); this->setp(pbeg, pend); } template<class C, class T, class A> inline typename BasicResettableExpandableOutputStreambuf<C,T,A>::char_type* BasicResettableExpandableOutputStreambuf<C,T,A>::data() noexcept { return this->pbase(); } template<class C, class T, class A> inline const typename BasicResettableExpandableOutputStreambuf<C,T,A>::char_type* BasicResettableExpandableOutputStreambuf<C,T,A>::data() const noexcept { return this->pbase(); } template<class C, class T, class A> inline std::size_t BasicResettableExpandableOutputStreambuf<C,T,A>::size() const noexcept { std::size_t size = std::size_t(this->pptr() - this->pbase()); return size; } template<class C, class T, class A> inline BasicResettableExpandableBufferOutputStream<C,T,A>:: BasicResettableExpandableBufferOutputStream(): std::basic_ostream<C,T>(&m_streambuf) // Throws { } template<class C, class T, class A> inline void BasicResettableExpandableBufferOutputStream<C,T,A>::reset() noexcept { m_streambuf.reset(); } template<class C, class T, class A> inline typename BasicResettableExpandableBufferOutputStream<C,T,A>::char_type* BasicResettableExpandableBufferOutputStream<C,T,A>::data() noexcept { return m_streambuf.data(); } template<class C, class T, class A> inline const typename BasicResettableExpandableBufferOutputStream<C,T,A>::char_type* BasicResettableExpandableBufferOutputStream<C,T,A>::data() const noexcept { return m_streambuf.data(); } template<class C, class T, class A> inline std::size_t BasicResettableExpandableBufferOutputStream<C,T,A>::size() const noexcept { return m_streambuf.size(); } } // namespace util } // namespace realm #endif // REALM_UTIL_BUFFER_STREAM_HPP
30.644737
97
0.718549
Jethro87
be50c76627d5c2cddd40d82d998d06e3e1a1c0ea
690
cpp
C++
firmware/ventilator-controller-stm32/Core/Src/Pufferfish/Driver/I2C/ExtendedI2CDevice.cpp
raavilagoo/Test
e2de25cc4b6fcbffe3f98f4a7ce1644fa8b6bb16
[ "Apache-2.0" ]
1
2020-10-20T23:47:23.000Z
2020-10-20T23:47:23.000Z
firmware/ventilator-controller-stm32/Core/Src/Pufferfish/Driver/I2C/ExtendedI2CDevice.cpp
raavilagoo/Test
e2de25cc4b6fcbffe3f98f4a7ce1644fa8b6bb16
[ "Apache-2.0" ]
242
2020-10-23T06:44:01.000Z
2022-01-28T05:50:45.000Z
firmware/ventilator-controller-stm32/Core/Src/Pufferfish/Driver/I2C/ExtendedI2CDevice.cpp
pez-globo/pufferfish-vent-software
f1e5e47acf1941e7c729adb750b85bf26c38b274
[ "Apache-2.0" ]
1
2021-04-12T02:10:18.000Z
2021-04-12T02:10:18.000Z
/* * Copyright 2020, the Pez Globo team and the Pufferfish project contributors * * Author: March Boonyapaluk */ #include "Pufferfish/Driver/I2C/ExtendedI2CDevice.h" namespace Pufferfish::Driver::I2C { I2CDeviceStatus ExtendedI2CDevice::read(uint8_t *buf, size_t count) { I2CDeviceStatus stat = mux_.select_slot(ext_slot); if (stat != I2CDeviceStatus::ok) { return stat; } return dev_.read(buf, count); } I2CDeviceStatus ExtendedI2CDevice::write(uint8_t *buf, size_t count) { I2CDeviceStatus stat = mux_.select_slot(ext_slot); if (stat != I2CDeviceStatus::ok) { return stat; } return dev_.write(buf, count); } } // namespace Pufferfish::Driver::I2C
23
77
0.717391
raavilagoo
be516196e6880ddceaa3e9b29516ffbc6c49e479
4,502
hpp
C++
inc/lmdb-wrapper/cursor.hpp
douderg/lmdb-wrapper
b37e46b8420b023baeabc0c9688ac5e07c3a6734
[ "MIT" ]
null
null
null
inc/lmdb-wrapper/cursor.hpp
douderg/lmdb-wrapper
b37e46b8420b023baeabc0c9688ac5e07c3a6734
[ "MIT" ]
null
null
null
inc/lmdb-wrapper/cursor.hpp
douderg/lmdb-wrapper
b37e46b8420b023baeabc0c9688ac5e07c3a6734
[ "MIT" ]
null
null
null
#pragma once #include "lmdb-wrapper/value.hpp" #include <optional> namespace lmdb { template <class K, class T> class cursor { public: cursor(): cursor_{nullptr} { } cursor(MDB_txn* t, MDB_dbi d): cursor() { if (mdb_cursor_open(t, d, &cursor_)) { throw std::runtime_error("failed to open cursor"); } MDB_val key, data; if (mdb_cursor_get(cursor_, &key, &data, MDB_FIRST)) { throw std::runtime_error("cursor error"); } } ~cursor() { if (cursor_) { mdb_cursor_close(cursor_); cursor_ = nullptr; } } cursor(const cursor& other): cursor_{nullptr} { if (other.cursor_) { MDB_val other_key, other_data; if (!mdb_cursor_get(other.cursor_, &other_key, &other_data, MDB_GET_CURRENT)) { if (mdb_cursor_open(other.txn(), other.dbi(), &cursor_)) { cursor_ = nullptr; throw std::runtime_error("failed to open cursor"); } MDB_val key = other_key, data = other_data; if (mdb_cursor_get(cursor_, &key, &data, MDB_SET)) { throw std::runtime_error("cursor error"); } while (true) { if (data.mv_data == other_data.mv_data) { break; } if (mdb_cursor_get(cursor_, &key, &data, MDB_NEXT)) { throw std::runtime_error("cursor error"); } } } } } MDB_txn* txn() const { return cursor_? mdb_cursor_txn(cursor_) : nullptr; } MDB_dbi dbi() const { if (!cursor_) { throw std::runtime_error("invalid cursor"); } return mdb_cursor_dbi(cursor_); } cursor& operator=(const cursor& other) { if (cursor_) { mdb_cursor_close(cursor_); cursor_ = nullptr; } if (other.cursor_) { MDB_val other_key, other_data; if (!mdb_cursor_get(other.cursor_, &other_key, &other_data, MDB_GET_CURRENT)) { if (mdb_cursor_open(other.txn(), other.dbi(), &cursor_)) { throw std::runtime_error("failed to open cursor"); } MDB_val key = other_key, data = other_data; if (mdb_cursor_get(cursor_, &key, &data, MDB_SET)) { throw std::runtime_error("cursor error"); } while (true) { if (data.mv_data == other_data.mv_data) { break; } if (mdb_cursor_get(cursor_, &key, &data, MDB_NEXT)) { throw std::runtime_error("cursor error"); } } } } } cursor(cursor&& other):cursor_{other.cursor_} { other.cursor_ = nullptr; } cursor& operator=(cursor&& other) { if (cursor_) { mdb_cursor_close(cursor_); } cursor_ = other.cursor_; other.cursor_ = nullptr; return *this; } /** @param op one of the following op codes MDB_FIRST, MDB_FIRST_DUP, MDB_GET_BOTH, MDB_GET_BOTH_RANGE, MDB_GET_CURRENT, MDB_GET_MULTIPLE, MDB_LAST, MDB_LAST_DUP, MDB_NEXT, MDB_NEXT_DUP, MDB_NEXT_MULTIPLE, MDB_NEXT_NODUP, MDB_PREV, MDB_PREV_DUP, MDB_PREV_NODUP, MDB_SET, MDB_SET_KEY, MDB_SET_RANGE */ std::optional<std::pair<K, T>> get(MDB_cursor_op op) const { std::optional<std::pair<K, T>> result; if (!cursor_) { return result; } MDB_val key, data; int err = mdb_cursor_get(cursor_, &key, &data, op); if (!err) { object<T> obj(data); result = std::make_pair(value::unpack<K>(key), obj.value()); } return result; } std::optional<std::pair<K, T>> get(const K& key, const T& value, MDB_cursor_op op) const { std::optional<std::pair<K, T>> result; if (!cursor_) { return result; } MDB_val mdb_key = value::pack<K>(key); object<T> obj(value); if (!mdb_cursor_get(cursor_, &mdb_key, obj.data(), op)) { result = std::make_pair(value::unpack<K>(mdb_key), obj.value()); } return result; } private: MDB_cursor *cursor_; }; }
30.214765
94
0.512217
douderg
be521275934a9cf69185bc331ee294ad91bd623f
819
hpp
C++
src/image/RGB555-RGB565.hpp
PhysShell/SEZEII
0c7ea7fb52d0df67437d158a81a72971e3753461
[ "MIT" ]
null
null
null
src/image/RGB555-RGB565.hpp
PhysShell/SEZEII
0c7ea7fb52d0df67437d158a81a72971e3753461
[ "MIT" ]
null
null
null
src/image/RGB555-RGB565.hpp
PhysShell/SEZEII
0c7ea7fb52d0df67437d158a81a72971e3753461
[ "MIT" ]
null
null
null
#pragma once #include "../utils/macro.hpp" namespace seze { extern const byte table5[]; extern const byte table6[]; struct RGB565 { public: uint16_t RGB = 0; ///< 5:6:5 RGB565(byte r=0, byte g=0, byte b=0); RGB565(uint16_t data); //! copy components to vals void set_to(byte& r, byte& g, byte& b) const; }; // RGB565 struct RGB555 { public: uint16_t RGB = 0; ///< 5:5:5 RGB555(byte r=0, byte g=0, byte b=0); RGB555(uint16_t data); //! copy components to vals void set_to(byte& r, byte& g, byte& b) const; }; // RGB555 /** https://stackoverflow.com/a/9069480 RGB565 -> RGB888 R8 = ( R5 * 527 + 23 ) >> 6; G8 = ( G6 * 259 + 33 ) >> 6; B8 = ( B5 * 527 + 23 ) >> 6; RGB888 -> RGB565 R5 = ( R8 * 249 + 1014 ) >> 11; G6 = ( G8 * 253 + 505 ) >> 10; B5 = ( B8 * 249 + 1014 ) >> 11; */ } // seze ns
20.475
47
0.578755
PhysShell
be561fd2c5d5b0a9297fcca191c9fca9e7e73dea
2,214
cpp
C++
Hackerrank/greedy/reverse_shuffle_merge.cpp
JordanKoeller/InterviewPrep
8f73168ac7ccc5711851193f006bfc387c44ea7e
[ "MIT" ]
null
null
null
Hackerrank/greedy/reverse_shuffle_merge.cpp
JordanKoeller/InterviewPrep
8f73168ac7ccc5711851193f006bfc387c44ea7e
[ "MIT" ]
null
null
null
Hackerrank/greedy/reverse_shuffle_merge.cpp
JordanKoeller/InterviewPrep
8f73168ac7ccc5711851193f006bfc387c44ea7e
[ "MIT" ]
null
null
null
// s = aabbccdd // char <- a = {d, c, b, a} // lexMin = abcd // reverse(A) = abcd // A = dcba // s has a LCS(reverse(A), s) = reverse(A) /** * Steps: * 1. Count repetions of characters. divide by 2 * to get the number of each character in A * 2. Construct the lexographically maximal substring from s * that uses the characters in A * 3. Reverse it to get the lexographically minimal string. */ #include <bits/stdc++.h> using namespace std; /* * Complete the 'reverseShuffleMerge' function below. * * The function is expected to return a STRING. * The function accepts STRING s as parameter. */ struct iter_state_t { int i; vector<int> chars_to_consume; vector<int> num_remaining_skips; int focused_char; }; string reverseShuffleMerge(string s) { vector<int> skippable_chars (26, 0); for (auto c: s) skippable_chars[c - 'a']++; for (size_t i=0; i < 26; i++) { skippable_chars[i] = skippable_chars[i] / 2; } vector<int> consumable_chars {skippable_chars.begin(), skippable_chars.end()}; deque<int> ret_stack; for (auto iter=s.rbegin(); iter != s.rend(); iter++) { int index = *iter - 'a'; if (consumable_chars[index] > 0) { while (ret_stack.size() > 0 && ret_stack.back() > index && skippable_chars[ret_stack.back()] > 0) { int skipped = ret_stack.back(); ret_stack.pop_back(); consumable_chars[skipped] += 1; skippable_chars[skipped] -= 1; } ret_stack.push_back(index); consumable_chars[index] -= 1; } else { skippable_chars[index] -= 1; } } string ret; ret.reserve(ret_stack.size()); for (size_t i=0; i < ret_stack.size(); i++) { ret.push_back('a' + (char) ret_stack[i]); } // Find the lexigraph. Min subsequence of s containing all // the necessary characters. return ret; } int main() { ofstream fout(getenv("OUTPUT_PATH")); string s; getline(cin, s); // string s = "djjcddjggbiigjhfghehhbgdigjicafgjcehhfgifadihiajgciagicdahcbajjbhifjiaajigdgdfhdiijjgaiejgegbbiigida"; string result = reverseShuffleMerge(s); // cout << "Returned " << result << endl; fout << result << "\n"; fout.close(); return 0; }
24.32967
121
0.635953
JordanKoeller
be56775a22941981fe4b170b175857ae4072943f
6,186
cpp
C++
InputWidgetBayesianCalibration.cpp
charlesxwang/uqFEM
a29104c581ff6f23b4736c440425add681979829
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
InputWidgetBayesianCalibration.cpp
charlesxwang/uqFEM
a29104c581ff6f23b4736c440425add681979829
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
InputWidgetBayesianCalibration.cpp
charlesxwang/uqFEM
a29104c581ff6f23b4736c440425add681979829
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
// Written: fmckenna /* ***************************************************************************** Copyright (c) 2016-2017, The Regents of the University of California (Regents). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. *************************************************************************** */ // Written: fmckenna #include "InputWidgetBayesianCalibration.h" #include <DakotaResultsBayesianCalibration.h> #include <RandomVariablesContainer.h> #include <QPushButton> #include <QScrollArea> #include <QJsonArray> #include <QJsonObject> #include <QLabel> #include <QLineEdit> #include <QDebug> #include <QFileDialog> #include <QPushButton> #include <sectiontitle.h> #include <InputWidgetEDP.h> #include <iostream> #include <sstream> #include <fstream> #include <time.h> InputWidgetBayesianCalibration::InputWidgetBayesianCalibration(QWidget *parent) : InputWidgetDakotaMethod(parent),uqSpecific(0) { layout = new QVBoxLayout(); QVBoxLayout *methodLayout= new QVBoxLayout; QLabel *label1 = new QLabel(); label1->setText(QString("Method")); calibrationMethod = new QComboBox(); calibrationMethod->addItem(tr("DREAM")); // calibrationMethod->addItem(tr("QUESO")); methodLayout->addWidget(label1); methodLayout->addWidget(calibrationMethod); QVBoxLayout *samplesLayout= new QVBoxLayout; QLabel *label2 = new QLabel(); label2->setText(QString("#Chain Samples")); chainSamples = new QLineEdit(); chainSamples->setText(tr("10")); chainSamples->setMaximumWidth(100); chainSamples->setMinimumWidth(100); samplesLayout->addWidget(label2); samplesLayout->addWidget(chainSamples); QVBoxLayout *seedLayout= new QVBoxLayout; QLabel *label3 = new QLabel(); label3->setText(QString("Seed")); srand(time(NULL)); int randomNumber = rand() % 1000 + 1; randomSeed = new QLineEdit(); randomSeed->setText(QString::number(randomNumber)); randomSeed->setMaximumWidth(100); randomSeed->setMinimumWidth(100); seedLayout->addWidget(label3); seedLayout->addWidget(randomSeed); QHBoxLayout *mLayout = new QHBoxLayout(); mLayout->addLayout(methodLayout); mLayout->addLayout(samplesLayout); mLayout->addLayout(seedLayout); mLayout->addStretch(); layout->addLayout(mLayout); theEdpWidget = new InputWidgetEDP(); layout->addWidget(theEdpWidget,1); this->setLayout(layout); } InputWidgetBayesianCalibration::~InputWidgetBayesianCalibration() { } int InputWidgetBayesianCalibration::getMaxNumParallelTasks(void){ return 1; } void InputWidgetBayesianCalibration::clear(void) { } bool InputWidgetBayesianCalibration::outputToJSON(QJsonObject &jsonObject) { bool result = true; QJsonObject uq; uq["method"]=calibrationMethod->currentText(); uq["chain_samples"]=chainSamples->text().toInt(); uq["seed"]=randomSeed->text().toDouble(); result = theEdpWidget->outputToJSON(uq); jsonObject["bayesian_calibration_method_data"]=uq; return result; } bool InputWidgetBayesianCalibration::inputFromJSON(QJsonObject &jsonObject) { bool result = true; this->clear(); if (jsonObject.contains("bayesian_calibration_method_data")) { QJsonObject uq = jsonObject["bayesian_calibration_method_data"].toObject(); QString method =uq["method"].toString(); int samples=uq["chain_samples"].toInt(); double seed=uq["seed"].toDouble(); chainSamples->setText(QString::number(samples)); randomSeed->setText(QString::number(seed)); int index = calibrationMethod->findText(method); calibrationMethod->setCurrentIndex(index); return theEdpWidget->inputFromJSON(uq); } else { emit sendErrorMessage("ERROR: Bayesian Calibration INput - no \"bayesian_calibration_method\" data"); return false; } return true; } void InputWidgetBayesianCalibration::uqSelectionChanged(const QString &arg1) { } int InputWidgetBayesianCalibration::processResults(QString &filenameResults, QString &filenameTab) { return 0; } DakotaResults * InputWidgetBayesianCalibration::getResults(void) { return new DakotaResultsBayesianCalibration(); } RandomVariablesContainer * InputWidgetBayesianCalibration::getParameters(void) { QString classType("Uncertain"); return new RandomVariablesContainer(classType); }
31.561224
109
0.731005
charlesxwang
be57e359793b2b3113cdfaf1955e1373ce2ddbef
924
cpp
C++
TRAP/src/Graphics/API/Vulkan/Internals/Objects/VulkanSemaphore.cpp
GamesTrap/TRAP
007de9ce70273cb8ae11066cc8488d9db78b1038
[ "MIT", "Zlib", "Apache-2.0", "BSD-3-Clause" ]
3
2018-06-23T18:18:19.000Z
2019-05-27T21:10:07.000Z
TRAP/src/Graphics/API/Vulkan/Internals/Objects/VulkanSemaphore.cpp
GamesTrap/TRAP
007de9ce70273cb8ae11066cc8488d9db78b1038
[ "MIT", "Zlib", "Apache-2.0", "BSD-3-Clause" ]
88
2018-08-02T01:08:04.000Z
2019-07-24T19:13:26.000Z
TRAP/src/Graphics/API/Vulkan/Internals/Objects/VulkanSemaphore.cpp
GamesTrap/TRAP
007de9ce70273cb8ae11066cc8488d9db78b1038
[ "MIT", "Zlib", "Apache-2.0", "BSD-3-Clause" ]
2
2018-08-02T01:10:40.000Z
2020-08-14T14:05:58.000Z
#include "TRAPPCH.h" #include "VulkanSemaphore.h" #include "VulkanDevice.h" #include "Graphics/API/Vulkan/Internals/VulkanInitializers.h" TRAP::Graphics::API::Vulkan::Semaphore::Semaphore(Device* device) : m_semaphore(), m_device(device) { VkSemaphoreCreateInfo semaphoreCreateInfo = Initializers::SemaphoreCreateInfo(); vkCreateSemaphore(m_device->GetDevice(), &semaphoreCreateInfo, nullptr, &m_semaphore); } //-------------------------------------------------------------------------------------------------------------------// TRAP::Graphics::API::Vulkan::Semaphore::~Semaphore() { if (m_semaphore) { vkDestroySemaphore(m_device->GetDevice(), m_semaphore, nullptr); m_semaphore = nullptr; } } //-------------------------------------------------------------------------------------------------------------------// VkSemaphore& TRAP::Graphics::API::Vulkan::Semaphore::GetSemaphore() { return m_semaphore; }
30.8
119
0.563853
GamesTrap
be5cfef1fbff2e83155a869bf0214015bb2051f7
102,185
cpp
C++
extern/glslang/SPIRV/doc.cpp
tmpvar/glslang-sys
0cff8c5163380348f6d7e6c573b859a1e68f470b
[ "MIT" ]
1
2017-08-29T14:07:31.000Z
2017-08-29T14:07:31.000Z
extern/glslang/SPIRV/doc.cpp
tmpvar/glslang-sys
0cff8c5163380348f6d7e6c573b859a1e68f470b
[ "MIT" ]
1
2018-11-25T07:43:23.000Z
2019-05-19T05:28:26.000Z
extern/glslang/SPIRV/doc.cpp
tmpvar/glslang-sys
0cff8c5163380348f6d7e6c573b859a1e68f470b
[ "MIT" ]
2
2018-12-22T13:48:15.000Z
2020-01-31T20:56:46.000Z
// //Copyright (C) 2014 LunarG, Inc. // //All rights reserved. // //Redistribution and use in source and binary forms, with or without //modification, are permitted provided that the following conditions //are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // // Neither the name of 3Dlabs Inc. Ltd. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS //FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE //COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, //INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, //BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER //CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. // // Author: John Kessenich, LunarG // // // 1) Programatically fill in instruction/operand information. // This can be used for disassembly, printing documentation, etc. // // 2) Print documentation from this parameterization. // #include "doc.h" #include <stdio.h> #include <string.h> #include <algorithm> namespace spv { // // Whole set of functions that translate enumerants to their text strings for // the specification (or their sanitized versions for auto-generating the // spirv.h header. // // Also, the ceilings are declared next to these, to help keep them in sync. // Ceilings should be // - one more than the maximum value an enumerant takes on, for non-mask enumerants // (for non-sparse enums, this is the number of enumurants) // - the number of bits consumed by the set of masks // (for non-sparse mask enums, this is the number of enumurants) // const int SourceLanguageCeiling = 4; const char* SourceString(int source) { switch (source) { case 0: return "Unknown"; case 1: return "ESSL"; case 2: return "GLSL"; case 3: return "OpenCL"; case SourceLanguageCeiling: default: return "Bad"; } } const int ExecutionModelCeiling = 7; const char* ExecutionModelString(int model) { switch (model) { case 0: return "Vertex"; case 1: return "TessellationControl"; case 2: return "TessellationEvaluation"; case 3: return "Geometry"; case 4: return "Fragment"; case 5: return "GLCompute"; case 6: return "Kernel"; case ExecutionModelCeiling: default: return "Bad"; } } const int AddressingModelCeiling = 3; const char* AddressingString(int addr) { switch (addr) { case 0: return "Logical"; case 1: return "Physical32"; case 2: return "Physical64"; case AddressingModelCeiling: default: return "Bad"; } } const int MemoryModelCeiling = 5; const char* MemoryString(int mem) { switch (mem) { case 0: return "Simple"; case 1: return "GLSL450"; case 2: return "OpenCL1.2"; case 3: return "OpenCL2.0"; case 4: return "OpenCL2.1"; case MemoryModelCeiling: default: return "Bad"; } } const int ExecutionModeCeiling = 31; const char* ExecutionModeString(int mode) { switch (mode) { case 0: return "Invocations"; case 1: return "SpacingEqual"; case 2: return "SpacingFractionalEven"; case 3: return "SpacingFractionalOdd"; case 4: return "VertexOrderCw"; case 5: return "VertexOrderCcw"; case 6: return "PixelCenterInteger"; case 7: return "OriginUpperLeft"; case 8: return "EarlyFragmentTests"; case 9: return "PointMode"; case 10: return "Xfb"; case 11: return "DepthReplacing"; case 12: return "DepthAny"; case 13: return "DepthGreater"; case 14: return "DepthLess"; case 15: return "DepthUnchanged"; case 16: return "LocalSize"; case 17: return "LocalSizeHint"; case 18: return "InputPoints"; case 19: return "InputLines"; case 20: return "InputLinesAdjacency"; case 21: return "InputTriangles"; case 22: return "InputTrianglesAdjacency"; case 23: return "InputQuads"; case 24: return "InputIsolines"; case 25: return "OutputVertices"; case 26: return "OutputPoints"; case 27: return "OutputLineStrip"; case 28: return "OutputTriangleStrip"; case 29: return "VecTypeHint"; case 30: return "ContractionOff"; case ExecutionModeCeiling: default: return "Bad"; } } const int StorageClassCeiling = 11; const char* StorageClassString(int StorageClass) { switch (StorageClass) { case 0: return "UniformConstant"; case 1: return "Input"; case 2: return "Uniform"; case 3: return "Output"; case 4: return "WorkgroupLocal"; case 5: return "WorkgroupGlobal"; case 6: return "PrivateGlobal"; case 7: return "Function"; case 8: return "Generic"; case 9: return "Private"; case 10: return "AtomicCounter"; case StorageClassCeiling: default: return "Bad"; } } const int DecorationCeiling = 45; const char* DecorationString(int decoration) { switch (decoration) { case 0: return "PrecisionLow"; case 1: return "PrecisionMedium"; case 2: return "PrecisionHigh"; case 3: return "Block"; case 4: return "BufferBlock"; case 5: return "RowMajor"; case 6: return "ColMajor"; case 7: return "GLSLShared"; case 8: return "GLSLStd140"; case 9: return "GLSLStd430"; case 10: return "GLSLPacked"; case 11: return "Smooth"; case 12: return "Noperspective"; case 13: return "Flat"; case 14: return "Patch"; case 15: return "Centroid"; case 16: return "Sample"; case 17: return "Invariant"; case 18: return "Restrict"; case 19: return "Aliased"; case 20: return "Volatile"; case 21: return "Constant"; case 22: return "Coherent"; case 23: return "Nonwritable"; case 24: return "Nonreadable"; case 25: return "Uniform"; case 26: return "NoStaticUse"; case 27: return "CPacked"; case 28: return "SaturatedConversion"; case 29: return "Stream"; case 30: return "Location"; case 31: return "Component"; case 32: return "Index"; case 33: return "Binding"; case 34: return "DescriptorSet"; case 35: return "Offset"; case 36: return "Alignment"; case 37: return "XfbBuffer"; case 38: return "Stride"; case 39: return "BuiltIn"; case 40: return "FuncParamAttr"; case 41: return "FP Rounding Mode"; case 42: return "FP Fast Math Mode"; case 43: return "Linkage Attributes"; case 44: return "SpecId"; case DecorationCeiling: default: return "Bad"; } } const int BuiltInCeiling = 42; const char* BuiltInString(int builtIn) { switch (builtIn) { case 0: return "Position"; case 1: return "PointSize"; case 2: return "ClipVertex"; case 3: return "ClipDistance"; case 4: return "CullDistance"; case 5: return "VertexId"; case 6: return "InstanceId"; case 7: return "PrimitiveId"; case 8: return "InvocationId"; case 9: return "Layer"; case 10: return "ViewportIndex"; case 11: return "TessLevelOuter"; case 12: return "TessLevelInner"; case 13: return "TessCoord"; case 14: return "PatchVertices"; case 15: return "FragCoord"; case 16: return "PointCoord"; case 17: return "FrontFacing"; case 18: return "SampleId"; case 19: return "SamplePosition"; case 20: return "SampleMask"; case 21: return "FragColor"; case 22: return "FragDepth"; case 23: return "HelperInvocation"; case 24: return "NumWorkgroups"; case 25: return "WorkgroupSize"; case 26: return "WorkgroupId"; case 27: return "LocalInvocationId"; case 28: return "GlobalInvocationId"; case 29: return "LocalInvocationIndex"; case 30: return "WorkDim"; case 31: return "GlobalSize"; case 32: return "EnqueuedWorkgroupSize"; case 33: return "GlobalOffset"; case 34: return "GlobalLinearId"; case 35: return "WorkgroupLinearId"; case 36: return "SubgroupSize"; case 37: return "SubgroupMaxSize"; case 38: return "NumSubgroups"; case 39: return "NumEnqueuedSubgroups"; case 40: return "SubgroupId"; case 41: return "SubgroupLocalInvocationId"; case BuiltInCeiling: default: return "Bad"; } } const int DimensionCeiling = 6; const char* DimensionString(int dim) { switch (dim) { case 0: return "1D"; case 1: return "2D"; case 2: return "3D"; case 3: return "Cube"; case 4: return "Rect"; case 5: return "Buffer"; case DimensionCeiling: default: return "Bad"; } } const int SamplerAddressingModeCeiling = 5; const char* SamplerAddressingModeString(int mode) { switch (mode) { case 0: return "None"; case 1: return "ClampToEdge"; case 2: return "Clamp"; case 3: return "Repeat"; case 4: return "RepeatMirrored"; case SamplerAddressingModeCeiling: default: return "Bad"; } } const int SamplerFilterModeCeiling = 2; const char* SamplerFilterModeString(int mode) { switch (mode) { case 0: return "Nearest"; case 1: return "Linear"; case SamplerFilterModeCeiling: default: return "Bad"; } } const int FPFastMathCeiling = 5; const char* FPFastMathString(int mode) { switch (mode) { case 0: return "NotNaN"; case 1: return "NotInf"; case 2: return "NSZ"; case 3: return "AllowRecip"; case 4: return "Fast"; case FPFastMathCeiling: default: return "Bad"; } } const int FPRoundingModeCeiling = 4; const char* FPRoundingModeString(int mode) { switch (mode) { case 0: return "RTE"; case 1: return "RTZ"; case 2: return "RTP"; case 3: return "RTN"; case FPRoundingModeCeiling: default: return "Bad"; } } const int LinkageTypeCeiling = 2; const char* LinkageTypeString(int type) { switch (type) { case 0: return "Export"; case 1: return "Import"; case LinkageTypeCeiling: default: return "Bad"; } } const int FuncParamAttrCeiling = 9; const char* FuncParamAttrString(int attr) { switch (attr) { case 0: return "Zext"; case 1: return "Sext"; case 2: return "ByVal"; case 3: return "Sret"; case 4: return "NoAlias"; case 5: return "NoCapture"; case 6: return "SVM"; case 7: return "NoWrite"; case 8: return "NoReadWrite"; case FuncParamAttrCeiling: default: return "Bad"; } } const int AccessQualifierCeiling = 3; const char* AccessQualifierString(int attr) { switch (attr) { case 0: return "ReadOnly"; case 1: return "WriteOnly"; case 2: return "ReadWrite"; case AccessQualifierCeiling: default: return "Bad"; } } const int SelectControlCeiling = 2; const char* SelectControlString(int cont) { switch (cont) { case 0: return "Flatten"; case 1: return "DontFlatten"; case SelectControlCeiling: default: return "Bad"; } } const int LoopControlCeiling = 2; const char* LoopControlString(int cont) { switch (cont) { case 0: return "Unroll"; case 1: return "DontUnroll"; case LoopControlCeiling: default: return "Bad"; } } const int FunctionControlCeiling = 4; const char* FunctionControlString(int cont) { switch (cont) { case 0: return "Inline"; case 1: return "DontInline"; case 2: return "Pure"; case 3: return "Const"; case FunctionControlCeiling: default: return "Bad"; } } const int MemorySemanticsCeiling = 10; const char* MemorySemanticsString(int mem) { switch (mem) { case 0: return "Relaxed"; case 1: return "SequentiallyConsistent"; case 2: return "Acquire"; case 3: return "Release"; case 4: return "UniformMemory"; case 5: return "SubgroupMemory"; case 6: return "WorkgroupLocalMemory"; case 7: return "WorkgroupGlobalMemory"; case 8: return "AtomicCounterMemory"; case 9: return "ImageMemory"; case MemorySemanticsCeiling: default: return "Bad"; } } const int MemoryAccessCeiling = 2; const char* MemoryAccessString(int mem) { switch (mem) { case 0: return "Volatile"; case 1: return "Aligned"; case MemoryAccessCeiling: default: return "Bad"; } } const int ExecutionScopeCeiling = 4; const char* ExecutionScopeString(int mem) { switch (mem) { case 0: return "CrossDevice"; case 1: return "Device"; case 2: return "Workgroup"; case 3: return "Subgroup"; case ExecutionScopeCeiling: default: return "Bad"; } } const int GroupOperationCeiling = 3; const char* GroupOperationString(int gop) { switch (gop) { case 0: return "Reduce"; case 1: return "InclusiveScan"; case 2: return "ExclusiveScan"; case GroupOperationCeiling: default: return "Bad"; } } const int KernelEnqueueFlagsCeiling = 3; const char* KernelEnqueueFlagsString(int flag) { switch (flag) { case 0: return "NoWait"; case 1: return "WaitKernel"; case 2: return "WaitWorkGroup"; case KernelEnqueueFlagsCeiling: default: return "Bad"; } } const int KernelProfilingInfoCeiling = 1; const char* KernelProfilingInfoString(int info) { switch (info) { case 0: return "CmdExecTime"; case KernelProfilingInfoCeiling: default: return "Bad"; } } const char* OpcodeString(int op) { switch (op) { case 0: return "OpNop"; case 1: return "OpSource"; case 2: return "OpSourceExtension"; case 3: return "OpExtension"; case 4: return "OpExtInstImport"; case 5: return "OpMemoryModel"; case 6: return "OpEntryPoint"; case 7: return "OpExecutionMode"; case 8: return "OpTypeVoid"; case 9: return "OpTypeBool"; case 10: return "OpTypeInt"; case 11: return "OpTypeFloat"; case 12: return "OpTypeVector"; case 13: return "OpTypeMatrix"; case 14: return "OpTypeSampler"; case 15: return "OpTypeFilter"; case 16: return "OpTypeArray"; case 17: return "OpTypeRuntimeArray"; case 18: return "OpTypeStruct"; case 19: return "OpTypeOpaque"; case 20: return "OpTypePointer"; case 21: return "OpTypeFunction"; case 22: return "OpTypeEvent"; case 23: return "OpTypeDeviceEvent"; case 24: return "OpTypeReserveId"; case 25: return "OpTypeQueue"; case 26: return "OpTypePipe"; case 27: return "OpConstantTrue"; case 28: return "OpConstantFalse"; case 29: return "OpConstant"; case 30: return "OpConstantComposite"; case 31: return "OpConstantSampler"; case 32: return "OpConstantNullPointer"; case 33: return "OpConstantNullObject"; case 34: return "OpSpecConstantTrue"; case 35: return "OpSpecConstantFalse"; case 36: return "OpSpecConstant"; case 37: return "OpSpecConstantComposite"; case 38: return "OpVariable"; case 39: return "OpVariableArray"; case 40: return "OpFunction"; case 41: return "OpFunctionParameter"; case 42: return "OpFunctionEnd"; case 43: return "OpFunctionCall"; case 44: return "OpExtInst"; case 45: return "OpUndef"; case 46: return "OpLoad"; case 47: return "OpStore"; case 48: return "OpPhi"; case 49: return "OpDecorationGroup"; case 50: return "OpDecorate"; case 51: return "OpMemberDecorate"; case 52: return "OpGroupDecorate"; case 53: return "OpGroupMemberDecorate"; case 54: return "OpName"; case 55: return "OpMemberName"; case 56: return "OpString"; case 57: return "OpLine"; case 58: return "OpVectorExtractDynamic"; case 59: return "OpVectorInsertDynamic"; case 60: return "OpVectorShuffle"; case 61: return "OpCompositeConstruct"; case 62: return "OpCompositeExtract"; case 63: return "OpCompositeInsert"; case 64: return "OpCopyObject"; case 65: return "OpCopyMemory"; case 66: return "OpCopyMemorySized"; case 67: return "OpSampler"; case 68: return "OpTextureSample"; case 69: return "OpTextureSampleDref"; case 70: return "OpTextureSampleLod"; case 71: return "OpTextureSampleProj"; case 72: return "OpTextureSampleGrad"; case 73: return "OpTextureSampleOffset"; case 74: return "OpTextureSampleProjLod"; case 75: return "OpTextureSampleProjGrad"; case 76: return "OpTextureSampleLodOffset"; case 77: return "OpTextureSampleProjOffset"; case 78: return "OpTextureSampleGradOffset"; case 79: return "OpTextureSampleProjLodOffset"; case 80: return "OpTextureSampleProjGradOffset"; case 81: return "OpTextureFetchTexelLod"; case 82: return "OpTextureFetchTexelOffset"; case 83: return "OpTextureFetchSample"; case 84: return "OpTextureFetchTexel"; case 85: return "OpTextureGather"; case 86: return "OpTextureGatherOffset"; case 87: return "OpTextureGatherOffsets"; case 88: return "OpTextureQuerySizeLod"; case 89: return "OpTextureQuerySize"; case 90: return "OpTextureQueryLod"; case 91: return "OpTextureQueryLevels"; case 92: return "OpTextureQuerySamples"; case 93: return "OpAccessChain"; case 94: return "OpInBoundsAccessChain"; case 95: return "OpSNegate"; case 96: return "OpFNegate"; case 97: return "OpNot"; case 98: return "OpAny"; case 99: return "OpAll"; case 100: return "OpConvertFToU"; case 101: return "OpConvertFToS"; case 102: return "OpConvertSToF"; case 103: return "OpConvertUToF"; case 104: return "OpUConvert"; case 105: return "OpSConvert"; case 106: return "OpFConvert"; case 107: return "OpConvertPtrToU"; case 108: return "OpConvertUToPtr"; case 109: return "OpPtrCastToGeneric"; case 110: return "OpGenericCastToPtr"; case 111: return "OpBitcast"; case 112: return "OpTranspose"; case 113: return "OpIsNan"; case 114: return "OpIsInf"; case 115: return "OpIsFinite"; case 116: return "OpIsNormal"; case 117: return "OpSignBitSet"; case 118: return "OpLessOrGreater"; case 119: return "OpOrdered"; case 120: return "OpUnordered"; case 121: return "OpArrayLength"; case 122: return "OpIAdd"; case 123: return "OpFAdd"; case 124: return "OpISub"; case 125: return "OpFSub"; case 126: return "OpIMul"; case 127: return "OpFMul"; case 128: return "OpUDiv"; case 129: return "OpSDiv"; case 130: return "OpFDiv"; case 131: return "OpUMod"; case 132: return "OpSRem"; case 133: return "OpSMod"; case 134: return "OpFRem"; case 135: return "OpFMod"; case 136: return "OpVectorTimesScalar"; case 137: return "OpMatrixTimesScalar"; case 138: return "OpVectorTimesMatrix"; case 139: return "OpMatrixTimesVector"; case 140: return "OpMatrixTimesMatrix"; case 141: return "OpOuterProduct"; case 142: return "OpDot"; case 143: return "OpShiftRightLogical"; case 144: return "OpShiftRightArithmetic"; case 145: return "OpShiftLeftLogical"; case 146: return "OpLogicalOr"; case 147: return "OpLogicalXor"; case 148: return "OpLogicalAnd"; case 149: return "OpBitwiseOr"; case 150: return "OpBitwiseXor"; case 151: return "OpBitwiseAnd"; case 152: return "OpSelect"; case 153: return "OpIEqual"; case 154: return "OpFOrdEqual"; case 155: return "OpFUnordEqual"; case 156: return "OpINotEqual"; case 157: return "OpFOrdNotEqual"; case 158: return "OpFUnordNotEqual"; case 159: return "OpULessThan"; case 160: return "OpSLessThan"; case 161: return "OpFOrdLessThan"; case 162: return "OpFUnordLessThan"; case 163: return "OpUGreaterThan"; case 164: return "OpSGreaterThan"; case 165: return "OpFOrdGreaterThan"; case 166: return "OpFUnordGreaterThan"; case 167: return "OpULessThanEqual"; case 168: return "OpSLessThanEqual"; case 169: return "OpFOrdLessThanEqual"; case 170: return "OpFUnordLessThanEqual"; case 171: return "OpUGreaterThanEqual"; case 172: return "OpSGreaterThanEqual"; case 173: return "OpFOrdGreaterThanEqual"; case 174: return "OpFUnordGreaterThanEqual"; case 175: return "OpDPdx"; case 176: return "OpDPdy"; case 177: return "OpFwidth"; case 178: return "OpDPdxFine"; case 179: return "OpDPdyFine"; case 180: return "OpFwidthFine"; case 181: return "OpDPdxCoarse"; case 182: return "OpDPdyCoarse"; case 183: return "OpFwidthCoarse"; case 184: return "OpEmitVertex"; case 185: return "OpEndPrimitive"; case 186: return "OpEmitStreamVertex"; case 187: return "OpEndStreamPrimitive"; case 188: return "OpControlBarrier"; case 189: return "OpMemoryBarrier"; case 190: return "OpImagePointer"; case 191: return "OpAtomicInit"; case 192: return "OpAtomicLoad"; case 193: return "OpAtomicStore"; case 194: return "OpAtomicExchange"; case 195: return "OpAtomicCompareExchange"; case 196: return "OpAtomicCompareExchangeWeak"; case 197: return "OpAtomicIIncrement"; case 198: return "OpAtomicIDecrement"; case 199: return "OpAtomicIAdd"; case 200: return "OpAtomicISub"; case 201: return "OpAtomicUMin"; case 202: return "OpAtomicUMax"; case 203: return "OpAtomicAnd"; case 204: return "OpAtomicOr"; case 205: return "OpAtomicXor"; case 206: return "OpLoopMerge"; case 207: return "OpSelectionMerge"; case 208: return "OpLabel"; case 209: return "OpBranch"; case 210: return "OpBranchConditional"; case 211: return "OpSwitch"; case 212: return "OpKill"; case 213: return "OpReturn"; case 214: return "OpReturnValue"; case 215: return "OpUnreachable"; case 216: return "OpLifetimeStart"; case 217: return "OpLifetimeStop"; case 218: return "OpCompileFlag"; case 219: return "OpAsyncGroupCopy"; case 220: return "OpWaitGroupEvents"; case 221: return "OpGroupAll"; case 222: return "OpGroupAny"; case 223: return "OpGroupBroadcast"; case 224: return "OpGroupIAdd"; case 225: return "OpGroupFAdd"; case 226: return "OpGroupFMin"; case 227: return "OpGroupUMin"; case 228: return "OpGroupSMin"; case 229: return "OpGroupFMax"; case 230: return "OpGroupUMax"; case 231: return "OpGroupSMax"; case 232: return "OpGenericCastToPtrExplicit"; case 233: return "OpGenericPtrMemSemantics"; case 234: return "OpReadPipe"; case 235: return "OpWritePipe"; case 236: return "OpReservedReadPipe"; case 237: return "OpReservedWritePipe"; case 238: return "OpReserveReadPipePackets"; case 239: return "OpReserveWritePipePackets"; case 240: return "OpCommitReadPipe"; case 241: return "OpCommitWritePipe"; case 242: return "OpIsValidReserveId"; case 243: return "OpGetNumPipePackets"; case 244: return "OpGetMaxPipePackets"; case 245: return "OpGroupReserveReadPipePackets"; case 246: return "OpGroupReserveWritePipePackets"; case 247: return "OpGroupCommitReadPipe"; case 248: return "OpGroupCommitWritePipe"; case 249: return "OpEnqueueMarker"; case 250: return "OpEnqueueKernel"; case 251: return "OpGetKernelNDrangeSubGroupCount"; case 252: return "OpGetKernelNDrangeMaxSubGroupSize"; case 253: return "OpGetKernelWorkGroupSize"; case 254: return "OpGetKernelPreferredWorkGroupSizeMultiple"; case 255: return "OpRetainEvent"; case 256: return "OpReleaseEvent"; case 257: return "OpCreateUserEvent"; case 258: return "OpIsValidEvent"; case 259: return "OpSetUserEventStatus"; case 260: return "OpCaptureEventProfilingInfo"; case 261: return "OpGetDefaultQueue"; case 262: return "OpBuildNDRange"; case 263: return "OpSatConvertSToU"; case 264: return "OpSatConvertUToS"; case 265: return "OpAtomicIMin"; case 266: return "OpAtomicIMax"; case OpcodeCeiling: default: return "Bad"; } } // The set of objects that hold all the instruction/operand // parameterization information. InstructionParameters InstructionDesc[OpcodeCeiling]; OperandParameters ExecutionModeOperands[ExecutionModeCeiling]; OperandParameters DecorationOperands[DecorationCeiling]; EnumDefinition OperandClassParams[OperandCount]; EnumParameters ExecutionModelParams[ExecutionModelCeiling]; EnumParameters AddressingParams[AddressingModelCeiling]; EnumParameters MemoryParams[MemoryModelCeiling]; EnumParameters ExecutionModeParams[ExecutionModeCeiling]; EnumParameters StorageParams[StorageClassCeiling]; EnumParameters SamplerAddressingModeParams[SamplerAddressingModeCeiling]; EnumParameters SamplerFilterModeParams[SamplerFilterModeCeiling]; EnumParameters FPFastMathParams[FPFastMathCeiling]; EnumParameters FPRoundingModeParams[FPRoundingModeCeiling]; EnumParameters LinkageTypeParams[LinkageTypeCeiling]; EnumParameters DecorationParams[DecorationCeiling]; EnumParameters BuiltInParams[BuiltInCeiling]; EnumParameters DimensionalityParams[DimensionCeiling]; EnumParameters FuncParamAttrParams[FuncParamAttrCeiling]; EnumParameters AccessQualifierParams[AccessQualifierCeiling]; EnumParameters GroupOperationParams[GroupOperationCeiling]; EnumParameters LoopControlParams[FunctionControlCeiling]; EnumParameters SelectionControlParams[SelectControlCeiling]; EnumParameters FunctionControlParams[FunctionControlCeiling]; EnumParameters MemorySemanticsParams[MemorySemanticsCeiling]; EnumParameters MemoryAccessParams[MemoryAccessCeiling]; EnumParameters ExecutionScopeParams[ExecutionScopeCeiling]; EnumParameters KernelEnqueueFlagsParams[KernelEnqueueFlagsCeiling]; EnumParameters KernelProfilingInfoParams[KernelProfilingInfoCeiling]; // Set up all the parameterizing descriptions of the opcodes, operands, etc. void Parameterize() { // Exceptions to having a result <id> and a resulting type <id>. // (Everything is initialized to have both). InstructionDesc[OpNop].setResultAndType(false, false); InstructionDesc[OpSource].setResultAndType(false, false); InstructionDesc[OpSourceExtension].setResultAndType(false, false); InstructionDesc[OpExtension].setResultAndType(false, false); InstructionDesc[OpExtInstImport].setResultAndType(true, false); InstructionDesc[OpMemoryModel].setResultAndType(false, false); InstructionDesc[OpEntryPoint].setResultAndType(false, false); InstructionDesc[OpExecutionMode].setResultAndType(false, false); InstructionDesc[OpTypeVoid].setResultAndType(true, false); InstructionDesc[OpTypeBool].setResultAndType(true, false); InstructionDesc[OpTypeInt].setResultAndType(true, false); InstructionDesc[OpTypeFloat].setResultAndType(true, false); InstructionDesc[OpTypeVector].setResultAndType(true, false); InstructionDesc[OpTypeMatrix].setResultAndType(true, false); InstructionDesc[OpTypeSampler].setResultAndType(true, false); InstructionDesc[OpTypeFilter].setResultAndType(true, false); InstructionDesc[OpTypeArray].setResultAndType(true, false); InstructionDesc[OpTypeRuntimeArray].setResultAndType(true, false); InstructionDesc[OpTypeStruct].setResultAndType(true, false); InstructionDesc[OpTypeOpaque].setResultAndType(true, false); InstructionDesc[OpTypePointer].setResultAndType(true, false); InstructionDesc[OpTypeFunction].setResultAndType(true, false); InstructionDesc[OpTypeEvent].setResultAndType(true, false); InstructionDesc[OpTypeDeviceEvent].setResultAndType(true, false); InstructionDesc[OpTypeReserveId].setResultAndType(true, false); InstructionDesc[OpTypeQueue].setResultAndType(true, false); InstructionDesc[OpTypePipe].setResultAndType(true, false); InstructionDesc[OpFunctionEnd].setResultAndType(false, false); InstructionDesc[OpStore].setResultAndType(false, false); InstructionDesc[OpDecorationGroup].setResultAndType(true, false); InstructionDesc[OpDecorate].setResultAndType(false, false); InstructionDesc[OpMemberDecorate].setResultAndType(false, false); InstructionDesc[OpGroupDecorate].setResultAndType(false, false); InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false); InstructionDesc[OpName].setResultAndType(false, false); InstructionDesc[OpMemberName].setResultAndType(false, false); InstructionDesc[OpString].setResultAndType(true, false); InstructionDesc[OpLine].setResultAndType(false, false); InstructionDesc[OpCopyMemory].setResultAndType(false, false); InstructionDesc[OpCopyMemorySized].setResultAndType(false, false); InstructionDesc[OpEmitVertex].setResultAndType(false, false); InstructionDesc[OpEndPrimitive].setResultAndType(false, false); InstructionDesc[OpEmitStreamVertex].setResultAndType(false, false); InstructionDesc[OpEndStreamPrimitive].setResultAndType(false, false); InstructionDesc[OpControlBarrier].setResultAndType(false, false); InstructionDesc[OpMemoryBarrier].setResultAndType(false, false); InstructionDesc[OpAtomicInit].setResultAndType(false, false); InstructionDesc[OpAtomicStore].setResultAndType(false, false); InstructionDesc[OpLoopMerge].setResultAndType(false, false); InstructionDesc[OpSelectionMerge].setResultAndType(false, false); InstructionDesc[OpLabel].setResultAndType(true, false); InstructionDesc[OpBranch].setResultAndType(false, false); InstructionDesc[OpBranchConditional].setResultAndType(false, false); InstructionDesc[OpSwitch].setResultAndType(false, false); InstructionDesc[OpKill].setResultAndType(false, false); InstructionDesc[OpReturn].setResultAndType(false, false); InstructionDesc[OpReturnValue].setResultAndType(false, false); InstructionDesc[OpUnreachable].setResultAndType(false, false); InstructionDesc[OpLifetimeStart].setResultAndType(false, false); InstructionDesc[OpLifetimeStop].setResultAndType(false, false); InstructionDesc[OpCompileFlag].setResultAndType(false, false); InstructionDesc[OpCommitReadPipe].setResultAndType(false, false); InstructionDesc[OpCommitWritePipe].setResultAndType(false, false); InstructionDesc[OpGroupCommitWritePipe].setResultAndType(false, false); InstructionDesc[OpGroupCommitReadPipe].setResultAndType(false, false); InstructionDesc[OpCaptureEventProfilingInfo].setResultAndType(false, false); InstructionDesc[OpSetUserEventStatus].setResultAndType(false, false); InstructionDesc[OpRetainEvent].setResultAndType(false, false); InstructionDesc[OpReleaseEvent].setResultAndType(false, false); // Specific additional context-dependent operands ExecutionModeOperands[ExecutionModeInvocations].push(OperandLiteralNumber, "Number of invocations"); ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'x size'"); ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'y size'"); ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'z size'"); ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'x size'"); ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'y size'"); ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'z size'"); ExecutionModeOperands[ExecutionModeOutputVertices].push(OperandLiteralNumber, "Vertex count"); ExecutionModeOperands[ExecutionModeVecTypeHint].push(OperandId, "Vector type"); DecorationOperands[DecorationStream].push(OperandLiteralNumber, "Stream number"); DecorationOperands[DecorationLocation].push(OperandLiteralNumber, "Location"); DecorationOperands[DecorationComponent].push(OperandLiteralNumber, "Component within a vector"); DecorationOperands[DecorationIndex].push(OperandLiteralNumber, "Index"); DecorationOperands[DecorationBinding].push(OperandLiteralNumber, "Binding point"); DecorationOperands[DecorationDescriptorSet].push(OperandLiteralNumber, "Descriptor set"); DecorationOperands[DecorationOffset].push(OperandLiteralNumber, "Byte offset"); DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "Declared alignment"); DecorationOperands[DecorationXfbBuffer].push(OperandLiteralNumber, "XFB Buffer number"); DecorationOperands[DecorationStride].push(OperandLiteralNumber, "Stride"); DecorationOperands[DecorationBuiltIn].push(OperandLiteralNumber, "See <<BuiltIn,*BuiltIn*>>"); DecorationOperands[DecorationFPRoundingMode].push(OperandFPRoundingMode, "floating-point rounding mode"); DecorationOperands[DecorationFPFastMathMode].push(OperandFPFastMath, "fast-math mode"); DecorationOperands[DecorationLinkageAttributes].push(OperandLiteralString, "name"); DecorationOperands[DecorationLinkageAttributes].push(OperandLinkageType, "linkage type"); DecorationOperands[DecorationFuncParamAttr].push(OperandFuncParamAttr, "function parameter attribute"); DecorationOperands[DecorationSpecId].push(OperandLiteralNumber, "Specialization Constant ID"); OperandClassParams[OperandSource].set(SourceLanguageCeiling, SourceString, 0); OperandClassParams[OperandExecutionModel].set(ExecutionModelCeiling, ExecutionModelString, ExecutionModelParams); OperandClassParams[OperandAddressing].set(AddressingModelCeiling, AddressingString, AddressingParams); OperandClassParams[OperandMemory].set(MemoryModelCeiling, MemoryString, MemoryParams); OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams); OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands); OperandClassParams[OperandStorage].set(StorageClassCeiling, StorageClassString, StorageParams); OperandClassParams[OperandDimensionality].set(DimensionCeiling, DimensionString, DimensionalityParams); OperandClassParams[OperandSamplerAddressingMode].set(SamplerAddressingModeCeiling, SamplerAddressingModeString, SamplerAddressingModeParams); OperandClassParams[OperandSamplerFilterMode].set(SamplerFilterModeCeiling, SamplerFilterModeString, SamplerFilterModeParams); OperandClassParams[OperandFPFastMath].set(FPFastMathCeiling, FPFastMathString, FPFastMathParams, true); OperandClassParams[OperandFPRoundingMode].set(FPRoundingModeCeiling, FPRoundingModeString, FPRoundingModeParams); OperandClassParams[OperandLinkageType].set(LinkageTypeCeiling, LinkageTypeString, LinkageTypeParams); OperandClassParams[OperandFuncParamAttr].set(FuncParamAttrCeiling, FuncParamAttrString, FuncParamAttrParams); OperandClassParams[OperandAccessQualifier].set(AccessQualifierCeiling, AccessQualifierString, AccessQualifierParams); OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams); OperandClassParams[OperandDecoration].setOperands(DecorationOperands); OperandClassParams[OperandBuiltIn].set(BuiltInCeiling, BuiltInString, BuiltInParams); OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true); OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true); OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true); OperandClassParams[OperandMemorySemantics].set(MemorySemanticsCeiling, MemorySemanticsString, MemorySemanticsParams, true); OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true); OperandClassParams[OperandExecutionScope].set(ExecutionScopeCeiling, ExecutionScopeString, ExecutionScopeParams); OperandClassParams[OperandGroupOperation].set(GroupOperationCeiling, GroupOperationString, GroupOperationParams); OperandClassParams[OperandKernelEnqueueFlags].set(KernelEnqueueFlagsCeiling, KernelEnqueueFlagsString, KernelEnqueueFlagsParams); OperandClassParams[OperandKernelProfilingInfo].set(KernelProfilingInfoCeiling, KernelProfilingInfoString, KernelProfilingInfoParams, true); OperandClassParams[OperandOpcode].set(OpcodeCeiling, OpcodeString, 0); AddressingParams[AddressingModelPhysical32].caps.push_back(CapAddr); AddressingParams[AddressingModelPhysical64].caps.push_back(CapAddr); MemoryParams[MemoryModelSimple].caps.push_back(CapShader); MemoryParams[MemoryModelGLSL450].caps.push_back(CapShader); MemoryParams[MemoryModelOpenCL12].caps.push_back(CapKernel); MemoryParams[MemoryModelOpenCL20].caps.push_back(CapKernel); MemoryParams[MemoryModelOpenCL21].caps.push_back(CapKernel); ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapShader); ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapTess); ExecutionModelParams[ExecutionModelTessellationEvaluation].caps.push_back(CapTess); ExecutionModelParams[ExecutionModelGeometry].caps.push_back(CapGeom); ExecutionModelParams[ExecutionModelFragment].caps.push_back(CapShader); ExecutionModelParams[ExecutionModelGLCompute].caps.push_back(CapShader); ExecutionModelParams[ExecutionModelKernel].caps.push_back(CapKernel); // Storage capabilites StorageParams[StorageClassInput].caps.push_back(CapShader); StorageParams[StorageClassUniform].caps.push_back(CapShader); StorageParams[StorageClassOutput].caps.push_back(CapShader); StorageParams[StorageClassPrivateGlobal].caps.push_back(CapShader); StorageParams[StorageClassFunction].caps.push_back(CapShader); StorageParams[StorageClassGeneric].caps.push_back(CapKernel); StorageParams[StorageClassPrivate].caps.push_back(CapKernel); StorageParams[StorageClassAtomicCounter].caps.push_back(CapShader); // Sampler Filter & Addressing mode capabilities SamplerAddressingModeParams[SamplerAddressingModeNone].caps.push_back(CapKernel); SamplerAddressingModeParams[SamplerAddressingModeClampToEdge].caps.push_back(CapKernel); SamplerAddressingModeParams[SamplerAddressingModeClamp].caps.push_back(CapKernel); SamplerAddressingModeParams[SamplerAddressingModeRepeat].caps.push_back(CapKernel); SamplerAddressingModeParams[SamplerAddressingModeRepeatMirrored].caps.push_back(CapKernel); SamplerFilterModeParams[SamplerFilterModeNearest].caps.push_back(CapKernel); SamplerFilterModeParams[SamplerFilterModeLinear].caps.push_back(CapKernel); // fast math flags capabilities for (int i = 0; i < FPFastMathCeiling; ++i) { FPFastMathParams[i].caps.push_back(CapKernel); } // fp rounding mode capabilities for (int i = 0; i < FPRoundingModeCeiling; ++i) { FPRoundingModeParams[i].caps.push_back(CapKernel); } // linkage types for (int i = 0; i < LinkageTypeCeiling; ++i) { LinkageTypeParams[i].caps.push_back(CapLink); } // function argument types for (int i = 0; i < FuncParamAttrCeiling; ++i) { FuncParamAttrParams[i].caps.push_back(CapKernel); } // function argument types for (int i = 0; i < AccessQualifierCeiling; ++i) { AccessQualifierParams[i].caps.push_back(CapKernel); } ExecutionModeParams[ExecutionModeInvocations].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeSpacingEqual].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeSpacingFractionalEven].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeSpacingFractionalOdd].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeVertexOrderCw].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeVertexOrderCcw].caps.push_back(CapTess); ExecutionModeParams[ExecutionModePixelCenterInteger].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeOriginUpperLeft].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeEarlyFragmentTests].caps.push_back(CapShader); ExecutionModeParams[ExecutionModePointMode].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeDepthReplacing].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeDepthAny].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeDepthGreater].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeDepthLess].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeDepthUnchanged].caps.push_back(CapShader); ExecutionModeParams[ExecutionModeLocalSizeHint].caps.push_back(CapKernel); ExecutionModeParams[ExecutionModeInputPoints].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeInputLines].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeInputLinesAdjacency].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeInputTriangles].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeInputTriangles].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeInputTrianglesAdjacency].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeInputQuads].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeInputIsolines].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapTess); ExecutionModeParams[ExecutionModeOutputPoints].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeOutputLineStrip].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeOutputTriangleStrip].caps.push_back(CapGeom); ExecutionModeParams[ExecutionModeVecTypeHint].caps.push_back(CapKernel); ExecutionModeParams[ExecutionModeContractionOff].caps.push_back(CapKernel); DecorationParams[DecorationPrecisionLow].caps.push_back(CapShader); DecorationParams[DecorationPrecisionMedium].caps.push_back(CapShader); DecorationParams[DecorationPrecisionHigh].caps.push_back(CapShader); DecorationParams[DecorationBlock].caps.push_back(CapShader); DecorationParams[DecorationBufferBlock].caps.push_back(CapShader); DecorationParams[DecorationRowMajor].caps.push_back(CapMatrix); DecorationParams[DecorationColMajor].caps.push_back(CapMatrix); DecorationParams[DecorationGLSLShared].caps.push_back(CapShader); DecorationParams[DecorationGLSLStd140].caps.push_back(CapShader); DecorationParams[DecorationGLSLStd430].caps.push_back(CapShader); DecorationParams[DecorationGLSLPacked].caps.push_back(CapShader); DecorationParams[DecorationSmooth].caps.push_back(CapShader); DecorationParams[DecorationNoperspective].caps.push_back(CapShader); DecorationParams[DecorationFlat].caps.push_back(CapShader); DecorationParams[DecorationPatch].caps.push_back(CapTess); DecorationParams[DecorationCentroid].caps.push_back(CapShader); DecorationParams[DecorationSample].caps.push_back(CapShader); DecorationParams[DecorationInvariant].caps.push_back(CapShader); DecorationParams[DecorationConstant].caps.push_back(CapKernel); DecorationParams[DecorationUniform].caps.push_back(CapShader); DecorationParams[DecorationCPacked].caps.push_back(CapKernel); DecorationParams[DecorationSaturatedConversion].caps.push_back(CapKernel); DecorationParams[DecorationStream].caps.push_back(CapGeom); DecorationParams[DecorationLocation].caps.push_back(CapShader); DecorationParams[DecorationComponent].caps.push_back(CapShader); DecorationParams[DecorationIndex].caps.push_back(CapShader); DecorationParams[DecorationBinding].caps.push_back(CapShader); DecorationParams[DecorationDescriptorSet].caps.push_back(CapShader); DecorationParams[DecorationXfbBuffer].caps.push_back(CapShader); DecorationParams[DecorationStride].caps.push_back(CapShader); DecorationParams[DecorationBuiltIn].caps.push_back(CapShader); DecorationParams[DecorationFuncParamAttr].caps.push_back(CapKernel); DecorationParams[DecorationFPRoundingMode].caps.push_back(CapKernel); DecorationParams[DecorationFPFastMathMode].caps.push_back(CapKernel); DecorationParams[DecorationLinkageAttributes].caps.push_back(CapLink); DecorationParams[DecorationSpecId].caps.push_back(CapShader); BuiltInParams[BuiltInPosition].caps.push_back(CapShader); BuiltInParams[BuiltInPointSize].caps.push_back(CapShader); BuiltInParams[BuiltInClipVertex].caps.push_back(CapShader); BuiltInParams[BuiltInClipDistance].caps.push_back(CapShader); BuiltInParams[BuiltInCullDistance].caps.push_back(CapShader); BuiltInParams[BuiltInVertexId].caps.push_back(CapShader); BuiltInParams[BuiltInInstanceId].caps.push_back(CapShader); BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapGeom); BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapTess); BuiltInParams[BuiltInInvocationId].caps.push_back(CapGeom); BuiltInParams[BuiltInInvocationId].caps.push_back(CapTess); BuiltInParams[BuiltInLayer].caps.push_back(CapGeom); BuiltInParams[BuiltInViewportIndex].caps.push_back(CapGeom); BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapTess); BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapTess); BuiltInParams[BuiltInTessCoord].caps.push_back(CapTess); BuiltInParams[BuiltInPatchVertices].caps.push_back(CapTess); BuiltInParams[BuiltInFragCoord].caps.push_back(CapShader); BuiltInParams[BuiltInPointCoord].caps.push_back(CapShader); BuiltInParams[BuiltInFrontFacing].caps.push_back(CapShader); BuiltInParams[BuiltInSampleId].caps.push_back(CapShader); BuiltInParams[BuiltInSamplePosition].caps.push_back(CapShader); BuiltInParams[BuiltInSampleMask].caps.push_back(CapShader); BuiltInParams[BuiltInFragColor].caps.push_back(CapShader); BuiltInParams[BuiltInFragDepth].caps.push_back(CapShader); BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapShader); BuiltInParams[BuiltInLocalInvocationIndex].caps.push_back(CapShader); BuiltInParams[BuiltInWorkDim].caps.push_back(CapKernel); BuiltInParams[BuiltInGlobalSize].caps.push_back(CapKernel); BuiltInParams[BuiltInEnqueuedWorkgroupSize].caps.push_back(CapKernel); BuiltInParams[BuiltInGlobalOffset].caps.push_back(CapKernel); BuiltInParams[BuiltInGlobalLinearId].caps.push_back(CapKernel); BuiltInParams[BuiltInWorkgroupLinearId].caps.push_back(CapKernel); BuiltInParams[BuiltInSubgroupSize].caps.push_back(CapKernel); BuiltInParams[BuiltInSubgroupMaxSize].caps.push_back(CapKernel); BuiltInParams[BuiltInNumSubgroups].caps.push_back(CapKernel); BuiltInParams[BuiltInNumEnqueuedSubgroups].caps.push_back(CapKernel); BuiltInParams[BuiltInSubgroupId].caps.push_back(CapKernel); BuiltInParams[BuiltInSubgroupLocalInvocationId].caps.push_back(CapKernel); DimensionalityParams[DimCube].caps.push_back(CapShader); DimensionalityParams[DimRect].caps.push_back(CapShader); // Group Operations for (int i = 0; i < GroupOperationCeiling; ++i) { GroupOperationParams[i].caps.push_back(CapKernel); } // Enqueue flags for (int i = 0; i < KernelEnqueueFlagsCeiling; ++i) { KernelEnqueueFlagsParams[i].caps.push_back(CapKernel); } // Profiling info KernelProfilingInfoParams[0].caps.push_back(CapKernel); // set name of operator, an initial set of <id> style operands, and the description InstructionDesc[OpSource].operands.push(OperandSource, ""); InstructionDesc[OpSource].operands.push(OperandLiteralNumber, "'Version'"); InstructionDesc[OpSourceExtension].operands.push(OperandLiteralString, "'Extension'"); InstructionDesc[OpName].operands.push(OperandId, "'Target'"); InstructionDesc[OpName].operands.push(OperandLiteralString, "'Name'"); InstructionDesc[OpMemberName].operands.push(OperandId, "'Type'"); InstructionDesc[OpMemberName].operands.push(OperandLiteralNumber, "'Member'"); InstructionDesc[OpMemberName].operands.push(OperandLiteralString, "'Name'"); InstructionDesc[OpString].operands.push(OperandLiteralString, "'String'"); InstructionDesc[OpLine].operands.push(OperandId, "'Target'"); InstructionDesc[OpLine].operands.push(OperandId, "'File'"); InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Line'"); InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Column'"); InstructionDesc[OpExtension].operands.push(OperandLiteralString, "'Name'"); InstructionDesc[OpExtInstImport].operands.push(OperandLiteralString, "'Name'"); InstructionDesc[OpMemoryModel].operands.push(OperandAddressing, ""); InstructionDesc[OpMemoryModel].operands.push(OperandMemory, ""); InstructionDesc[OpEntryPoint].operands.push(OperandExecutionModel, ""); InstructionDesc[OpEntryPoint].operands.push(OperandId, "'Entry Point'"); InstructionDesc[OpExecutionMode].operands.push(OperandId, "'Entry Point'"); InstructionDesc[OpExecutionMode].operands.push(OperandExecutionMode, "'Mode'"); InstructionDesc[OpExecutionMode].operands.push(OperandVariableLiterals, "See <<Execution Mode,Execution Mode>>"); InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Width'"); InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Signedness'"); InstructionDesc[OpTypeFloat].operands.push(OperandLiteralNumber, "'Width'"); InstructionDesc[OpTypeVector].operands.push(OperandId, "'Component type'"); InstructionDesc[OpTypeVector].operands.push(OperandLiteralNumber, "'Component count'"); InstructionDesc[OpTypeMatrix].capabilities.push_back(CapMatrix); InstructionDesc[OpTypeMatrix].operands.push(OperandId, "'Column type'"); InstructionDesc[OpTypeMatrix].operands.push(OperandLiteralNumber, "'Column count'"); InstructionDesc[OpTypeSampler].operands.push(OperandId, "'Sampled Type'"); InstructionDesc[OpTypeSampler].operands.push(OperandDimensionality, ""); InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber, "'Content'"); InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber, "'Arrayed'"); InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber, "'Compare'"); InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber, "'MS'"); InstructionDesc[OpTypeSampler].operands.push(OperandOptionalId, "'Qualifier'"); InstructionDesc[OpTypeArray].operands.push(OperandId, "'Element type'"); InstructionDesc[OpTypeArray].operands.push(OperandId, "'Length'"); InstructionDesc[OpTypeRuntimeArray].capabilities.push_back(CapShader); InstructionDesc[OpTypeRuntimeArray].operands.push(OperandId, "'Element type'"); InstructionDesc[OpTypeStruct].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n..."); InstructionDesc[OpTypeOpaque].capabilities.push_back(CapKernel); InstructionDesc[OpTypeOpaque].operands.push(OperandLiteralString, "The name of the opaque type."); InstructionDesc[OpTypePointer].operands.push(OperandStorage, ""); InstructionDesc[OpTypePointer].operands.push(OperandId, "'Type'"); InstructionDesc[OpTypeEvent].capabilities.push_back(CapKernel); InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapKernel); InstructionDesc[OpTypeReserveId].capabilities.push_back(CapKernel); InstructionDesc[OpTypeQueue].capabilities.push_back(CapKernel); InstructionDesc[OpTypePipe].operands.push(OperandId, "'Type'"); InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier, "'Qualifier'"); InstructionDesc[OpTypePipe].capabilities.push_back(CapKernel); InstructionDesc[OpTypeFunction].operands.push(OperandId, "'Return Type'"); InstructionDesc[OpTypeFunction].operands.push(OperandVariableIds, "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..."); InstructionDesc[OpConstant].operands.push(OperandVariableLiterals, "'Value'"); InstructionDesc[OpConstantComposite].operands.push(OperandVariableIds, "'Constituents'"); InstructionDesc[OpConstantNullPointer].capabilities.push_back(CapAddr); InstructionDesc[OpConstantNullObject].capabilities.push_back(CapKernel); InstructionDesc[OpConstantSampler].capabilities.push_back(CapKernel); InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Mode'"); InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Param'"); InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Filter'"); InstructionDesc[OpSpecConstantTrue].capabilities.push_back(CapShader); InstructionDesc[OpSpecConstantFalse].capabilities.push_back(CapShader); InstructionDesc[OpSpecConstant].operands.push(OperandVariableLiterals, "'Value'"); InstructionDesc[OpSpecConstant].capabilities.push_back(CapShader); InstructionDesc[OpSpecConstantComposite].operands.push(OperandVariableIds, "'Constituents'"); InstructionDesc[OpSpecConstantComposite].capabilities.push_back(CapShader); InstructionDesc[OpVariable].operands.push(OperandStorage, ""); InstructionDesc[OpVariable].operands.push(OperandOptionalId, "'Initializer'"); InstructionDesc[OpVariableArray].operands.push(OperandStorage, ""); InstructionDesc[OpVariableArray].operands.push(OperandId, "'N'"); InstructionDesc[OpVariableArray].capabilities.push_back(CapAddr); InstructionDesc[OpFunction].operands.push(OperandFunction, ""); InstructionDesc[OpFunction].operands.push(OperandId, "'Function Type'"); InstructionDesc[OpFunctionCall].operands.push(OperandId, "'Function'"); InstructionDesc[OpFunctionCall].operands.push(OperandVariableIds, "'Argument 0', +\n'Argument 1', +\n..."); InstructionDesc[OpExtInst].operands.push(OperandId, "'Set'"); InstructionDesc[OpExtInst].operands.push(OperandLiteralNumber, "'Instruction'"); InstructionDesc[OpExtInst].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n..."); InstructionDesc[OpLoad].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLoad].operands.push(OperandVariableLiterals, "'Memory Access'"); InstructionDesc[OpStore].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpStore].operands.push(OperandId, "'Object'"); InstructionDesc[OpStore].operands.push(OperandVariableLiterals, "'Memory Access'"); InstructionDesc[OpPhi].operands.push(OperandVariableIds, ""); InstructionDesc[OpDecorate].operands.push(OperandId, "'Target'"); InstructionDesc[OpDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>."); InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure type'"); InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'"); InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>."); InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration group'"); InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Target', 'Target', ..."); InstructionDesc[OpGroupMemberDecorate].operands.push(OperandId, "'Decoration group'"); InstructionDesc[OpGroupMemberDecorate].operands.push(OperandVariableIds, "'Target', 'Target', ..."); InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Index'"); InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Component'"); InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Index'"); InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 1'"); InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 2'"); InstructionDesc[OpVectorShuffle].operands.push(OperandVariableLiterals, "'Components'"); InstructionDesc[OpCompositeConstruct].operands.push(OperandVariableIds, "'Constituents'"); InstructionDesc[OpCompositeExtract].operands.push(OperandId, "'Composite'"); InstructionDesc[OpCompositeExtract].operands.push(OperandVariableLiterals, "'Indexes'"); InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Object'"); InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Composite'"); InstructionDesc[OpCompositeInsert].operands.push(OperandVariableLiterals, "'Indexes'"); InstructionDesc[OpCopyObject].operands.push(OperandId, "'Operand'"); InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Target'"); InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Source'"); InstructionDesc[OpCopyMemory].operands.push(OperandVariableLiterals, "'Memory Access'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Target'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Source'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Size'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandVariableLiterals, "'Memory Access'"); InstructionDesc[OpCopyMemorySized].capabilities.push_back(CapAddr); InstructionDesc[OpSampler].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpSampler].operands.push(OperandId, "'Filter'"); InstructionDesc[OpTextureSample].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSample].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSample].operands.push(OperandOptionalId, "['Bias']"); InstructionDesc[OpTextureSample].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleDref].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleDref].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleDref].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpTextureSampleDref].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleLod].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleLod].operands.push(OperandId, "'Level of Detail'"); InstructionDesc[OpTextureSampleLod].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleProj].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleProj].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleProj].operands.push(OperandOptionalId, "['Bias']"); InstructionDesc[OpTextureSampleProj].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleGrad].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleGrad].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleGrad].operands.push(OperandId, "'dx'"); InstructionDesc[OpTextureSampleGrad].operands.push(OperandId, "'dy'"); InstructionDesc[OpTextureSampleGrad].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureSampleOffset].operands.push(OperandOptionalId, "['Bias']"); InstructionDesc[OpTextureSampleOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleProjLod].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleProjLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleProjLod].operands.push(OperandId, "'Level of Detail'"); InstructionDesc[OpTextureSampleProjLod].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId, "'dx'"); InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId, "'dy'"); InstructionDesc[OpTextureSampleProjGrad].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId, "'Level of Detail'"); InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureSampleLodOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandOptionalId, "['Bias']"); InstructionDesc[OpTextureSampleProjOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId, "'dx'"); InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId, "'dy'"); InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureSampleGradOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId, "'Level of Detail'"); InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureSampleProjLodOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId, "'dx'"); InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId, "'dy'"); InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureSampleProjGradOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureFetchTexelLod].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureFetchTexelLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureFetchTexelLod].operands.push(OperandId, "'Level of Detail'"); InstructionDesc[OpTextureFetchTexelLod].capabilities.push_back(CapShader); InstructionDesc[OpTextureFetchTexelOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureFetchTexelOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureFetchTexelOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureFetchTexelOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureFetchSample].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureFetchSample].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureFetchSample].operands.push(OperandId, "'Sample'"); InstructionDesc[OpTextureFetchSample].capabilities.push_back(CapShader); InstructionDesc[OpTextureFetchTexel].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureFetchTexel].operands.push(OperandId, "'Element'"); InstructionDesc[OpTextureFetchTexel].capabilities.push_back(CapShader); InstructionDesc[OpTextureGather].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureGather].operands.push(OperandId, "'Component'"); InstructionDesc[OpTextureGather].capabilities.push_back(CapShader); InstructionDesc[OpTextureGatherOffset].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureGatherOffset].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureGatherOffset].operands.push(OperandId, "'Component'"); InstructionDesc[OpTextureGatherOffset].operands.push(OperandId, "'Offset'"); InstructionDesc[OpTextureGatherOffset].capabilities.push_back(CapShader); InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId, "'Component'"); InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId, "'Offsets'"); InstructionDesc[OpTextureGatherOffsets].capabilities.push_back(CapShader); InstructionDesc[OpTextureQuerySizeLod].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureQuerySizeLod].operands.push(OperandId, "'Level of Detail'"); InstructionDesc[OpTextureQuerySizeLod].capabilities.push_back(CapShader); InstructionDesc[OpTextureQuerySize].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureQuerySize].capabilities.push_back(CapShader); InstructionDesc[OpTextureQueryLod].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureQueryLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpTextureQueryLod].capabilities.push_back(CapShader); InstructionDesc[OpTextureQueryLevels].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureQueryLevels].capabilities.push_back(CapShader); InstructionDesc[OpTextureQuerySamples].operands.push(OperandId, "'Sampler'"); InstructionDesc[OpTextureQuerySamples].capabilities.push_back(CapShader); InstructionDesc[OpAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpAccessChain].operands.push(OperandVariableIds, "'Indexes'"); InstructionDesc[OpInBoundsAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpInBoundsAccessChain].operands.push(OperandVariableIds, "'Indexes'"); InstructionDesc[OpSNegate].operands.push(OperandId, "'Operand'"); InstructionDesc[OpFNegate].operands.push(OperandId, "'Operand'"); InstructionDesc[OpNot].operands.push(OperandId, "'Operand'"); InstructionDesc[OpAny].operands.push(OperandId, "'Vector'"); InstructionDesc[OpAll].operands.push(OperandId, "'Vector'"); InstructionDesc[OpConvertFToU].operands.push(OperandId, "'Float Value'"); InstructionDesc[OpConvertFToS].operands.push(OperandId, "'Float Value'"); InstructionDesc[OpConvertSToF].operands.push(OperandId, "'Signed Value'"); InstructionDesc[OpConvertUToF].operands.push(OperandId, "'Unsigned value'"); InstructionDesc[OpUConvert].operands.push(OperandId, "'Unsigned value'"); InstructionDesc[OpSConvert].operands.push(OperandId, "'Signed Value'"); InstructionDesc[OpFConvert].operands.push(OperandId, "'Float Value'"); InstructionDesc[OpSatConvertSToU].operands.push(OperandId, "'Signed Value'"); InstructionDesc[OpSatConvertSToU].capabilities.push_back(CapKernel); InstructionDesc[OpSatConvertUToS].operands.push(OperandId, "'Unsigned Value'"); InstructionDesc[OpSatConvertUToS].capabilities.push_back(CapKernel); InstructionDesc[OpConvertPtrToU].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpConvertPtrToU].capabilities.push_back(CapAddr); InstructionDesc[OpConvertUToPtr].operands.push(OperandId, "'Integer value'"); InstructionDesc[OpConvertUToPtr].capabilities.push_back(CapAddr); InstructionDesc[OpPtrCastToGeneric].operands.push(OperandId, "'Source pointer'"); InstructionDesc[OpPtrCastToGeneric].capabilities.push_back(CapKernel); InstructionDesc[OpGenericCastToPtr].operands.push(OperandId, "'Source pointer'"); InstructionDesc[OpGenericCastToPtr].capabilities.push_back(CapKernel); InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandId, "'Source pointer'"); InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandStorage, "'storage'"); InstructionDesc[OpGenericCastToPtrExplicit].capabilities.push_back(CapKernel); InstructionDesc[OpGenericPtrMemSemantics].operands.push(OperandId, "'ptr'"); InstructionDesc[OpGenericPtrMemSemantics].capabilities.push_back(CapKernel); InstructionDesc[OpBitcast].operands.push(OperandId, "'Operand'"); InstructionDesc[OpTranspose].capabilities.push_back(CapMatrix); InstructionDesc[OpTranspose].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpIsNan].operands.push(OperandId, "'x'"); InstructionDesc[OpIsInf].operands.push(OperandId, "'x'"); InstructionDesc[OpIsFinite].capabilities.push_back(CapKernel); InstructionDesc[OpIsFinite].operands.push(OperandId, "'x'"); InstructionDesc[OpIsNormal].capabilities.push_back(CapKernel); InstructionDesc[OpIsNormal].operands.push(OperandId, "'x'"); InstructionDesc[OpSignBitSet].capabilities.push_back(CapKernel); InstructionDesc[OpSignBitSet].operands.push(OperandId, "'x'"); InstructionDesc[OpLessOrGreater].capabilities.push_back(CapKernel); InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'x'"); InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'y'"); InstructionDesc[OpOrdered].capabilities.push_back(CapKernel); InstructionDesc[OpOrdered].operands.push(OperandId, "'x'"); InstructionDesc[OpOrdered].operands.push(OperandId, "'y'"); InstructionDesc[OpUnordered].capabilities.push_back(CapKernel); InstructionDesc[OpUnordered].operands.push(OperandId, "'x'"); InstructionDesc[OpUnordered].operands.push(OperandId, "'y'"); InstructionDesc[OpArrayLength].operands.push(OperandId, "'Structure'"); InstructionDesc[OpArrayLength].operands.push(OperandLiteralNumber, "'Array member'"); InstructionDesc[OpArrayLength].capabilities.push_back(CapShader); InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpISub].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpISub].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Scalar'"); InstructionDesc[OpMatrixTimesScalar].capabilities.push_back(CapMatrix); InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Scalar'"); InstructionDesc[OpVectorTimesMatrix].capabilities.push_back(CapMatrix); InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpMatrixTimesVector].capabilities.push_back(CapMatrix); InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Vector'"); InstructionDesc[OpMatrixTimesMatrix].capabilities.push_back(CapMatrix); InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'LeftMatrix'"); InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'RightMatrix'"); InstructionDesc[OpOuterProduct].capabilities.push_back(CapMatrix); InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 1'"); InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 2'"); InstructionDesc[OpDot].operands.push(OperandId, "'Vector 1'"); InstructionDesc[OpDot].operands.push(OperandId, "'Vector 2'"); InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpLogicalXor].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpLogicalXor].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSelect].operands.push(OperandId, "'Condition'"); InstructionDesc[OpSelect].operands.push(OperandId, "'Object 1'"); InstructionDesc[OpSelect].operands.push(OperandId, "'Object 2'"); InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 2'"); InstructionDesc[OpDPdx].capabilities.push_back(CapShader); InstructionDesc[OpDPdx].operands.push(OperandId, "'P'"); InstructionDesc[OpDPdy].capabilities.push_back(CapShader); InstructionDesc[OpDPdy].operands.push(OperandId, "'P'"); InstructionDesc[OpFwidth].capabilities.push_back(CapShader); InstructionDesc[OpFwidth].operands.push(OperandId, "'P'"); InstructionDesc[OpDPdxFine].capabilities.push_back(CapShader); InstructionDesc[OpDPdxFine].operands.push(OperandId, "'P'"); InstructionDesc[OpDPdyFine].capabilities.push_back(CapShader); InstructionDesc[OpDPdyFine].operands.push(OperandId, "'P'"); InstructionDesc[OpFwidthFine].capabilities.push_back(CapShader); InstructionDesc[OpFwidthFine].operands.push(OperandId, "'P'"); InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapShader); InstructionDesc[OpDPdxCoarse].operands.push(OperandId, "'P'"); InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapShader); InstructionDesc[OpDPdyCoarse].operands.push(OperandId, "'P'"); InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapShader); InstructionDesc[OpFwidthCoarse].operands.push(OperandId, "'P'"); InstructionDesc[OpEmitVertex].capabilities.push_back(CapGeom); InstructionDesc[OpEndPrimitive].capabilities.push_back(CapGeom); InstructionDesc[OpEmitStreamVertex].operands.push(OperandId, "'Stream'"); InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapGeom); InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId, "'Stream'"); InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapGeom); InstructionDesc[OpControlBarrier].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpMemoryBarrier].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpMemoryBarrier].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpImagePointer].operands.push(OperandId, "'Image'"); InstructionDesc[OpImagePointer].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImagePointer].operands.push(OperandId, "'Sample'"); InstructionDesc[OpAtomicInit].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicInit].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicLoad].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicLoad].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicLoad].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicStore].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicStore].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicExchange].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicExchange].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicCompareExchange].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Comparator'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Comparator'"); InstructionDesc[OpAtomicIIncrement].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicIIncrement].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicIIncrement].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicIDecrement].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicIDecrement].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicIDecrement].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicIAdd].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicIAdd].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicISub].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicISub].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicUMin].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicUMin].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicUMax].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicUMax].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicIMin].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicIMin].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicIMin].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicIMin].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicIMax].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicIMax].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicIMax].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicIMax].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicAnd].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicAnd].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicOr].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicOr].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicXor].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAtomicXor].operands.push(OperandMemorySemantics, "'Semantics'"); InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Value'"); InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Label'"); InstructionDesc[OpLoopMerge].operands.push(OperandLoop, ""); InstructionDesc[OpSelectionMerge].operands.push(OperandId, "'Label'"); InstructionDesc[OpSelectionMerge].operands.push(OperandSelect, ""); InstructionDesc[OpBranch].operands.push(OperandId, "'Target Label'"); InstructionDesc[OpBranchConditional].operands.push(OperandId, "'Condition'"); InstructionDesc[OpBranchConditional].operands.push(OperandId, "'True Label'"); InstructionDesc[OpBranchConditional].operands.push(OperandId, "'False Label'"); InstructionDesc[OpBranchConditional].operands.push(OperandVariableLiterals, "'Branch weights'"); InstructionDesc[OpSwitch].operands.push(OperandId, "'Selector'"); InstructionDesc[OpSwitch].operands.push(OperandId, "'Default'"); InstructionDesc[OpSwitch].operands.push(OperandVariableLiteralId, "'Target'"); InstructionDesc[OpKill].capabilities.push_back(CapShader); InstructionDesc[OpReturnValue].operands.push(OperandId, "'Value'"); InstructionDesc[OpUnreachable].capabilities.push_back(CapKernel); InstructionDesc[OpLifetimeStart].operands.push(OperandId, ""); InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber, ""); InstructionDesc[OpLifetimeStop].operands.push(OperandId, ""); InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber, ""); InstructionDesc[OpCompileFlag].capabilities.push_back(CapKernel); InstructionDesc[OpCompileFlag].operands.push(OperandLiteralString, "'Flag'"); InstructionDesc[OpAsyncGroupCopy].capabilities.push_back(CapKernel); InstructionDesc[OpAsyncGroupCopy].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Destination'"); InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Source'"); InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Num Elements'"); InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Stride'"); InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId, "'Event'"); InstructionDesc[OpWaitGroupEvents].capabilities.push_back(CapKernel); InstructionDesc[OpWaitGroupEvents].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpWaitGroupEvents].operands.push(OperandId, "'Num Events'"); InstructionDesc[OpWaitGroupEvents].operands.push(OperandId, "'Events List'"); InstructionDesc[OpGroupAll].capabilities.push_back(CapKernel); InstructionDesc[OpGroupAll].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupAll].operands.push(OperandId, "'Predicate'"); InstructionDesc[OpGroupAny].capabilities.push_back(CapKernel); InstructionDesc[OpGroupAny].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupAny].operands.push(OperandId, "'Predicate'"); InstructionDesc[OpGroupBroadcast].capabilities.push_back(CapKernel); InstructionDesc[OpGroupBroadcast].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'Value'"); InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'LocalId'"); InstructionDesc[OpGroupIAdd].capabilities.push_back(CapKernel); InstructionDesc[OpGroupIAdd].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupIAdd].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupIAdd].operands.push(OperandId, "'X'"); InstructionDesc[OpGroupFAdd].capabilities.push_back(CapKernel); InstructionDesc[OpGroupFAdd].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupFAdd].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFAdd].operands.push(OperandId, "'X'"); InstructionDesc[OpGroupUMin].capabilities.push_back(CapKernel); InstructionDesc[OpGroupUMin].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupUMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMin].operands.push(OperandId, "'X'"); InstructionDesc[OpGroupSMin].capabilities.push_back(CapKernel); InstructionDesc[OpGroupSMin].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupSMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMin].operands.push(OperandId, "X"); InstructionDesc[OpGroupFMin].capabilities.push_back(CapKernel); InstructionDesc[OpGroupFMin].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupFMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMin].operands.push(OperandId, "X"); InstructionDesc[OpGroupUMax].capabilities.push_back(CapKernel); InstructionDesc[OpGroupUMax].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupUMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMax].operands.push(OperandId, "X"); InstructionDesc[OpGroupSMax].capabilities.push_back(CapKernel); InstructionDesc[OpGroupSMax].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupSMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMax].operands.push(OperandId, "X"); InstructionDesc[OpGroupFMax].capabilities.push_back(CapKernel); InstructionDesc[OpGroupFMax].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupFMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMax].operands.push(OperandId, "X"); InstructionDesc[OpReadPipe].capabilities.push_back(CapKernel); InstructionDesc[OpReadPipe].operands.push(OperandId, "'p'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'ptr'"); InstructionDesc[OpWritePipe].capabilities.push_back(CapKernel); InstructionDesc[OpWritePipe].operands.push(OperandId, "'p'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'ptr'"); InstructionDesc[OpReservedReadPipe].capabilities.push_back(CapKernel); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'p'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'reserve_id'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'index'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'ptr'"); InstructionDesc[OpReservedWritePipe].capabilities.push_back(CapKernel); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'p'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'reserve_id'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'index'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'ptr'"); InstructionDesc[OpReserveReadPipePackets].capabilities.push_back(CapKernel); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'p'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'num_packets'"); InstructionDesc[OpReserveWritePipePackets].capabilities.push_back(CapKernel); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'p'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'num_packets'"); InstructionDesc[OpCommitReadPipe].capabilities.push_back(CapKernel); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'p'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'reserve_id'"); InstructionDesc[OpCommitWritePipe].capabilities.push_back(CapKernel); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'p'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'reserve_id'"); InstructionDesc[OpIsValidReserveId].capabilities.push_back(CapKernel); InstructionDesc[OpIsValidReserveId].operands.push(OperandId, "'reserve_id'"); InstructionDesc[OpGetNumPipePackets].capabilities.push_back(CapKernel); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'p'"); InstructionDesc[OpGetMaxPipePackets].capabilities.push_back(CapKernel); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'p'"); InstructionDesc[OpGroupReserveReadPipePackets].capabilities.push_back(CapKernel); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'p'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'num_packets'"); InstructionDesc[OpGroupReserveWritePipePackets].capabilities.push_back(CapKernel); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'p'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'num_packets'"); InstructionDesc[OpGroupCommitReadPipe].capabilities.push_back(CapKernel); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'p'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'reserve_id'"); InstructionDesc[OpGroupCommitWritePipe].capabilities.push_back(CapKernel); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandExecutionScope, "'Scope'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'p'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'reserve_id'"); InstructionDesc[OpBuildNDRange].capabilities.push_back(CapKernel); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkSize'"); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'LocalWorkSize'"); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkOffset'"); InstructionDesc[OpGetDefaultQueue].capabilities.push_back(CapKernel); InstructionDesc[OpCaptureEventProfilingInfo].capabilities.push_back(CapKernel); InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'event'"); InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandKernelProfilingInfo, "'info'"); InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'value'"); InstructionDesc[OpSetUserEventStatus].capabilities.push_back(CapKernel); InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'event'"); InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'status'"); InstructionDesc[OpIsValidEvent].capabilities.push_back(CapKernel); InstructionDesc[OpIsValidEvent].operands.push(OperandId, "'event'"); InstructionDesc[OpCreateUserEvent].capabilities.push_back(CapKernel); InstructionDesc[OpRetainEvent].capabilities.push_back(CapKernel); InstructionDesc[OpRetainEvent].operands.push(OperandId, "'event'"); InstructionDesc[OpReleaseEvent].capabilities.push_back(CapKernel); InstructionDesc[OpReleaseEvent].operands.push(OperandId, "'event'"); InstructionDesc[OpGetKernelWorkGroupSize].capabilities.push_back(CapKernel); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].capabilities.push_back(CapKernel); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].capabilities.push_back(CapKernel); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'ND Range'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].capabilities.push_back(CapKernel); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'ND Range'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpEnqueueKernel].capabilities.push_back(CapKernel); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'q'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandKernelEnqueueFlags, "'flags'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'ND Range'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Num Events'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Wait Events'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Ret Event'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Align'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandVariableIds, "'Local Size'"); InstructionDesc[OpEnqueueMarker].capabilities.push_back(CapKernel); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'q'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'"); } }; // end spv namespace
48.200472
146
0.745569
tmpvar
4154af50e799c60e9b8af8eb53642ba3d5dc51c5
362
hpp
C++
CookieEngine/include/Gameplay/AIBehavior.hpp
qbleuse/Cookie-Engine
705d19d9e4c79e935e32244759ab63523dfbe6c4
[ "CC-BY-4.0" ]
null
null
null
CookieEngine/include/Gameplay/AIBehavior.hpp
qbleuse/Cookie-Engine
705d19d9e4c79e935e32244759ab63523dfbe6c4
[ "CC-BY-4.0" ]
null
null
null
CookieEngine/include/Gameplay/AIBehavior.hpp
qbleuse/Cookie-Engine
705d19d9e4c79e935e32244759ab63523dfbe6c4
[ "CC-BY-4.0" ]
null
null
null
#ifndef _AIBEHAVIOR_HPP__ #define _AIBEHAVIOR_HPP__ #include <algorithm> #include "Gameplay/AIStep.hpp" namespace Cookie { namespace Gameplay { struct AIBehavior { std::string name {"No Name"}; //for UI and Save std::vector<AIStep> steps; void Clear() { name = "No Name"; steps.clear(); } }; } } #endif // !_AIBEHAVIOR_HPP__
14.48
52
0.651934
qbleuse
415501e4aa84deb3064f3ae591a1c91288037ae0
4,686
cpp
C++
esp32_simple_ota.cpp
willson556/esp32-https-ota
9ecb2e8cbde06e89771445a91f5e5a7c787875a6
[ "MIT" ]
1
2020-03-17T01:59:58.000Z
2020-03-17T01:59:58.000Z
esp32_simple_ota.cpp
willson556/esp32-simple-ota
9ecb2e8cbde06e89771445a91f5e5a7c787875a6
[ "MIT" ]
null
null
null
esp32_simple_ota.cpp
willson556/esp32-simple-ota
9ecb2e8cbde06e89771445a91f5e5a7c787875a6
[ "MIT" ]
null
null
null
#include "esp32_simple_ota.hpp" #include <cstdint> #include <cstring> #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include <esp_log.h> #include <esp_https_ota.h> #include <cJSON.h> static const char *TAG = "ota"; extern const uint8_t server_cert_pem_start[] asm("_binary_ca_cert_pem_start"); extern const uint8_t server_cert_pem_end[] asm("_binary_ca_cert_pem_end"); namespace { void delay(TickType_t milliseconds) { vTaskDelay(milliseconds / portTICK_PERIOD_MS); } char* copy_response(esp_http_client_handle_t client, size_t content_length) { char* buffer = new char[content_length + 1]; if (buffer) { int read_len = esp_http_client_read(client, buffer, content_length); buffer[read_len] = 0; } return buffer; } } // namespace namespace esp32_simple_ota { esp_err_t ota_http_event_handler(esp_http_client_event_t *e) { return 0; } void OTAManager::thread_func() { while (thread_running) { constexpr size_t url_buffer_size{256}; char url[url_buffer_size]{0}; if (update_available(url, url_buffer_size)) { if (!safeToUpdateCallback || safeToUpdateCallback()) { install_update(url); } else if (safeToUpdateCallback) { ESP_LOGI(TAG, "Deferring update; not allowed by callback."); } } delay(updateCheckInterval * 1000); } } bool OTAManager::update_available(char* url, size_t url_buffer_size) { bool update_found {false}; esp_http_client_config_t config {0}; config.url = feed_url; config.cert_pem = (char *)server_cert_pem_start; config.event_handler = ota_http_event_handler; esp_http_client_handle_t client {esp_http_client_init(&config)}; const esp_err_t err {esp_http_client_perform(client)}; if (err == ESP_OK) { const int status_code {esp_http_client_get_status_code(client)}; const int content_length {esp_http_client_get_content_length(client)}; ESP_LOGI(TAG, "HTTP GET Status = %d, content_length = %d", status_code, content_length); if (status_code == 200 && content_length != 0) { char *response {copy_response(client, content_length)}; if (response) { cJSON *feed {cJSON_Parse(response)}; if (feed) { const cJSON *feed_version {cJSON_GetObjectItem(feed, "version")}; if (cJSON_IsString(feed_version) && feed_version->valuestring != nullptr) { ESP_LOGD(TAG, "Current Version: %s, Feed Version: %s", installed_version, feed_version->valuestring); if (strcmp(feed_version->valuestring, installed_version)) { ESP_LOGD(TAG, "Update available!"); const cJSON *feed_update_url {cJSON_GetObjectItem(feed, "update-url")}; if (cJSON_IsString(feed_update_url) && feed_update_url->valuestring != nullptr && strlen(feed_update_url->valuestring) < url_buffer_size) { strcpy(url, feed_update_url->valuestring); ESP_LOGD(TAG, "Update URL: %s", url); update_found = true; } else { ESP_LOGE(TAG, "Update URL is too long or not found!"); } } else { ESP_LOGD(TAG, "Firmware is up to date!"); } } cJSON_Delete(feed); } else { ESP_LOGE(TAG, "Failed to parse response:\n\n%s\n\n", response); } delete[] response; } else { ESP_LOGE(TAG, "Couldn't allocate space to copy response!"); } } } else { ESP_LOGE(TAG, "HTTP GET request failed: %s", esp_err_to_name(err)); } esp_http_client_cleanup(client); return update_found; } void OTAManager::install_update(const char *url) { esp_http_client_config_t config = {0}; config.url = url; config.cert_pem = (char *)server_cert_pem_start; config.event_handler = ota_http_event_handler; if (preUpdateCallback) { preUpdateCallback(); } esp_err_t ret = esp_https_ota(&config); if (ret == ESP_OK) { esp_restart(); } else { ESP_LOGE(TAG, "Firmware upgrade failed"); } } } // namespace esp32_simple_ota
31.449664
125
0.577465
willson556