hexsha
stringlengths
40
40
size
int64
19
11.4M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
270
max_stars_repo_name
stringlengths
5
110
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
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
3
270
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
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
3
270
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
19
11.4M
avg_line_length
float64
1.93
229k
max_line_length
int64
12
688k
alphanum_fraction
float64
0.07
0.99
matches
listlengths
1
10
ca0bc319a48aa643bc488bf5b6b7310ab8eef15a
8,209
hpp
C++
remodet_repository_wdh_part/include/caffe/pose_data_transformer.hpp
UrwLee/Remo_experience
a59d5b9d6d009524672e415c77d056bc9dd88c72
[ "MIT" ]
null
null
null
remodet_repository_wdh_part/include/caffe/pose_data_transformer.hpp
UrwLee/Remo_experience
a59d5b9d6d009524672e415c77d056bc9dd88c72
[ "MIT" ]
null
null
null
remodet_repository_wdh_part/include/caffe/pose_data_transformer.hpp
UrwLee/Remo_experience
a59d5b9d6d009524672e415c77d056bc9dd88c72
[ "MIT" ]
null
null
null
#ifndef CAFFE_POSE_DATA_TRANSFORMER_HPP #define CAFFE_POSE_DATA_TRANSFORMER_HPP #include <vector> #include <opencv2/core/core.hpp> #include <opencv2/opencv.hpp> using namespace cv; #include "caffe/blob.hpp" #include "caffe/common.hpp" #include "caffe/proto/caffe.pb.h" #include "caffe/tracker/bounding_box.hpp" namespace caffe { /** * 该层为Pose估计的任务提供了图片预处理的所有方法。 * 包括: * 1.随机Scale * 2.随机裁剪 * 3.随机旋转 * 4.随机flip * 5.随机颜色失真... * 该类提供了对数据进行封装的方法。 * 该类被集成进pose_data_layer中,负责为该数据输入层提供数据处理能力。 */ template <typename Dtype> class PoseDataTransformer { public: /** * 构造方法 * @param param [参数,proto定义] * @param phase [TRAIN or TEST] * @return [] */ explicit PoseDataTransformer(const PoseDataTransformationParameter& param, Phase phase); virtual ~PoseDataTransformer() {} // 初始化随机过程 void InitRand(); /** * 图像转换为Blob [rsvd.] * @param cv_img [图像] * @param transformed_blob [输出数据data] */ void Transform(const cv::Mat& cv_img, Blob<Dtype>* transformed_blob); /** * rsvd. * @param mat_vector [多副图像] * @param transformed_blob [输出数据data] */ void Transform(const vector<cv::Mat> & mat_vector, Blob<Dtype>* transformed_blob); /** * 转换过程。 * @param xml_file [XML文件] * @param transformed_data [data数据] * @param transformed_vec_mask [vec-mask数据] * @param transformed_heat_mask [heat-mask数据] * @param transformed_vecmap [vec-map数据] * @param transformed_heatmap [heat-map数据] */ void Transform_nv(const string& xml_file, Dtype* transformed_data, Dtype* transformed_vec_mask, Dtype* transformed_heat_mask, Dtype* transformed_vecmap, Dtype* transformed_heatmap); /** * 转换过程: 多了一个keypoints的真实值 * 该方法比较少用,仅在测试过程中有所使用。 * @param transformed_kps [description] */ void Transform_nv_out(const string& xml_file, Dtype* transformed_data, Dtype* transformed_vec_mask, Dtype* transformed_heat_mask, Dtype* transformed_vecmap, Dtype* transformed_heatmap, Dtype* transformed_kps); // rsvd. vector<int> InferBlobShape(const cv::Mat& cv_img); /** * 增广参数 */ struct AugmentSelection { // flip: TRUE or FALSE bool flip; // 旋转角度 float degree; // 裁剪的起点位置 Size crop; // SCALE参数 float scale; }; /** * 关节点描述 */ struct Joints { vector<Point2f> joints; vector<int> isVisible; }; // 标注数据结构 struct MetaData { // 图像路径 string img_path; // Mask_ALL 路径 string mask_all_path; // Mask_Miss路径,该Mask图片需要使用 string mask_miss_path; // 数据集类型 string dataset; // 图片尺寸 Size img_size; // rsvd. bool isValidation; // 除去主要对象外,该图片中剩余的对象数 int numOtherPeople; // 该主要对象的index int people_index; // 标注文件的index int annolist_index; // 该对象的中心位置 Point2f objpos; // 该对象的位置 BoundingBox<Dtype> bbox; // 该对象的scale: box_height / 368. float scale_self; // 该对象的面积,unused. float area; // 该对象的关节点信息 Joints joint_self; // 其余对象的中心位置 vector<Point2f> objpos_other; // 其余对象的scale vector<float> scale_other; // 其余对象的area vector<float> area_other; // 其余对象的关节点信息 vector<Joints> joint_others; }; /** * 生成HeatMap & VecMap的Label * @param transformed_vecmap [vecmap] * @param transformed_heatmap [heatmap] * @param img_aug [图片] * @param meta [标注信息] */ void generateLabelMap(Dtype* transformed_vecmap, Dtype* transformed_heatmap, cv::Mat& img_aug, MetaData& meta); /** * 可视化:保存增广后的图片及标注 * @param img [图像] * @param meta [标注信息] */ void visualize(Mat& img, MetaData& meta); /** * 下述方法中不包括对Mask_Miss的处理 * 该类方法在不适用Mask的情形下使用。 */ // flip bool augmentation_flip(Mat& img, Mat& img_aug, MetaData& meta); // rotate float augmentation_rotate(Mat& img, Mat& img_aug, MetaData& meta); // scale float augmentation_scale(Mat& img, Mat& img_aug, MetaData& meta); // crop and pad Size augmentation_croppad(Mat& img, Mat& img_aug, MetaData& meta); /** * 下述方法中包括对Mask_Miss的处理 * 该类方法包括Mask的情形下使用。 * 我们目前使用这一类方法。 */ // flip bool augmentation_flip(Mat& img, Mat& img_aug, Mat& mask_miss, Mat& mask_all, MetaData& meta, int mode); // rotate float augmentation_rotate(Mat& img, Mat& img_aug, Mat& mask_miss, Mat& mask_all, MetaData& meta, int mode); // scale float augmentation_scale(Mat& img, Mat& img_aug, Mat& mask_miss, Mat& mask_all, MetaData& meta, int mode); // crop and pad Size augmentation_croppad(Mat& img, Mat& img_aug, Mat& mask_miss, Mat& mask_miss_aug, Mat& mask_all, Mat& mask_all_aug, MetaData& meta, int mode); /** * 旋转关节点 * @param p [坐标点] * @param R [cv旋转变换矩阵] */ void RotatePoint(Point2f& p, Mat& R); /** * 判断一个坐标点是否在某个map上 * @param p [坐标点] * @param img_size [map尺寸] * @return [是或不是] */ bool onPlane(Point p, Size img_size); /** * 对关节点进行左右变换 * 含义:将一个L# -> R# * 含义:将一个R# -> L# * @param j [description] */ void swapLeftRight(Joints& j); // 17 int np_; protected: // 生成一个0~n之间的随机整数 virtual int Rand(int n); // 图形数据转换 void Transform(const cv::Mat& cv_img, Dtype* transformed_data); // 将keypoints坐标输出到一个Blobs数据之中 void Output_keypoints(MetaData& meta, Dtype* out_kp); /** * 数据转换过程 * @param cv_img [原始图片] * @param mask_miss [cv::Mat mask_miss] * @param mask_all [cv::Mat mask_all] * @param meta [标注元数据] * @param transformed_data [data] * @param transformed_vec_mask [vec_mask] * @param transformed_heat_mask [heat_mask] * @param transformed_vecmap [vec_map] * @param transformed_heatmap [heat_map] */ void Transform_nv(cv::Mat& cv_img, cv::Mat& mask_miss, cv::Mat& mask_all, MetaData& meta, Dtype* transformed_data, Dtype* transformed_vec_mask, Dtype* transformed_heat_mask, Dtype* transformed_vecmap, Dtype* transformed_heatmap); /** * 从XML中读取标注信息 * @param xml_file [XML文件] * @param root_dir [根目录] * @param meta [标注数据] * @return [读取成功或失败] */ bool ReadMetaDataFromXml(const string& xml_file, const string& root_dir, MetaData& meta); /** * 将原始标注信息转换为统一的18点; * 顺序按照指定的格式进行。 * @param meta [标注数据] */ void TransformMetaJoints(MetaData& meta); /** * 对单个目标对象的关节点进行转换 */ void TransformJoints(Joints& joints); /** * 基于某个点,生成一个GaussMap (Heatmap) * 最终生成的HeatMap为所有同类型点的叠加。 * @param map [map数据] * @param center [关节点的位置] * @param stride [map相比于原始图像stride] * @param grid_x [网格尺寸] * @param grid_y [网格尺寸] * @param sigma [gauss分布的sigma系数] */ void putGaussianMaps(Dtype* map, Point2f center, int stride, int grid_x, int grid_y, float sigma); /** * 基于两个点生成这两个点之间的vecmap * 最终生成的VecMap为所有同类型线段(由同类的两个点构成)的叠加 * 该条线段的两个端点:A/B,方向为:A->B * @param vecX [该条线段X分量Map] * @param vecY [该条线段Y分量Map] * @param count [不同对象共同生成该Map时的累加因子,unused,可以认为一直是0] * @param centerA [A点位置] * @param centerB [B点位置] * @param stride [map相比于原始图像stride] * @param grid_x [网格尺寸] * @param grid_y [网格尺寸] * @param sigma [线段在方向矢量的法线上的投影范围] * @param thre [阈值] */ void putVecMaps(Dtype* vecX, Dtype* vecY, Mat& count, Point2f centerA, Point2f centerB, int stride, int grid_x, int grid_y, float sigma, int thre); /** * 传统方法:在连段之间放置一些中间点位进行辅助判定。 * 目前未使用该类方法,可以跳过。 * rsvd. */ void putVecPeaks(Dtype* vecX, Dtype* vecY, Mat& count, Point2f centerA, Point2f centerB, int stride, int grid_x, int grid_y, float sigma, int thre); // 转换参数 PoseDataTransformationParameter param_; // 随机数 shared_ptr<Caffe::RNG> rng_; // TRAIN or TEST Phase phase_; // 平均值Blob, unused. Blob<Dtype> data_mean_; // 平均值,[104,117,123] vector<Dtype> mean_values_; }; } #endif
25.258462
150
0.618589
[ "vector", "transform" ]
ca1ce9396c101970b3305e460cbf85f995248ff4
50,605
cpp
C++
src/core/lib/lattice/dcrtpoly.cpp
tony-blake/Pallisade
b7764a4f9f836fe9adefb7bb0ee4825b38c72398
[ "BSD-2-Clause" ]
null
null
null
src/core/lib/lattice/dcrtpoly.cpp
tony-blake/Pallisade
b7764a4f9f836fe9adefb7bb0ee4825b38c72398
[ "BSD-2-Clause" ]
null
null
null
src/core/lib/lattice/dcrtpoly.cpp
tony-blake/Pallisade
b7764a4f9f836fe9adefb7bb0ee4825b38c72398
[ "BSD-2-Clause" ]
null
null
null
/* * @file dcrtpoly.cpp - implementation of the integer lattice using double-CRT representations. * @author TPOC: palisade@njit.edu * * @copyright Copyright (c) 2017, New Jersey Institute of Technology (NJIT) * 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 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 "dcrtpoly.h" #include <fstream> #include <memory> using std::shared_ptr; using std::string; #include "../utils/serializablehelper.h" #include "../utils/debug.h" namespace lbcrypto { /*CONSTRUCTORS*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl() { m_format = EVALUATION; m_params.reset( new ParmType(0,1) ); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(const shared_ptr<ParmType> dcrtParams, Format format, bool initializeElementToZero) { m_format = format; m_params = dcrtParams; size_t vecSize = dcrtParams->GetParams().size(); m_vectors.reserve(vecSize); for (usint i = 0; i < vecSize; i++) { m_vectors.push_back(std::move(PolyType(dcrtParams->GetParams()[i],format,initializeElementToZero))); } } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(const DCRTPolyImpl &element) { m_format = element.m_format; m_vectors = element.m_vectors; m_params = element.m_params; } template<typename ModType, typename IntType, typename VecType, typename ParmType> const DCRTPolyImpl<ModType,IntType,VecType,ParmType>& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator=(const PolyLargeType &element) { if( element.GetModulus() > m_params->GetModulus() ) { throw std::logic_error("Modulus of element passed to constructor is bigger that DCRT big modulus"); } size_t vecCount = m_params->GetParams().size(); m_vectors.clear(); m_vectors.reserve(vecCount); // fill up with vectors with the proper moduli for(usint i = 0; i < vecCount; i++ ) { PolyType newvec(m_params->GetParams()[i], m_format, true); m_vectors.push_back( std::move(newvec) ); } // need big ints out of the little ints for the modulo operations, below std::vector<ModType> bigmods; bigmods.reserve(vecCount); for( usint i = 0; i < vecCount; i++ ) bigmods.push_back( ModType(m_params->GetParams()[i]->GetModulus().ConvertToInt()) ); // copy each coefficient mod the new modulus for(usint p = 0; p < element.GetLength(); p++ ) { for( usint v = 0; v < vecCount; v++ ) { IntType tmp = element.at(p) % bigmods[v]; m_vectors[v].at(p)= tmp.ConvertToInt(); } } return *this; } /* Construct from a single Poly. The format is derived from the passed in Poly.*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(const PolyLargeType &element, const shared_ptr<ParmType> params) { Format format; try { format = element.GetFormat(); } catch (const std::exception& e) { throw std::logic_error("There is an issue with the format of the Poly passed to the constructor of DCRTPolyImpl"); } if( element.GetCyclotomicOrder() != params->GetCyclotomicOrder() ) throw std::logic_error("Cyclotomic order mismatch on input vector and parameters"); m_format = format; m_params = params; *this = element; } /* Construct using a tower of vectors. * The params and format for the DCRTPolyImpl will be derived from the towers */ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(const std::vector<PolyType> &towers) { usint cyclotomicOrder = towers.at(0).GetCyclotomicOrder(); std::vector<std::shared_ptr<ILNativeParams>> parms; for (usint i = 0; i < towers.size(); i++) { if ( towers[i].GetCyclotomicOrder() != cyclotomicOrder ) { throw std::logic_error("Polys provided to constructor must have the same ring dimension"); } parms.push_back( towers[i].GetParams() ); } shared_ptr<ParmType> p( new ParmType(cyclotomicOrder, parms) ); m_params = p; m_vectors = towers; m_format = m_vectors[0].GetFormat(); } /*The dgg will be the seed to populate the towers of the DCRTPolyImpl with random numbers. The algorithm to populate the towers can be seen below.*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(const DggType& dgg, const shared_ptr<ParmType> dcrtParams, Format format) { m_format = format; m_params = dcrtParams; size_t vecSize = dcrtParams->GetParams().size(); m_vectors.reserve(vecSize); //dgg generating random values std::shared_ptr<int32_t> dggValues = dgg.GenerateIntVector(dcrtParams->GetRingDimension()); for(usint i = 0; i < vecSize; i++) { NativeVector ilDggValues(dcrtParams->GetRingDimension(), dcrtParams->GetParams()[i]->GetModulus()); for(usint j = 0; j < dcrtParams->GetRingDimension(); j++) { uint64_t entry; // if the random generated value is less than zero, then multiply it by (-1) and subtract the modulus of the current tower to set the coefficient int64_t k = (dggValues.get())[j]; if(k < 0) { k *= (-1); entry = (uint64_t)dcrtParams->GetParams()[i]->GetModulus().ConvertToInt() - (uint64_t)k; } //if greater than or equal to zero, set it the value generated else { entry = k; } ilDggValues.at(j)=entry; } PolyType ilvector(dcrtParams->GetParams()[i]); ilvector.SetValues(ilDggValues, Format::COEFFICIENT); // the random values are set in coefficient format if(m_format == Format::EVALUATION) { // if the input format is evaluation, then once random values are set in coefficient format, switch the format to achieve what the caller asked for. ilvector.SwitchFormat(); } m_vectors.push_back(ilvector); } } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(DugType& dug, const shared_ptr<ParmType> dcrtParams, Format format) { m_format = format; m_params = dcrtParams; size_t numberOfTowers = dcrtParams->GetParams().size(); m_vectors.reserve(numberOfTowers); for (usint i = 0; i < numberOfTowers; i++) { dug.SetModulus(dcrtParams->GetParams()[i]->GetModulus()); NativeVector vals(dug.GenerateVector(dcrtParams->GetRingDimension())); PolyType ilvector(dcrtParams->GetParams()[i]); ilvector.SetValues(vals, Format::COEFFICIENT); // the random values are set in coefficient format if (m_format == Format::EVALUATION) { // if the input format is evaluation, then once random values are set in coefficient format, switch the format to achieve what the caller asked for. ilvector.SwitchFormat(); } m_vectors.push_back(ilvector); } } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(const TugType& tug, const shared_ptr<ParmType> dcrtParams, Format format) { m_format = format; m_params = dcrtParams; size_t numberOfTowers = dcrtParams->GetParams().size(); m_vectors.reserve(numberOfTowers); //tug generating random values std::shared_ptr<int32_t> tugValues = tug.GenerateIntVector(dcrtParams->GetRingDimension()); for (usint i = 0; i < numberOfTowers; i++) { NativeVector ilTugValues(dcrtParams->GetRingDimension(), dcrtParams->GetParams()[i]->GetModulus()); for(usint j = 0; j < dcrtParams->GetRingDimension(); j++) { uint64_t entry; // if the random generated value is less than zero, then multiply it by (-1) and subtract the modulus of the current tower to set the coefficient int64_t k = (tugValues.get())[j]; if(k < 0) { k *= (-1); entry = (uint64_t)dcrtParams->GetParams()[i]->GetModulus().ConvertToInt() - (uint64_t)k; } //if greater than or equal to zero, set it the value generated else { entry = k; } ilTugValues.at(j)=entry; } PolyType ilvector(dcrtParams->GetParams()[i]); ilvector.SetValues(ilTugValues, Format::COEFFICIENT); // the random values are set in coefficient format if(m_format == Format::EVALUATION) { // if the input format is evaluation, then once random values are set in coefficient format, switch the format to achieve what the caller asked for. ilvector.SwitchFormat(); } m_vectors.push_back(ilvector); } } /*Move constructor*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DCRTPolyImpl(const DCRTPolyImpl &&element) { m_format = element.m_format; m_vectors = std::move(element.m_vectors); m_params = std::move(element.m_params); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::CloneParametersOnly() const { DCRTPolyImpl res(this->m_params, this->m_format); return std::move(res); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::CloneWithNoise(const DiscreteGaussianGeneratorImpl<IntType,VecType> &dgg, Format format) const { DCRTPolyImpl res = CloneParametersOnly(); VecType randVec = dgg.GenerateVector(m_params->GetCyclotomicOrder() / 2, m_params->GetModulus()); // create an Element to pull from // create a dummy parm to use in the Poly world shared_ptr<ILParamsImpl<IntType>> parm( new ILParamsImpl<IntType>(m_params->GetCyclotomicOrder(), m_params->GetModulus(), 1) ); PolyLargeType element( parm ); element.SetValues( randVec, m_format ); res = element; return std::move(res); } // DESTRUCTORS template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::~DCRTPolyImpl() {} // GET ACCESSORS template<typename ModType, typename IntType, typename VecType, typename ParmType> const typename DCRTPolyImpl<ModType,IntType,VecType,ParmType>::PolyType& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::GetElementAtIndex (usint i) const { if(m_vectors.empty()) throw std::logic_error("DCRTPolyImpl's towers are not initialized."); if(i > m_vectors.size()-1) throw std::logic_error("Index: " + std::to_string(i) + " is out of range."); return m_vectors[i]; } template<typename ModType, typename IntType, typename VecType, typename ParmType> usint DCRTPolyImpl<ModType,IntType,VecType,ParmType>::GetNumOfElements() const { return m_vectors.size(); } template<typename ModType, typename IntType, typename VecType, typename ParmType> const std::vector<typename DCRTPolyImpl<ModType,IntType,VecType,ParmType>::PolyType>& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::GetAllElements() const { return m_vectors; } template<typename ModType, typename IntType, typename VecType, typename ParmType> Format DCRTPolyImpl<ModType,IntType,VecType,ParmType>::GetFormat() const { return m_format; } template<typename ModType, typename IntType, typename VecType, typename ParmType> std::vector<DCRTPolyImpl<ModType,IntType,VecType,ParmType>> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::BaseDecompose(usint baseBits, bool evalModeAnswer) const { bool dbg_flag = false; DEBUG("...::BaseDecompose" ); DEBUG("baseBits=" << baseBits ); PolyLargeType v( CRTInterpolate() ); DEBUG("<v>" << std::endl << v << "</v>" ); std::vector<PolyLargeType> bdV = v.BaseDecompose(baseBits, false); DEBUG("<bdV>" ); for( auto i : bdV ) DEBUG(i ); DEBUG("</bdV>" ); std::vector<DCRTPolyImpl<ModType,IntType,VecType,ParmType>> result; // populate the result by converting each of the big vectors into a VectorArray for( usint i=0; i<bdV.size(); i++ ) { DCRTPolyImpl<ModType,IntType,VecType,ParmType> dv(bdV[i], this->GetParams()); if( evalModeAnswer ) dv.SwitchFormat(); result.push_back( std::move(dv) ); } DEBUG("<BaseDecompose.result>" ); for( auto i : result ) DEBUG(i ); DEBUG("</BaseDecompose.result>" ); return std::move(result); } template<typename ModType, typename IntType, typename VecType, typename ParmType> std::vector<DCRTPolyImpl<ModType,IntType,VecType,ParmType>> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::CRTDecompose( const std::vector<NativeInteger> &qDivqiInverse) const { std::vector<DCRTPolyType> result; DCRTPolyType input = this->Clone(); if (input.GetFormat() == EVALUATION) input.SwitchFormat(); for( usint i=0; i<m_vectors.size(); i++ ) { DCRTPolyType currentDCRTPoly = input.Clone(); PolyType currentPoly = input.m_vectors[i]*qDivqiInverse[i]; for ( usint k=0; k<m_vectors.size(); k++ ){ PolyType temp(currentPoly); if (i!=k) temp.SwitchModulus(input.m_vectors[k].GetModulus(),input.m_vectors[k].GetRootOfUnity()); currentDCRTPoly.m_vectors[k] = temp; } currentDCRTPoly.SwitchFormat(); result.push_back( std::move(currentDCRTPoly) ); } return std::move(result); } template<typename ModType, typename IntType, typename VecType, typename ParmType> std::vector<DCRTPolyImpl<ModType,IntType,VecType,ParmType>> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::PowersOfBase(usint baseBits) const { bool dbg_flag = false; std::vector<DCRTPolyImpl<ModType,IntType,VecType,ParmType>> result; usint nBits = m_params->GetModulus().GetLengthForBase(2); usint nWindows = nBits / baseBits; if (nBits % baseBits > 0) nWindows++; result.reserve(nWindows); // prepare for the calculations by gathering a big integer version of each of the little moduli std::vector<IntType> mods(m_params->GetParams().size()); for( usint i = 0; i < m_params->GetParams().size(); i++ ) { mods[i] = IntType(m_params->GetParams()[i]->GetModulus().ConvertToInt()); DEBUG("DCRTPolyImpl::PowersOfBase.mods[" << i << "] = " << mods[i] ); } for( usint i = 0; i < nWindows; i++ ) { DCRTPolyType x( m_params, m_format ); // Shouldn't this be IntType twoPow ( IntType::ONE << (i*baseBits) ?? IntType twoPow( IntType(2).Exp( i*baseBits ) ); DEBUG("DCRTPolyImpl::PowersOfBase.twoPow (" << i << ") = " << twoPow ); for( usint t = 0; t < m_params->GetParams().size(); t++ ) { DEBUG("@(" << i << ", " << t << ")" ); DEBUG("twoPow= " << twoPow << ", mods[" << t << "]" << mods[t] ); IntType pI (twoPow % mods[t]); DEBUG("twoPow= " << twoPow << ", mods[" << t << "]" << mods[t] << "; pI.ConvertToInt=" << pI.ConvertToInt() << "; pI=" << pI ); DEBUG("m_vectors= " << m_vectors[t] ); x.m_vectors[t] = m_vectors[t] * pI.ConvertToInt(); DEBUG("DCRTPolyImpl::PowersOfBase.x.m_vectors[" << t << ", " << i << "]" << x.m_vectors[t] ); } result.push_back( x ); } return std::move(result); } /*VECTOR OPERATIONS*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::MultiplicativeInverse() const { DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < m_vectors.size(); i++) { tmp.m_vectors[i] = m_vectors[i].MultiplicativeInverse(); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::ModByTwo() const { DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < m_vectors.size(); i++) { tmp.m_vectors[i] = m_vectors[i].ModByTwo(); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Plus(const DCRTPolyImpl &element) const { if( m_vectors.size() != element.m_vectors.size() ) { throw std::logic_error("tower size mismatch; cannot add"); } DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < tmp.m_vectors.size(); i++) { tmp.m_vectors[i] += element.GetElementAtIndex (i); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Negate() const { DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(this->CloneParametersOnly()); tmp.m_vectors.clear(); for (usint i = 0; i < this->m_vectors.size(); i++) { tmp.m_vectors.push_back(std::move(this->m_vectors.at(i).Negate())); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Minus(const DCRTPolyImpl &element) const { if( m_vectors.size() != element.m_vectors.size() ) { throw std::logic_error("tower size mismatch; cannot subtract"); } DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < tmp.m_vectors.size(); i++) { tmp.m_vectors[i] -= element.GetElementAtIndex (i); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> const DCRTPolyImpl<ModType,IntType,VecType,ParmType>& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator+=(const DCRTPolyImpl &rhs) { for (usint i = 0; i < this->GetNumOfElements(); i++) { this->m_vectors[i] += rhs.m_vectors[i]; } return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> const DCRTPolyImpl<ModType,IntType,VecType,ParmType>& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator-=(const DCRTPolyImpl &rhs) { for (usint i = 0; i < this->GetNumOfElements(); i++) { this->m_vectors.at(i) -= rhs.GetElementAtIndex(i); } return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> const DCRTPolyImpl<ModType,IntType,VecType,ParmType>& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator*=(const DCRTPolyImpl &element) { for (usint i = 0; i < this->m_vectors.size(); i++) { this->m_vectors.at(i) *= element.m_vectors.at(i); } return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> bool DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator==(const DCRTPolyImpl &rhs) const { if( GetCyclotomicOrder() != rhs.GetCyclotomicOrder() ) return false; if( GetModulus() != rhs.GetModulus() ) return false; if (m_format != rhs.m_format) { return false; } if (m_vectors.size() != rhs.m_vectors.size()) { return false; } //check if the towers are the same else return (m_vectors == rhs.GetAllElements()); } template<typename ModType, typename IntType, typename VecType, typename ParmType> const DCRTPolyImpl<ModType,IntType,VecType,ParmType> & DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator=(const DCRTPolyImpl & rhs) { if (this != &rhs) { m_vectors = rhs.m_vectors; m_format = rhs.m_format; m_params = rhs.m_params; } return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> const DCRTPolyImpl<ModType,IntType,VecType,ParmType> & DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator=(DCRTPolyImpl&& rhs) { if (this != &rhs) { m_vectors = std::move(rhs.m_vectors); m_format = std::move(rhs.m_format); m_params = std::move(rhs.m_params); } return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator=(std::initializer_list<uint64_t> rhs) { usint len = rhs.size(); static PolyType::Integer ZERO(0); if(!IsEmpty()) { usint vectorLength = this->m_vectors[0].GetLength(); for(usint i = 0; i < m_vectors.size(); ++i) { // this loops over each tower for(usint j = 0; j < vectorLength; ++j) { // loops within a tower if(j<len) { this->m_vectors[i].at(j)= *(rhs.begin()+j); } else { this->m_vectors[i].at(j)= ZERO; } } } } else { for(size_t i=0; i<m_vectors.size(); i++) { NativeVector temp(m_params->GetRingDimension()); temp.SetModulus(m_vectors.at(i).GetModulus()); temp = rhs; m_vectors.at(i).SetValues(std::move(temp),m_format); } } return *this; } // Used only inside a Matrix object; so an allocator already initializes the values template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType, IntType, VecType, ParmType>& DCRTPolyImpl<ModType, IntType, VecType, ParmType>::operator=(uint64_t val) { if (!IsEmpty()) { for (usint i = 0; i < m_vectors.size(); i++) { m_vectors[i] = val; } } else { for (usint i = 0; i<m_vectors.size(); i++) { NativeVector temp(m_params->GetRingDimension()); temp.SetModulus(m_vectors.at(i).GetModulus()); temp = val; m_vectors.at(i).SetValues(std::move(temp), m_format); } } return *this; } // Used only inside a Matrix object; so an allocator already initializes the values template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType, IntType, VecType, ParmType>& DCRTPolyImpl<ModType, IntType, VecType, ParmType>::operator=(std::vector<int64_t> val) { if (!IsEmpty()) { for (usint i = 0; i < m_vectors.size(); i++) { m_vectors[i] = val; } } else { for (usint i = 0; i<m_vectors.size(); i++) { NativeVector temp(m_params->GetRingDimension()); temp.SetModulus(m_vectors.at(i).GetModulus()); m_vectors.at(i).SetValues(std::move(temp), m_format); m_vectors[i] = val; } } m_format = COEFFICIENT; return *this; } // Used only inside a Matrix object; so an allocator already initializes the values template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType, IntType, VecType, ParmType>& DCRTPolyImpl<ModType, IntType, VecType, ParmType>::operator=(std::vector<int32_t> val) { if (!IsEmpty()) { for (usint i = 0; i < m_vectors.size(); i++) { m_vectors[i] = val; } } else { for (usint i = 0; i<m_vectors.size(); i++) { NativeVector temp(m_params->GetRingDimension()); temp.SetModulus(m_vectors.at(i).GetModulus()); m_vectors.at(i).SetValues(std::move(temp), m_format); m_vectors[i] = val; } } m_format = COEFFICIENT; return *this; } /*SCALAR OPERATIONS*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Plus(const IntType &element) const { DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < tmp.m_vectors.size(); i++) { tmp.m_vectors[i] += element.ConvertToInt(); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Minus(const IntType &element) const { DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < tmp.m_vectors.size(); i++) { tmp.m_vectors[i] -= element.ConvertToInt(); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Times(const DCRTPolyImpl & element) const { if( m_vectors.size() != element.m_vectors.size() ) { throw std::logic_error("tower size mismatch; cannot multiply"); } DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < m_vectors.size(); i++) { //ModMul multiplies and performs a mod operation on the results. The mod is the modulus of each tower. tmp.m_vectors[i] *= element.m_vectors[i]; } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Times(const IntType &element) const { DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < m_vectors.size(); i++) { tmp.m_vectors[i] = tmp.m_vectors[i] * element.ConvertToInt(); // (element % IntType((*m_params)[i]->GetModulus().ConvertToInt())).ConvertToInt(); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Times( const std::vector<NativeInteger> &element) const { DCRTPolyImpl<ModType,IntType,VecType,ParmType> tmp(*this); for (usint i = 0; i < m_vectors.size(); i++) { tmp.m_vectors[i] = tmp.m_vectors[i] * element[i]; // (element % IntType((*m_params)[i]->GetModulus().ConvertToInt())).ConvertToInt(); } return std::move(tmp); } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::MultiplyAndRound(const IntType &p, const IntType &q) const { std::string errMsg = "Operation not implemented yet"; throw std::runtime_error(errMsg); return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DivideAndRound(const IntType &q) const { std::string errMsg = "Operation not implemented yet"; throw std::runtime_error(errMsg); return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> const DCRTPolyImpl<ModType,IntType,VecType,ParmType>& DCRTPolyImpl<ModType,IntType,VecType,ParmType>::operator*=(const IntType &element) { for (usint i = 0; i < this->m_vectors.size(); i++) { this->m_vectors.at(i) *= element.ConvertToInt(); //this->m_vectors.at(i) * (element % IntType((*m_params)[i]->GetModulus().ConvertToInt())).ConvertToInt(); } return *this; } template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::SetValuesToZero() { for(usint i = 0; i < m_vectors.size(); i++) { m_vectors[i].SetValuesToZero(); } } /*OTHER FUNCTIONS*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::AddILElementOne() { if(m_format != Format::EVALUATION) throw std::runtime_error("DCRTPolyImpl<ModType,IntType,VecType,ParmType>::AddILElementOne cannot be called on a DCRTPolyImpl in COEFFICIENT format."); for(usint i = 0; i < m_vectors.size(); i++) { m_vectors[i].AddILElementOne(); } } template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::MakeSparse(const uint32_t &wFactor) { for(usint i = 0; i < m_vectors.size(); i++) { m_vectors[i].MakeSparse(wFactor); } } // This function modifies PolyArrayImpl to keep all the even indices in the tower. // It reduces the ring dimension of the tower by half. template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Decompose() { if(m_format != Format::COEFFICIENT) { std::string errMsg = "DCRTPolyImpl not in COEFFICIENT format to perform Decompose."; throw std::runtime_error(errMsg); } for( size_t i = 0; i < m_vectors.size(); i++) { m_vectors[i].Decompose(); } // the individual vectors parms have changed, so change the DCRT parms std::vector<std::shared_ptr<ILNativeParams>> vparms(m_vectors.size()); for( size_t i = 0; i < m_vectors.size(); i++) vparms[i] = m_vectors[i].GetParams(); m_params.reset( new ParmType(vparms[0]->GetCyclotomicOrder(), vparms) ); } template<typename ModType, typename IntType, typename VecType, typename ParmType> bool DCRTPolyImpl<ModType,IntType,VecType,ParmType>::IsEmpty() const { for(size_t i=0; i<m_vectors.size(); i++) { if(!m_vectors.at(i).IsEmpty()) return false; } return true; } template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DropLastElement() { if(m_vectors.size() == 0) { throw std::out_of_range("Last element being removed from empty list"); } m_vectors.resize(m_vectors.size() - 1); ParmType *newP = new ParmType( *m_params ); newP->PopLastParam(); m_params.reset(newP); } /** * This function performs ModReduce on ciphertext element and private key element. The algorithm can be found from this paper: * D.Cousins, K. Rohloff, A Scalabale Implementation of Fully Homomorphic Encyrption Built on NTRU, October 2014, Financial Cryptography and Data Security * http://link.springer.com/chapter/10.1007/978-3-662-44774-1_18 * * Modulus reduction reduces a ciphertext from modulus q to a smaller modulus q/qi. The qi is generally the largest. In the code below, * ModReduce is written for DCRTPolyImpl and it drops the last tower while updating the necessary parameters. * The steps taken here are as follows: * 1. compute a short d in R such that d = c mod q * 2. compute a short delta in R such that delta = (vq′−1)·d mod (pq′). E.g., all of delta’s integer coefficients can be in the range [−pq′/2, pq′/2). * 3. let d′ = c + delta mod q. By construction, d′ is divisible by q′. * 4. output (d′/q′) in R(q/q′). */ template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::ModReduce(const IntType &plaintextModulus) { bool dbg_flag = false; if(m_format != Format::EVALUATION) { throw std::logic_error("Mod Reduce function expects EVAL Formatted DCRTPolyImpl. It was passed COEFF Formatted DCRTPolyImpl."); } this->SwitchFormat(); usint lastTowerIndex = m_vectors.size() - 1; DEBUG("ModReduce(" << plaintextModulus << ") on tower size " << m_vectors.size()<< " m=" << GetCyclotomicOrder()); PolyType towerT(m_vectors[lastTowerIndex]); //last tower that will be dropped PolyType d(towerT); //precomputations typename PolyType::Integer ptm(plaintextModulus.ConvertToInt()); typename PolyType::Integer qt(m_vectors[lastTowerIndex].GetModulus()); DEBUG("qt: "<< qt); DEBUG("plaintextModulus: "<< ptm); typename PolyType::Integer v(qt.ModInverse(ptm)); DEBUG("v: "<< v); typename PolyType::Integer a((v * qt).ModSub(1, ptm*qt)); DEBUG("a: "<<a); // Since only positive values are being used for Discrete gaussian generator, a call to switch modulus needs to be done d.SwitchModulus( ptm*qt, d.GetRootOfUnity() ); // FIXME NOT CHANGING ROOT OF UNITY-TODO: What to do with SwitchModulus and is it necessary to pass rootOfUnity // Calculating delta, step 2 PolyType delta(d.Times(a)); // Calculating d' = c + delta mod q (step 3) // no point in going to size() since the last tower's being dropped for(usint i=0; i<m_vectors.size(); i++) { PolyType temp(delta); temp.SwitchModulus(m_vectors[i].GetModulus(), m_vectors[i].GetRootOfUnity()); m_vectors[i] += temp; } //step 4 DropLastElement(); std::vector<PolyType::Integer> qtInverseModQi(m_vectors.size()); for(usint i=0; i<m_vectors.size(); i++) { const PolyType::Integer& mod = m_vectors[i].GetModulus(); qtInverseModQi[i] = qt.ModInverse(mod); m_vectors[i] = qtInverseModQi[i].ConvertToInt() * m_vectors[i]; } SwitchFormat(); } /* * This method applies the Chinese Remainder Interpolation on an ILVectoArray2n and produces an Poly * How the Algorithm works: * Consider the DCRTPolyImpl as a 2-dimensional matrix M, with dimension ringDimension * Number of Towers. * For brevity , lets say this is r * t * Let qt denote the bigModulus (all the towers' moduli multiplied together) and qi denote the modulus of a particular tower. * Let V be a BigVector of size tower (tower size). Each coefficient of V is calculated as follows: * for every r * calculate: V[j]= {Sigma(i = 0 --> t-1) ValueOf M(r,i) * qt/qi *[ (qt/qi)^(-1) mod qi ]}mod qt * * Once we have the V values, we construct an Poly from V, use qt as it's modulus, and calculate a root of unity * for parameter selection of the Poly. */ template<typename ModType, typename IntType, typename VecType, typename ParmType> typename DCRTPolyImpl<ModType,IntType,VecType,ParmType>::PolyLargeType DCRTPolyImpl<ModType,IntType,VecType,ParmType>::CRTInterpolate() const { bool dbg_flag = false; usint ringDimension = GetRingDimension(); usint nTowers = m_vectors.size(); DEBUG("in Interpolate ring " << ringDimension << " towers " << nTowers); for( usint vi = 0; vi < nTowers; vi++ ) DEBUG("tower " << vi << " is " << m_vectors[vi]); ModType bigModulus(GetModulus()); // qT DEBUG("bigModulus " << bigModulus); // this is the resulting vector of coefficients VecType coefficients(ringDimension, bigModulus); // this will finally be V[j]= {Sigma(i = 0 --> t-1) ValueOf M(r,i) * qt/qj *[ (qt/qj)^(-1) mod qj ]}modqt // first, precompute qt/qj factors vector<IntType> multiplier(nTowers); for( usint vi = 0 ; vi < nTowers; vi++ ) { IntType qj(m_vectors[vi].GetModulus().ConvertToInt()); IntType divBy = bigModulus / qj; IntType modInv = divBy.ModInverse(qj).Mod(qj); multiplier[vi] = divBy * modInv; DEBUG("multiplier " << vi << " " << qj << " " << multiplier[vi]); } // if the vectors are not in COEFFICIENT form, they need to be, so we will need to make a copy // of them and switchformat on them... otherwise we can just use what we have const std::vector<PolyType> *vecs = &m_vectors; std::vector<PolyType> coeffVecs; if( m_format == EVALUATION ) { for( usint i=0; i<m_vectors.size(); i++ ) { PolyType vecCopy(m_vectors[i]); vecCopy.SetFormat(COEFFICIENT); coeffVecs.push_back( std::move(vecCopy) ); } vecs = &coeffVecs; } for( usint vi = 0; vi < nTowers; vi++ ) DEBUG("tower " << vi << " is " << (*vecs)[vi]); //Precompute the Barrett mu parameter IntType mu = ComputeMu<IntType>(bigModulus); // now, compute the values for the vector #pragma omp parallel for for( usint ri = 0; ri < ringDimension; ri++ ) { coefficients[ri] = 0; for( usint vi = 0; vi < nTowers; vi++ ) { coefficients[ri] += (IntType((*vecs)[vi].GetValues()[ri].ConvertToInt()) * multiplier[vi]); } DEBUG( (*vecs)[0].GetValues()[ri] << " * " << multiplier[0] << " == " << coefficients[ri] ); coefficients[ri].ModBarrettInPlace(bigModulus,mu); } DEBUG("passed loops"); DEBUG(coefficients); // Create an Poly for this BigVector DEBUG("elementing after vectoring"); DEBUG("m_cyclotomicOrder " << GetCyclotomicOrder()); DEBUG("modulus "<< bigModulus); // Setting the root of unity to ONE as the calculation is expensive and not required. typename DCRTPolyImpl<ModType,IntType,VecType,ParmType>::PolyLargeType polynomialReconstructed( shared_ptr<ILParamsImpl<IntType>>( new ILParamsImpl<IntType>(GetCyclotomicOrder(), bigModulus, 1) ) ); polynomialReconstructed.SetValues(coefficients,COEFFICIENT); DEBUG("answer: " << polynomialReconstructed); return std::move( polynomialReconstructed ); } // todo can we be smarter with this method? template<typename ModType, typename IntType, typename VecType, typename ParmType> NativePoly DCRTPolyImpl<ModType,IntType,VecType,ParmType>::DecryptionCRTInterpolate(PlaintextModulus ptm) const { return this->CRTInterpolate().DecryptionCRTInterpolate(ptm); } //Source: Halevi S. and Polyakov Y. (in preparation, 2018) A Simpler, Faster RNS Variant of the BFV Homomorphic Encryption Scheme. // //Computes Round(p/q*x) mod p as [\sum_i x_i*alpha_i + Round(\sum_i x_i*beta_i)] mod p for fast rounding in RNS // vectors alpha and beta are precomputed as // alpha_i = Floor[(p*[(q/qi)^{-1}]_qi)/qi]_p // beta_i = ((p*[(q/qi)^{-1}]_qi)%qi)/qi in (0,1) // used in decryption of BFVrns template<typename ModType, typename IntType, typename VecType, typename ParmType> PolyImpl<NativeInteger,NativeInteger,NativeVector,ILNativeParams> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::ScaleAndRound(const typename PolyType::Integer &p, const std::vector<typename PolyType::Integer> &alpha, const std::vector<double> &beta) const { usint ringDimension = GetRingDimension(); usint nTowers = m_vectors.size(); typename PolyType::Vector coefficients(ringDimension, p); for( usint ri = 0; ri < ringDimension; ri++ ) { double curFloatSum = 0.0f; typename PolyType::Integer curIntSum = 0; for( usint vi = 0; vi < nTowers; vi++ ) { const typename PolyType::Integer &xi = m_vectors[vi].GetValues()[ri]; // We assume that that the value of p is smaller than 64 bits (like 58) // Thus we do not make additional curIntSum.Mod(p) calls for each value of vi curIntSum += xi.ModMul(alpha[vi],p); curFloatSum += xi.ConvertToInt()*beta[vi]; } coefficients[ri] = (curIntSum + typename PolyType::Integer(std::llround(curFloatSum))).Mod(p); } // Setting the root of unity to ONE as the calculation is expensive // It is assumed that no polynomial multiplications in evaluation representation are performed after this PolyType result( shared_ptr<typename PolyType::Params>( new typename PolyType::Params(GetCyclotomicOrder(), p, 1) ) ); result.SetValues(coefficients,COEFFICIENT); return std::move(result); } /* * Source: Halevi S. and Polyakov Y. (in preparation, 2018) A Simpler, Faster RNS Variant of the BFV Homomorphic Encryption Scheme. * * The goal is to switch the basis of x from Q to S * * Let us write x as * x = \sum_i [xi (q/qi)^{-1}]_qi \times q/qi - alpha*q, * where alpha is a number between 0 and k-1 (assuming we iterate over i \in [0,k-1]). * * Now let us take mod s_i (to go to the S basis). * mod s_i = \sum_i [xi (q/qi)^{-1}]_qi \times q/qi mod s_i - alpha*q mod s_i * * The main problem is that we need to find alpha. * If we know alpha, we can compute x mod s_i (assuming that q mod s_i is precomputed). * * We compute x mod s_i in two steps: * (1) find x' mod s_i = \sum_k [xi (q/qi)^{-1}]_qi \times q/qi mod s_i and find alpha when computing this sum; * (2) subtract alpha*q mod s_i from x' mod s_i. * * We compute lyam_i = [xi (q/qi)^{-1}]_qi/qi, which is a floating-point number between 0 and 1, during the summation in step 1. * Then we compute alpha as Round(\sum_i lyam_i). * * Finally, we evaluate (x' - alpha q) mod s_i to get the CRT basis of x with respect to S. * */ template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::SwitchCRTBasis( const shared_ptr<ParmType> params, const std::vector<typename PolyType::Integer> &qInvModqi, const std::vector<std::vector<typename PolyType::Integer>> &qDivqiModsi, const std::vector<typename PolyType::Integer> &qModsi) const{ DCRTPolyType ans(params,m_format,true); usint ringDimension = GetRingDimension(); usint nTowers = m_vectors.size(); usint nTowersNew = ans.m_vectors.size(); for( usint rIndex = 0; rIndex < ringDimension; rIndex++ ) { std::vector<typename PolyType::Integer> xInvVector(nTowers); double lyam = 0.0; // Compute alpha and vector of x_i terms for( usint vIndex = 0; vIndex < nTowers; vIndex++ ) { const typename PolyType::Integer &xi = m_vectors[vIndex].GetValues()[rIndex]; const typename PolyType::Integer &qi = m_vectors[vIndex].GetModulus(); //computes [xi (q/qi)^{-1}]_qi xInvVector[vIndex] = xi.ModMulFast(qInvModqi[vIndex],qi); //computes [xi (q/qi)^{-1}]_qi / qi to keep track of the number of q-overflows lyam += (double)xInvVector[vIndex].ConvertToInt()/(double)qi.ConvertToInt(); } // alpha corresponds to the number of overflows typename PolyType::Integer alpha = std::llround(lyam); // alpha may get estimated incorrectly in this region; so we apply a correction procedure // currently we use the multiprecision approach for simplicity but we will change it to // the single-precision approach proposed by Kawamura et al. in https://doi.org/10.1007/3-540-45539-6_37 if ((std::fabs(std::llround(lyam*2)/(double)2 - lyam) < nTowers*(2.22e-16)) && (std::llround(lyam*2) % 2 == 1) ){ BigInteger xBig = 0; for( usint vIndex = 0; vIndex < nTowers; vIndex++ ) { BigInteger qi = m_vectors[vIndex].GetModulus(); xBig += xInvVector[vIndex]*params->GetModulus()/qi; } BigInteger alphaBig = xBig.DivideAndRound(params->GetModulus()); alpha = alphaBig.ConvertToInt(); } for (usint newvIndex = 0; newvIndex < nTowersNew; newvIndex ++ ) { typename PolyType::Integer curValue = 0; const typename PolyType::Integer &si = ans.m_vectors[newvIndex].GetModulus(); //first round - compute "fast conversion" for( usint vIndex = 0; vIndex < nTowers; vIndex++ ) { curValue += xInvVector[vIndex].ModMulFast(qDivqiModsi[newvIndex][vIndex],si); } // Since we let current value to exceed si to avoid extra modulo reductions, we have to apply mod si now curValue = curValue.Mod(si); //second round - remove q-overflows ans.m_vectors[newvIndex].at(rIndex) = curValue.ModSubFast(alpha.ModMulFast(qModsi[newvIndex],si),si); } } return std::move(ans); } // Source: Halevi S. and Polyakov Y. (in preparation, 2018) A Simpler, Faster RNS Variant of the BFV Homomorphic Encryption Scheme. // // @brief Expands polynomial in CRT basis Q = q1*q2*...*qn to a larger CRT basis Q*S, where S = s1*s2*...*sn; // uses SwichCRTBasis as a subroutine; Outputs the resulting polynomial in EVALUATION representation template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::ExpandCRTBasis(const shared_ptr<ParmType> paramsExpanded, const shared_ptr<ParmType> params, const std::vector<typename PolyType::Integer> &qInvModqi, const std::vector<std::vector<typename PolyType::Integer>> &qDivqiModsi, const std::vector<typename PolyType::Integer> &qModsi) { std::vector<PolyType> polyInNTT; // if the input polynomial is in evaluation representation, store it for later use to reduce the number of NTTs if (this->GetFormat() == EVALUATION) { polyInNTT = m_vectors; this->SwitchFormat(); } DCRTPolyType polyWithSwitchedCRTBasis = SwitchCRTBasis(params,qInvModqi,qDivqiModsi,qModsi); size_t size = m_vectors.size(); size_t newSize = polyWithSwitchedCRTBasis.m_vectors.size() + size; m_vectors.resize(newSize); // populate the towers corresponding to CRT basis S and convert them to evaluation representation for (size_t i = 0; i < polyWithSwitchedCRTBasis.m_vectors.size(); i++ ) { m_vectors[size + i] = polyWithSwitchedCRTBasis.GetElementAtIndex(i); m_vectors[size + i].SwitchFormat(); } if (polyInNTT.size() > 0) // if the input polynomial was in evaluation representation, use the towers for Q from it { for (size_t i = 0; i < size; i++ ) m_vectors[i] = polyInNTT[i]; } else { // else call NTT for the towers for Q for (size_t i = 0; i <size; i++ ) m_vectors[i].SwitchFormat(); } m_format = EVALUATION; m_params = paramsExpanded; } //Source: Halevi S. and Polyakov Y. (in preparation, 2018) A Simpler, Faster RNS Variant of the BFV Homomorphic Encryption Scheme. // // Computes Round(p/Q*x), where x is in the CRT basis Q*S, // as [\sum_{i=1}^n alpha_i*x_i + Round(\sum_{i=1}^n beta_i*x_i)]_si, // with the result in the Q CRT basis; used in homomorphic multiplication of BFVrns; // alpha is a matrix of precomputed integer factors = {Floor[p*S*[(Q*S/vi)^{-1}]_{vi}/vi]}_si; for all combinations of vi, si; where vi is a prime modulus in Q*S // beta is a vector of precomputed floating-point factors between 0 and 1 = [p*S*(Q*S/vi)^{-1}]_{vi}/vi; - for each vi template<typename ModType, typename IntType, typename VecType, typename ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType> DCRTPolyImpl<ModType,IntType,VecType,ParmType>::ScaleAndRound(const shared_ptr<ParmType> params, const std::vector<std::vector<typename PolyType::Integer>> &alpha, const std::vector<double> &beta) const { DCRTPolyType ans(params,m_format,true); usint ringDimension = GetRingDimension(); size_t size = m_vectors.size(); size_t newSize = ans.m_vectors.size(); for( usint rIndex = 0; rIndex < ringDimension; rIndex++ ) { for (usint newvIndex = 0; newvIndex < newSize; newvIndex ++ ) { double curFloat = 0.0; typename PolyType::Integer curValue = 0; const typename PolyType::Integer &si = params->GetParams()[newvIndex]->GetModulus(); for( usint vIndex = 0; vIndex < size; vIndex++ ) { const typename PolyType::Integer &xi = m_vectors[vIndex].GetValues()[rIndex]; curValue += alpha[vIndex][newvIndex].ModMulFast(xi,si); curFloat += beta[vIndex]*xi.ConvertToInt(); } // Since we let current value to exceed si to avoid extra modulo reductions, we have apply mod si now curValue = curValue.Mod(si); typename PolyType::Integer rounded = std::llround(curFloat); ans.m_vectors[newvIndex].at(rIndex) = curValue.ModAddFast(rounded.Mod(si),si); } } return std::move(ans); } /*Switch format calls IlVector2n's switchformat*/ template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::SwitchFormat() { if (m_format == COEFFICIENT) { m_format = EVALUATION; } else { m_format = COEFFICIENT; } //#pragma omp parallel for for (usint i = 0; i < m_vectors.size(); i++) { m_vectors[i].SwitchFormat(); } } #ifdef OUT template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::SwitchModulus(const IntType &modulus, const IntType &rootOfUnity) { m_modulus = ModType::ONE; for (usint i = 0; i < m_vectors.size(); ++i) { auto mod = modulus % ModType((*m_params)[i]->GetModulus().ConvertToInt()); auto root = rootOfUnity % ModType((*m_params)[i]->GetModulus().ConvertToInt()); m_vectors[i].SwitchModulus(mod.ConvertToInt(), root.ConvertToInt()); m_modulus = m_modulus * mod; } } #endif template<typename ModType, typename IntType, typename VecType, typename ParmType> void DCRTPolyImpl<ModType,IntType,VecType,ParmType>::SwitchModulusAtIndex(usint index, const IntType &modulus, const IntType &rootOfUnity) { if(index > m_vectors.size()-1) { std::string errMsg; errMsg = "DCRTPolyImpl is of size = " + std::to_string(m_vectors.size()) + " but SwitchModulus for tower at index " + std::to_string(index) + "is called."; throw std::runtime_error(errMsg); } m_vectors[index].SwitchModulus(PolyType::Integer(modulus.ConvertToInt()), PolyType::Integer(rootOfUnity.ConvertToInt())); m_params->RecalculateModulus(); } template<typename ModType, typename IntType, typename VecType, typename ParmType> bool DCRTPolyImpl<ModType,IntType,VecType,ParmType>::InverseExists() const { for (usint i = 0; i < m_vectors.size(); i++) { if (!m_vectors[i].InverseExists()) return false; } return true; } template<typename ModType, typename IntType, typename VecType, typename ParmType> double DCRTPolyImpl<ModType, IntType, VecType, ParmType>::Norm() const { PolyLargeType poly(CRTInterpolate()); return poly.Norm(); } template<typename ModType, typename IntType, typename VecType, typename ParmType> bool DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Serialize(Serialized* serObj) const { if( !serObj->IsObject() ) return false; Serialized obj(rapidjson::kObjectType, &serObj->GetAllocator()); if (!m_params->Serialize(&obj)) return false; obj.AddMember("Format", std::to_string(this->GetFormat()), serObj->GetAllocator()); SerializeVector<PolyType>("Vectors", "PolyImpl", this->GetAllElements(), &obj); serObj->AddMember("DCRTPolyImpl", obj, serObj->GetAllocator()); return true; } template<typename ModType, typename IntType, typename VecType, typename ParmType> bool DCRTPolyImpl<ModType,IntType,VecType,ParmType>::Deserialize(const Serialized& serObj) { SerialItem::ConstMemberIterator it = serObj.FindMember("DCRTPolyImpl"); if( it == serObj.MemberEnd() ) return false; SerialItem::ConstMemberIterator pIt = it->value.FindMember("ILDCRTParams"); if (pIt == it->value.MemberEnd()) return false; Serialized parm(rapidjson::kObjectType); parm.AddMember(SerialItem(pIt->name, parm.GetAllocator()), SerialItem(pIt->value, parm.GetAllocator()), parm.GetAllocator()); shared_ptr<ParmType> json_ilParams(new ParmType()); if (!json_ilParams->Deserialize(parm)) return false; m_params = json_ilParams; SerialItem::ConstMemberIterator mIt = it->value.FindMember("Format"); if( mIt == it->value.MemberEnd() ) return false; this->m_format = static_cast<Format>(std::stoi(mIt->value.GetString())); mIt = it->value.FindMember("Vectors"); if( mIt == it->value.MemberEnd() ) { return false; } bool ret = DeserializeVector<PolyType>("Vectors", "PolyImpl", mIt, &this->m_vectors); return ret; } template<typename ModType, typename IntType, typename VecType, typename ParmType> std::ostream& operator<<(std::ostream &os, const DCRTPolyImpl<ModType,IntType,VecType,ParmType> & p) //TODO: Standardize this printing so it is like other poly's { os<<"---START PRINT DOUBLE CRT-- WITH SIZE" <<p.m_vectors.size() << std::endl; for(usint i = 0; i < p.m_vectors.size(); i++) { os<<"VECTOR " << i << std::endl; os<<p.m_vectors[i]; } os<<"---END PRINT DOUBLE CRT--" << std::endl; return os; } } // namespace lbcrypto ends
36.67029
199
0.72479
[ "object", "vector" ]
ca1d0fe0185a3e7b0b1097883cb089bb86bd8878
1,975
cc
C++
src/views/rectangle_view.cc
StrayRobots/3d-annotation-tool
9b9e9487733326868708b441255bc84481f90264
[ "MIT" ]
27
2022-03-23T11:50:40.000Z
2022-03-31T11:08:38.000Z
src/views/rectangle_view.cc
StrayRobots/3d-annotation-tool
9b9e9487733326868708b441255bc84481f90264
[ "MIT" ]
1
2022-03-30T17:33:13.000Z
2022-03-30T17:33:13.000Z
src/views/rectangle_view.cc
StrayRobots/3d-annotation-tool
9b9e9487733326868708b441255bc84481f90264
[ "MIT" ]
null
null
null
#include "views/rectangle_view.h" #include "shader_utils.h" #include <cassert> namespace views { static const uint16_t indices[] = { 0, 3, 1, 0, 1, 3, 0, 3, 2, 0, 2, 3, }; // Render triangles both front and back. static const float vertexData[] = { -1.0f, -1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.0f, }; RectangleView::RectangleView(int id) : views::View3D(id) { vertexLayout.begin() .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float) .end(); vertexBuffer = bgfx::createVertexBuffer(bgfx::makeRef(&vertexData[0], 4 * 3 * sizeof(float)), vertexLayout); indexBuffer = bgfx::createIndexBuffer(bgfx::makeRef(indices, 4 * 3 * sizeof(uint16_t))); u_scale = bgfx::createUniform("u_scale", bgfx::UniformType::Vec4); program = shader_utils::loadProgram("vs_rectangle", "fs_rectangle"); } RectangleView::~RectangleView() { bgfx::destroy(indexBuffer); bgfx::destroy(vertexBuffer); bgfx::destroy(program); bgfx::destroy(u_scale); } void RectangleView::render(const ViewContext3D& context, const Rectangle& rectangle) const { setCameraTransform(context); auto center = rectangle.center; Eigen::Matrix4f transform = Matrix4f::Identity(); Eigen::Matrix3f rotation(rectangle.orientation); transform.block<3, 3>(0, 0) = rotation; transform.block<3, 1>(0, 3) = center; // Canonical rectangle vertices are actually 2m x 2m. float ratioX = rectangle.width() * 0.5f; float ratioY = rectangle.height() * 0.5f; Vector4f scale(ratioX, ratioY, 0.0f, -1.0f); if (rectangle.rotateControl) { scale[3] = 1.0f; } bgfx::setUniform(u_scale, scale.data(), 1); bgfx::setTransform(transform.data()); bgfx::setVertexBuffer(0, vertexBuffer); bgfx::setIndexBuffer(indexBuffer); bgfx::setState(BGFX_STATE_DEFAULT | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_WRITE_Z | BGFX_STATE_BLEND_ALPHA | BGFX_STATE_MSAA); bgfx::submit(viewId, program); } }
28.623188
110
0.68557
[ "render", "transform" ]
ca246a1906304a8db3d60750aab904e217e24206
3,754
cpp
C++
CalTest/Function.cpp
Leelddd/Calculater
39a0d4ce1520a19776c10c0543523ae878365915
[ "MIT" ]
null
null
null
CalTest/Function.cpp
Leelddd/Calculater
39a0d4ce1520a19776c10c0543523ae878365915
[ "MIT" ]
null
null
null
CalTest/Function.cpp
Leelddd/Calculater
39a0d4ce1520a19776c10c0543523ae878365915
[ "MIT" ]
null
null
null
#include"Function.h" #include"stringAnalysis.h" #include<assert.h> //public method of class Function double Function::callFunction(vector<double> &arg) { //link value list and arg list into arg_value(map) if (arg.size() < arg_vector.size()) { cout << "you should put in more values to init the argument" << endl; } else { auto arg_iter = arg_vector.begin(); auto value_iter = arg.begin(); while (value_iter != arg.end()) { arg_value[*arg_iter++] = *value_iter++; } } assert(arg_value.size() == arg_vector.size());//test //s:(a,b);a;1; 4 kinds of conditions for (auto s : argfun_vector) { //if just a argument, number or argument if (s.find_first_of('(') == s.npos) { Function *f; if (isNum(s)) { f = new Function(stod(s)); } else { f = new Function(arg_value[s]); } fun_vector.push_back(f); } //if s is a function else { s.erase(s.begin()); s.pop_back(); vector<string> sub_func_arg = split(s, ","); vector<double> sub_func_arg_val; for (auto s : sub_func_arg) { if (isNum(s)) { sub_func_arg_val.push_back(stod(s)); } else { sub_func_arg_val.push_back(arg_value[s]); } } fun_deque.front()->callFunction(sub_func_arg_val); fun_vector.push_back(fun_deque.front()); fun_deque.pop_front(); } } return callFunction(); } double Function::callFunction(){ if (!isSimpleFunc) setAnswer(); return answer; } void Function::setAnswer() { putVectorToStack(); while (!oper_stack.empty()) popStackToCal(); answer = fun_stack.top()->callFunction(); isSimpleFunc = true; } void Function::setArgValue(const vector<double> &func) { auto func_iter = func.begin(); auto arg_iter = argfun_vector.begin(); while (arg_iter != argfun_vector.end()) { arg_value[*arg_iter++] = *func_iter++; } } //private method of class Function void Function::setPriority() { basic_priority["+"] = 5; basic_priority["-"] = 5; basic_priority["*"] = 10; basic_priority["/"] = 10; basic_priority["^"] = 15; basic_priority["%"] = 7; } void functionAnalysis() { //getName();//between 'define' and first '(' //getAgr();//between first '()', and split by ',' //getFunVector();//split by basic operator and get a vector, loop the vector, if iter is a num, push in vector, if iter is a function, find it in map } void Function::putVectorToStack() { auto fun_iter = fun_vector.begin(); auto oper_iter = oper_vector.begin(); while (oper_iter != oper_vector.end()) { fun_stack.push(*fun_iter++); if (oper_stack.empty()) oper_stack.push(*oper_iter++); else if (basic_priority[*oper_iter] <= basic_priority[oper_stack.top()]) { popStackToCal(); oper_stack.push(*oper_iter++); } else { oper_stack.push(*oper_iter++); } } fun_stack.push(*fun_iter); } void Function::popStackToCal() { double right_num = fun_stack.top()->callFunction(); fun_stack.pop(); double left_num = fun_stack.top()->callFunction(); fun_stack.pop(); string oper = oper_stack.top(); oper_stack.pop(); Function *f = new Function(doCalculate(left_num, right_num, oper)); fun_stack.push(f); } double Function::doCalculate(const double left_num, const double right_num, const string &oper) { if (oper == "+"){ return right_num + left_num; } else if (oper == "-"){ return left_num - right_num; } else if (oper == "*"){ return right_num * left_num; } else if (oper == "/"){ return left_num / right_num; } else if (oper == "^"){ double answer = left_num; if (right_num == 0) return 1; else if (right_num == 1) return left_num; for (int i = 2; i <= right_num; i++){ answer = answer * left_num; } return answer; } else if (oper == "%"){ return (int)left_num % (int)right_num; } return 0; }
21.699422
150
0.647842
[ "vector" ]
ca327c782ac44138e0a2db90aa6b16fcb6ddd8b2
4,285
cpp
C++
Code/branches/Pre-Prospectus/cpp/FissionSource/BankSource.cpp
jlconlin/PhDThesis
8e704613721a800ce1c59576e94f40fa6f7cd986
[ "MIT" ]
null
null
null
Code/branches/Pre-Prospectus/cpp/FissionSource/BankSource.cpp
jlconlin/PhDThesis
8e704613721a800ce1c59576e94f40fa6f7cd986
[ "MIT" ]
null
null
null
Code/branches/Pre-Prospectus/cpp/FissionSource/BankSource.cpp
jlconlin/PhDThesis
8e704613721a800ce1c59576e94f40fa6f7cd986
[ "MIT" ]
null
null
null
/*BankSource.cpp $Author: jlconlin $ $Id: BankSource.cpp 238 2008-01-05 22:05:09Z jlconlin $ $Revision: 238 $ $Date: 2008-01-05 15:05:09 -0700 (Sat, 05 Jan 2008) $ This file provides the implementation for the BankSource class. */ #include<iostream> #include<vector> #include<cassert> #include "boost/utility.hpp" #include "BankSource.h" #include "OneDCartMesh.hh" #include "Particle.h" #include "OneDZone.hh" using std::vector; using std::cout; using boost::compressed_pair; /*This constructor will probably be the one most used. The Field object input * is the relative probability of picking a particle from that Zone. * WARNING: Assumption is made that the Field passed in, is the same Field * that is used for the geometry of the problem. * * N: The number of particles to sample to make initial source.*/ BankSource::BankSource(Field<Zone, double>& F, const Mesh& M, const vector<unsigned long>& seed, int N) : FissionSource(seed) { //Make pdf int size = F.size(); vector<double> PDF(size, 0.0); vector<double> CDF(size, 0.0); double totalProbability(0); totalProbability = std::accumulate(F.begin(), F.end(), totalProbability); Field<Zone, double>::iterator fIter = F.begin(); vector<double>::iterator vecIter = PDF.begin(); for( vecIter = PDF.begin(); vecIter != PDF.end(); ++vecIter, ++fIter ){ *vecIter = *fIter/totalProbability; } CDF[0] = PDF[0]; for ( int i = 1; i < size; i++ ){ CDF[i] = CDF[i-1] + PDF[i]; } //Sample _bank.reserve(N); double probPDF; //Probability from PDF compressed_pair<const Node*, const Node*> zN; //Nodes around a Zone Mesh::const_ZoneIterator zMIter; double x, max, min; Particle* P; const Zone* Z = 0; for( int i = 0; i < N; i++ ){ // Sample N particles probPDF = _r->Fixed(); vecIter = CDF.begin(); zMIter = M.zoneBegin(); //Get iterators ready //Find the zone where particle should be sampled from for( ; vecIter != CDF.end(); ++vecIter, ++zMIter ){ if( probPDF <= *vecIter ) { Z = &(*zMIter); break; } //Ugly! } zN = Z->getNodes(); max = zN.second()->x(); min = zN.first()->x(); x = (max - min)*_r->Fixed() + min; //Pick a position Z = M.getZone(x); P = new Particle(x, 0, 0, 1.0, seed, Z); _bank.push_back(P); } } BankSource::~BankSource(){ for( vector<Particle*>::iterator iter=_bank.begin(); iter!=_bank.end(); ++iter ) { delete *iter; } } /* sample will change the properties of Particle P. It samples a Particle from _bank and makes P equal to it. It will randomize the direction of the particle.There is no guarantee of sampling a particle multiple times.*/ void BankSource::sample( Particle& P ){ assert(_bank.size() > 0); int size = _bank.size(); int index = _r->IntegerC(0,size-1); //Pick a particle Particle* oldParticle; oldParticle = _bank[index]; P._x = oldParticle->_x; P._y = oldParticle->_y; P._z = oldParticle->_z; P.setRandomDirection(); P._geoZone = oldParticle->_geoZone; if( oldParticle->_weight < 0 ) { P._weight = -1.0; } else { P._weight = 1.0; } } void BankSource::push_back(Particle* P){ P->Reseed(_r->Seed()); _bank.push_back(P); } //Given a Mesh, return a Field representing the discretized source std::vector<double> BankSource::discretized(Mesh& M) const{ std::vector<double> histogram(M.numZones(), 0.0); Field<Zone, double> F(M, 0.0); const Zone* Z; for( vector<Particle*>::const_iterator iter = _bank.begin(); iter != _bank.end(); ++iter ){ Z = M.getZone((*iter)->x()); F[*Z] += (*iter)->weight(); } Field<Zone, double>::iterator fieldIter = F.begin(); vector<double>::iterator histIter = histogram.begin(); for( ; histIter != histogram.end(); ++histIter, ++fieldIter ){ *histIter = *fieldIter; } return histogram; } /*PrintBank will write to the screen the first N Particles.*/ void BankSource::PrintBank(int N){ int n = 0; for ( unsigned int i = 0; i < _bank.size(); i++ ){ cout << "(" << i << "): " << _bank[i] << "\n"; if ( n++ > N) break; } }
31.740741
85
0.609802
[ "mesh", "geometry", "object", "vector" ]
ca33b897930d1bdb621590afa425448ed6c84d18
2,740
cc
C++
be/src/kudu/util/status-test.cc
suifengzhuliu/impala
611f4c6f3b18cfcddff3b2956cbb87c295a87655
[ "Apache-2.0" ]
2
2016-09-12T06:53:49.000Z
2016-09-12T15:47:46.000Z
be/src/kudu/util/status-test.cc
suifengzhuliu/impala
611f4c6f3b18cfcddff3b2956cbb87c295a87655
[ "Apache-2.0" ]
null
null
null
be/src/kudu/util/status-test.cc
suifengzhuliu/impala
611f4c6f3b18cfcddff3b2956cbb87c295a87655
[ "Apache-2.0" ]
2
2018-04-03T05:49:03.000Z
2020-05-29T21:18:46.000Z
// Some portions Copyright (c) 2011 The LevelDB 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 <glog/logging.h> #include <gtest/gtest.h> #include <errno.h> #include <vector> #include "kudu/util/status.h" #include "kudu/util/test_util.h" using std::string; namespace kudu { TEST(StatusTest, TestPosixCode) { Status ok = Status::OK(); ASSERT_EQ(0, ok.posix_code()); Status file_error = Status::IOError("file error", Slice(), ENOTDIR); ASSERT_EQ(ENOTDIR, file_error.posix_code()); } TEST(StatusTest, TestToString) { Status file_error = Status::IOError("file error", Slice(), ENOTDIR); ASSERT_EQ(string("IO error: file error (error 20)"), file_error.ToString()); } TEST(StatusTest, TestClonePrepend) { Status file_error = Status::IOError("file error", "msg2", ENOTDIR); Status appended = file_error.CloneAndPrepend("Heading"); ASSERT_EQ(string("IO error: Heading: file error: msg2 (error 20)"), appended.ToString()); } TEST(StatusTest, TestCloneAppend) { Status remote_error = Status::RemoteError("Application error"); Status appended = remote_error.CloneAndAppend(Status::NotFound("Unknown tablet").ToString()); ASSERT_EQ(string("Remote error: Application error: Not found: Unknown tablet"), appended.ToString()); } TEST(StatusTest, TestMemoryUsage) { ASSERT_EQ(0, Status::OK().memory_footprint_excluding_this()); ASSERT_GT(Status::IOError( "file error", "some other thing", ENOTDIR).memory_footprint_excluding_this(), 0); } TEST(StatusTest, TestMoveConstructor) { // OK->OK move should do nothing. { Status src = Status::OK(); Status dst = std::move(src); ASSERT_OK(src); ASSERT_OK(dst); } // Moving a not-OK status into a new one should make the moved status // "OK". { Status src = Status::NotFound("foo"); Status dst = std::move(src); ASSERT_OK(src); ASSERT_EQ("Not found: foo", dst.ToString()); } } TEST(StatusTest, TestMoveAssignment) { // OK->Bad move should clear the source status and also make the // destination status OK. { Status src = Status::OK(); Status dst = Status::NotFound("orig dst"); dst = std::move(src); ASSERT_OK(src); ASSERT_OK(dst); } // Bad->Bad move. { Status src = Status::NotFound("orig src"); Status dst = Status::NotFound("orig dst"); dst = std::move(src); ASSERT_OK(src); ASSERT_EQ("Not found: orig src", dst.ToString()); } // Bad->OK move { Status src = Status::NotFound("orig src"); Status dst = Status::OK(); dst = std::move(src); ASSERT_OK(src); ASSERT_EQ("Not found: orig src", dst.ToString()); } } } // namespace kudu
27.676768
95
0.673358
[ "vector" ]
ca3a4fe94e3af7f34c5d98869b3057c689e4d5f8
1,060
cc
C++
slick/test/test_util_handeye.cc
williammc/Slick
67dec11ea252e7e3a7d6097369a0f313cf1d2fdd
[ "BSD-3-Clause" ]
1
2017-04-13T05:26:40.000Z
2017-04-13T05:26:40.000Z
slick/test/test_util_handeye.cc
williammc/Slick
67dec11ea252e7e3a7d6097369a0f313cf1d2fdd
[ "BSD-3-Clause" ]
null
null
null
slick/test/test_util_handeye.cc
williammc/Slick
67dec11ea252e7e3a7d6097369a0f313cf1d2fdd
[ "BSD-3-Clause" ]
null
null
null
#include <iostream> #include <fstream> #include <tuple> #include "slick/util/handeye.h" int test_computeHandEye() { std::stringstream ss; ss << Slick_ROOT << "/data/" << "handeye-1.txt"; std::fstream fs(ss.str().c_str(), std::ios_base::in); // vector<SO3> sensorworld2sensor_rots, cam2vision_rots; Eigen::Matrix<slick::SlickScalar, 3, 1> temp_v; for (int i = 0; i < 6; ++i) { fs >> temp_v[0] >> temp_v[1] >> temp_v[2]; // SO3 sw2s_rot(temp_v); fs >> temp_v[0] >> temp_v[1] >> temp_v[2]; // SO3 c2v_rot(temp_v); // sensorworld2sensor_rots.push_back(sw2s_rot); // cam2vision_rots.push_back(c2v_rot); } // std::pair<SO3 , SO3 > res = ComputeHandEye( sensorworld2sensor_rots, // cam2vision_rots ); // cout << "sensor2cam:\n" << res.first << endl; // cout << "vision2sensorworld:\n" << res.second << endl; return 1; } int main(int argc, char **argv) { bool final_ok = true; bool ok = test_computeHandEye(); printf("test_computeHandEye():%u\n", ok); final_ok &= ok; return (final_ok) ? 0 : -1; }
27.179487
74
0.627358
[ "vector" ]
ca3c5c63465ee4f3476cd4617928d27c70fac8cc
6,679
cc
C++
services/device/public/cpp/hid/fake_hid_manager.cc
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
services/device/public/cpp/hid/fake_hid_manager.cc
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
services/device/public/cpp/hid/fake_hid_manager.cc
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2019 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 "services/device/public/cpp/hid/fake_hid_manager.h" #include <memory> #include <utility> #include "base/guid.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" namespace device { FakeHidConnection::FakeHidConnection(mojom::HidDeviceInfoPtr device) : device_(std::move(device)) {} FakeHidConnection::~FakeHidConnection() = default; // mojom::HidConnection implementation: void FakeHidConnection::Read(ReadCallback callback) { const char kResult[] = "This is a HID input report."; uint8_t report_id = device_->has_report_id ? 1 : 0; std::vector<uint8_t> buffer(kResult, kResult + sizeof(kResult) - 1); std::move(callback).Run(true, report_id, buffer); } void FakeHidConnection::Write(uint8_t report_id, const std::vector<uint8_t>& buffer, WriteCallback callback) { const char kExpected[] = "o-report"; // 8 bytes if (buffer.size() != sizeof(kExpected) - 1) { std::move(callback).Run(false); return; } int expected_report_id = device_->has_report_id ? 1 : 0; if (report_id != expected_report_id) { std::move(callback).Run(false); return; } if (memcmp(buffer.data(), kExpected, sizeof(kExpected) - 1) != 0) { std::move(callback).Run(false); return; } std::move(callback).Run(true); } void FakeHidConnection::GetFeatureReport(uint8_t report_id, GetFeatureReportCallback callback) { uint8_t expected_report_id = device_->has_report_id ? 1 : 0; if (report_id != expected_report_id) { std::move(callback).Run(false, base::nullopt); return; } const char kResult[] = "This is a HID feature report."; std::vector<uint8_t> buffer; if (device_->has_report_id) buffer.push_back(report_id); buffer.insert(buffer.end(), kResult, kResult + sizeof(kResult) - 1); std::move(callback).Run(true, buffer); } void FakeHidConnection::SendFeatureReport(uint8_t report_id, const std::vector<uint8_t>& buffer, SendFeatureReportCallback callback) { const char kExpected[] = "The app is setting this HID feature report."; if (buffer.size() != sizeof(kExpected) - 1) { std::move(callback).Run(false); return; } int expected_report_id = device_->has_report_id ? 1 : 0; if (report_id != expected_report_id) { std::move(callback).Run(false); return; } if (memcmp(buffer.data(), kExpected, sizeof(kExpected) - 1) != 0) { std::move(callback).Run(false); return; } std::move(callback).Run(true); } // Implementation of FakeHidManager. FakeHidManager::FakeHidManager() {} FakeHidManager::~FakeHidManager() = default; void FakeHidManager::Bind(mojo::PendingReceiver<mojom::HidManager> receiver) { receivers_.Add(this, std::move(receiver)); } // mojom::HidManager implementation: void FakeHidManager::GetDevicesAndSetClient( mojo::PendingAssociatedRemote<mojom::HidManagerClient> client, GetDevicesCallback callback) { GetDevices(std::move(callback)); clients_.Add(std::move(client)); } void FakeHidManager::GetDevices(GetDevicesCallback callback) { std::vector<mojom::HidDeviceInfoPtr> device_list; for (auto& map_entry : devices_) device_list.push_back(map_entry.second->Clone()); std::move(callback).Run(std::move(device_list)); } void FakeHidManager::Connect( const std::string& device_guid, mojo::PendingRemote<mojom::HidConnectionClient> connection_client, mojo::PendingRemote<mojom::HidConnectionWatcher> watcher, ConnectCallback callback) { if (!base::Contains(devices_, device_guid)) { std::move(callback).Run(mojo::NullRemote()); return; } mojo::PendingRemote<mojom::HidConnection> connection; mojo::MakeSelfOwnedReceiver( std::make_unique<FakeHidConnection>(devices_[device_guid]->Clone()), connection.InitWithNewPipeAndPassReceiver()); std::move(callback).Run(std::move(connection)); } mojom::HidDeviceInfoPtr FakeHidManager::CreateAndAddDevice( const std::string& physical_device_id, uint16_t vendor_id, uint16_t product_id, const std::string& product_name, const std::string& serial_number, mojom::HidBusType bus_type) { mojom::HidDeviceInfoPtr device = mojom::HidDeviceInfo::New(); device->guid = base::GenerateGUID(); device->physical_device_id = physical_device_id; device->vendor_id = vendor_id; device->product_id = product_id; device->product_name = product_name; device->serial_number = serial_number; device->bus_type = bus_type; AddDevice(device.Clone()); return device; } mojom::HidDeviceInfoPtr FakeHidManager::CreateAndAddDeviceWithTopLevelUsage( const std::string& physical_device_id, uint16_t vendor_id, uint16_t product_id, const std::string& product_name, const std::string& serial_number, mojom::HidBusType bus_type, uint16_t usage_page, uint16_t usage) { mojom::HidDeviceInfoPtr device = mojom::HidDeviceInfo::New(); device->guid = base::GenerateGUID(); device->physical_device_id = physical_device_id; device->vendor_id = vendor_id; device->product_id = product_id; device->product_name = product_name; device->serial_number = serial_number; device->bus_type = bus_type; std::vector<mojom::HidReportDescriptionPtr> input_reports; std::vector<mojom::HidReportDescriptionPtr> output_reports; std::vector<mojom::HidReportDescriptionPtr> feature_reports; std::vector<mojom::HidCollectionInfoPtr> children; device->collections.push_back(mojom::HidCollectionInfo::New( mojom::HidUsageAndPage::New(usage, usage_page), std::vector<uint8_t>(), mojom::kHIDCollectionTypeApplication, std::move(input_reports), std::move(output_reports), std::move(feature_reports), std::move(children))); AddDevice(device.Clone()); return device; } void FakeHidManager::AddDevice(mojom::HidDeviceInfoPtr device) { std::string guid = device->guid; devices_[guid] = std::move(device); mojom::HidDeviceInfo* device_info = devices_[guid].get(); for (auto& client : clients_) client->DeviceAdded(device_info->Clone()); } void FakeHidManager::RemoveDevice(const std::string& guid) { if (base::Contains(devices_, guid)) { mojom::HidDeviceInfo* device_info = devices_[guid].get(); for (auto& client : clients_) client->DeviceRemoved(device_info->Clone()); devices_.erase(guid); } } } // namespace device
32.580488
79
0.706543
[ "vector" ]
ca43391035af19b861d7444b93b0f39886319244
24,801
cpp
C++
Engine/Code/Engine/Audio/AudioSystem.cpp
cugone/Abrams2019
0b94c43275069275bbbeadfa773c336fa1947882
[ "MIT" ]
1
2020-07-14T06:58:50.000Z
2020-07-14T06:58:50.000Z
Engine/Code/Engine/Audio/AudioSystem.cpp
cugone/Abrams2019
0b94c43275069275bbbeadfa773c336fa1947882
[ "MIT" ]
1
2020-04-06T06:52:11.000Z
2020-04-06T06:52:19.000Z
Engine/Code/Engine/Audio/AudioSystem.cpp
cugone/Abrams2019
0b94c43275069275bbbeadfa773c336fa1947882
[ "MIT" ]
2
2019-05-01T21:49:33.000Z
2021-04-01T08:22:21.000Z
#include "Engine/Audio/AudioSystem.hpp" #include "Engine/Audio/Wav.hpp" #include "Engine/Audio/Audio3DEmitter.hpp" #include "Engine/Audio/Audio3DListener.hpp" #include "Engine/Core/BuildConfig.hpp" #include "Engine/Core/ErrorWarningAssert.hpp" #include "Engine/Core/FileUtils.hpp" #include "Engine/Core/ThreadUtils.hpp" #include "Engine/Input/InputSystem.hpp" #include "Engine/Math/MathUtils.hpp" #include "Engine/Services/ServiceLocator.hpp" #include "Engine/Services/IFileLoggerService.hpp" #include <algorithm> void AudioSystem::EmitterListenerDSP_worker() noexcept { while(IsRunning()) { static thread_local auto updateAudioThisFrame = uint8_t{0u}; std::unique_lock<std::mutex> lock(_cs); //Condition to wake up: not running or should update this frame. _signal.wait(lock, [this]() -> bool { return !_is_running || !!updateAudioThisFrame; }); if(!!updateAudioThisFrame) { for(auto& active : _active_channels) { for(auto& emitter : _emitters) { for(auto& listener : _listeners) { const auto old_freq = active->GetFrequency(); auto dsp = CalculateDSP(*emitter, *listener, _dsp_settings); active->SetDSPSettings(dsp); } } } } ++updateAudioThisFrame; updateAudioThisFrame &= 1; } } bool AudioSystem::IsRunning() const noexcept { bool running = false; { std::scoped_lock<std::mutex> lock(_cs); running = _is_running; } return running; } AudioSystem::AudioSystem() noexcept : EngineSubsystem() , IAudioService() { InitializeAudioSystem(); } AudioSystem::AudioSystem(std::size_t max_channels) noexcept : EngineSubsystem() , IAudioService() , _max_channels(max_channels) { InitializeAudioSystem(); } AudioSystem::~AudioSystem() noexcept { _is_running = false; _signal.notify_one(); _dsp_thread.join(); for(auto& channel : _active_channels) { channel->Stop(); } { bool done_cleanup = false; do { std::this_thread::yield(); std::scoped_lock<std::mutex> lock(_cs); done_cleanup = _active_channels.empty(); } while(!done_cleanup); } _active_channels.clear(); _active_channels.shrink_to_fit(); _idle_channels.clear(); _idle_channels.shrink_to_fit(); _sounds.clear(); _wave_files.clear(); if(_master_voice) { _master_voice->DestroyVoice(); _master_voice = nullptr; } if(_xaudio2) { _xaudio2->UnregisterForCallbacks(&_engine_callback); _xaudio2->Release(); _xaudio2 = nullptr; } ::CoUninitialize(); } void AudioSystem::InitializeAudioSystem() noexcept { bool co_init_succeeded = SUCCEEDED(::CoInitializeEx(nullptr, COINIT_MULTITHREADED)); GUARANTEE_OR_DIE(co_init_succeeded, "Failed to setup Audio System."); bool xaudio2_create_succeeded = SUCCEEDED(::XAudio2Create(&_xaudio2)); GUARANTEE_OR_DIE(xaudio2_create_succeeded, "Failed to create Audio System."); } void AudioSystem::Initialize() noexcept { #ifdef AUDIO_DEBUG XAUDIO2_DEBUG_CONFIGURATION config{}; config.LogFileline = true; config.LogFunctionName = true; config.LogThreadID = true; config.LogTiming = true; config.BreakMask = XAUDIO2_LOG_WARNINGS; config.TraceMask = XAUDIO2_LOG_DETAIL | XAUDIO2_LOG_WARNINGS | XAUDIO2_LOG_FUNC_CALLS; _xaudio2->SetDebugConfiguration(&config); #endif _xaudio2->CreateMasteringVoice(&_master_voice); XAUDIO2_VOICE_DETAILS details{}; _master_voice->GetVoiceDetails(&details); _input_channels = details.InputChannels; DebuggerPrintf("Mastering voice expects %i input channels.\n", details.InputChannels); DWORD dwChannelMask; _master_voice->GetChannelMask(&dwChannelMask); ::X3DAudioInitialize(dwChannelMask, X3DAUDIO_SPEED_OF_SOUND, _x3daudio); _idle_channels.reserve(_max_channels); _active_channels.reserve(_max_channels); FileUtils::Wav::WavFormatChunk fmt{}; fmt.formatId = 1; fmt.channelCount = 1; fmt.samplesPerSecond = 44100; fmt.bytesPerSecond = 88200; fmt.dataBlockSize = 2; fmt.bitsPerSample = 16; SetFormat(fmt); SetEngineCallback(&_engine_callback); _is_running = true; _dsp_thread = std::thread(&AudioSystem::EmitterListenerDSP_worker, this); ThreadUtils::SetThreadDescription(_dsp_thread, std::string{"AudioSystem Updater"}); for(std::size_t i = 0; i < _max_channels; ++i) { _idle_channels.push_back(std::make_unique<Channel>(*this, AudioSystem::Channel::ChannelDesc{this})); } } const std::atomic_uint32_t& AudioSystem::GetOperationSetId() const noexcept { return _operationID; } const std::atomic_uint32_t& AudioSystem::IncrementAndGetOperationSetId() noexcept { IncrementOperationSetId(); return GetOperationSetId(); } void AudioSystem::IncrementOperationSetId() noexcept { _operationID++; } void AudioSystem::SubmitDeferredOperation(uint32_t operationSetId) noexcept { _xaudio2->CommitChanges(operationSetId); } void AudioSystem::SetEngineCallback(EngineCallback* callback) noexcept { if(&_engine_callback == callback) { return; } _xaudio2->UnregisterForCallbacks(&_engine_callback); _engine_callback = *callback; _xaudio2->RegisterForCallbacks(&_engine_callback); } const WAVEFORMATEXTENSIBLE& AudioSystem::GetFormat() const noexcept { return _audio_format_ex; } FileUtils::Wav::WavFormatChunk AudioSystem::GetLoadedWavFileFormat() const noexcept { FileUtils::Wav::WavFormatChunk fmt{}; if(_wave_files.empty()) { return fmt; } return _wave_files.begin()->second->GetFormatChunk(); } AudioDSPResults AudioSystem::CalculateDSP(const Audio3DEmitter& emitter, const Audio3DListener& listener, const AudioDSPSettings& settings) const noexcept { X3DAUDIO_EMITTER x3daudio_emitter{}; X3DAUDIO_CONE emitter_cone{}; if(const auto is_emitter_omniDirectional = emitter.IsOmniDirectional(); is_emitter_omniDirectional) { emitter_cone = GetDefaultOmniDirectionalX3DAudioCone(); } else { emitter_cone = Audio3DConeToX3DAudioCone(emitter.Get3DCone()); } x3daudio_emitter.pCone = &emitter_cone; const auto& x3daudio_listener = listener.GetX3DAudioListener(); uint32_t flags = AudioDSPSettingsToX3DAudioDSPFlags(settings); X3DAUDIO_DSP_SETTINGS dsp_settings{}; dsp_settings.pMatrixCoefficients = settings.use_matrix_table ? new float[_input_channels * _max_channels] : nullptr; dsp_settings.pDelayTimes = settings.use_delay_array && _input_channels > 1 ? new float[_max_channels] : nullptr; dsp_settings.SrcChannelCount = 1; dsp_settings.DstChannelCount = _input_channels * static_cast<uint32_t>(_max_channels); ::X3DAudioCalculate(_x3daudio, &x3daudio_listener, &x3daudio_emitter, flags, &dsp_settings); AudioDSPResults results{}; results.dopplerFactor = dsp_settings.DopplerFactor; results.emitterToListenerAngleRadians = dsp_settings.EmitterToListenerAngle; results.emitterToListenerDistance = dsp_settings.EmitterToListenerDistance; results.emitterVelocityComponent = dsp_settings.EmitterVelocityComponent; results.lowPassFilterDirectCoefficient = dsp_settings.LPFDirectCoefficient; results.lowPassFilterReverbCoefficient = dsp_settings.LPFReverbCoefficient; results.pMatrixCoefficients = &dsp_settings.pMatrixCoefficients; return results; } void AudioSystem::BeginFrame() noexcept { /* DO NOTHING */ } void AudioSystem::Update([[maybe_unused]] TimeUtils::FPSeconds deltaSeconds) noexcept { } void AudioSystem::Render() const noexcept { /* DO NOTHING */ } void AudioSystem::EndFrame() noexcept { /* DO NOTHING */ } bool AudioSystem::ProcessSystemMessage(const EngineMessage& /*msg*/) noexcept { return false; } void AudioSystem::SuspendAudio() noexcept { if(_xaudio2) { _xaudio2->StopEngine(); } } void AudioSystem::ResumeAudio() noexcept { if(_xaudio2) { _xaudio2->StartEngine(); } } void AudioSystem::SetFormat(const WAVEFORMATEXTENSIBLE& format) noexcept { _audio_format_ex = format; } void AudioSystem::SetFormat(const FileUtils::Wav::WavFormatChunk& format) noexcept { auto* fmt_buffer = reinterpret_cast<const unsigned char*>(&format); std::memcpy(&_audio_format_ex, fmt_buffer, sizeof(_audio_format_ex)); } void AudioSystem::RegisterWavFilesFromFolder(std::filesystem::path folderpath, bool recursive /*= false*/) noexcept { namespace FS = std::filesystem; if(!FS::exists(folderpath)) { auto& logger = ServiceLocator::get<IFileLoggerService>(); logger.LogErrorLine("Attempting to Register Wav Files from unknown path: " + FS::absolute(folderpath).string()); return; } folderpath = FS::canonical(folderpath); folderpath.make_preferred(); if(!FS::is_directory(folderpath)) { return; } const auto cb = [this](const std::filesystem::path& p) { RegisterWavFile(p); }; FileUtils::ForEachFileInFolder(folderpath, ".wav", cb, recursive); } void AudioSystem::DeactivateChannel(Channel& channel) noexcept { std::scoped_lock<std::mutex> lock(_cs); const auto found_iter = std::find_if(std::begin(_active_channels), std::end(_active_channels), [&channel](const std::unique_ptr<Channel>& c) { return c.get() == &channel; }); _idle_channels.push_back(std::move(*found_iter)); _active_channels.erase(found_iter); } void AudioSystem::Play(Sound& snd, SoundDesc desc /* = SoundDesc{}*/) noexcept { std::scoped_lock<std::mutex> lock(_cs); if(_idle_channels.empty()) { return; } _active_channels.push_back(std::move(_idle_channels.back())); _idle_channels.pop_back(); auto& inserted_channel = _active_channels.back(); inserted_channel->Play(snd); } void AudioSystem::Play(std::filesystem::path filepath, SoundDesc desc /*= SoundDesc{}*/) noexcept { namespace FS = std::filesystem; if(!FS::exists(filepath)) { return; } Sound* snd = CreateSound(filepath); Play(*snd, desc); } void AudioSystem::Play(const std::filesystem::path& filepath) noexcept { Play(filepath, SoundDesc{}); } void AudioSystem::Play(const std::size_t id) noexcept { Play(_sounds[id].first, SoundDesc{}); } void AudioSystem::Play(const std::filesystem::path& filepath, const bool looping) noexcept { SoundDesc desc{}; desc.loopCount = looping ? -1 : 0; Play(filepath, desc); } void AudioSystem::Play(const std::size_t id, const bool looping) noexcept { SoundDesc desc{}; desc.loopCount = looping ? -1 : 0; Play(_sounds[id].first, desc); } void AudioSystem::SetDSPSettings(const AudioDSPSettings& newSettings) noexcept { _dsp_settings = newSettings; } void AudioSystem::Stop(const std::filesystem::path& filepath) noexcept { const auto& found = std::find_if(std::cbegin(_sounds), std::cend(_sounds), [&filepath](const auto& snd) { return snd.first == filepath; }); if(found != std::cend(_sounds)) { for(auto& channel : found->second->GetChannels()) { channel->Stop(); DeactivateChannel(*channel); } } } void AudioSystem::Stop(const std::size_t id) noexcept { auto& channel = _active_channels[id]; channel->Stop(); DeactivateChannel(*channel); } void AudioSystem::StopAll() noexcept { const auto& op_id = IncrementAndGetOperationSetId(); for(auto& active_sound : _active_channels) { active_sound->Stop(op_id); DeactivateChannel(*active_sound); } SubmitDeferredOperation(op_id); } AudioSystem::Sound* AudioSystem::CreateSound(std::filesystem::path filepath) noexcept { namespace FS = std::filesystem; if(!FS::exists(filepath)) { auto& logger = ServiceLocator::get<IFileLoggerService>(); logger.LogErrorLine("Could not find file: " + filepath.string()); return nullptr; } filepath = FS::canonical(filepath); filepath.make_preferred(); const auto finder = [&filepath](const auto& a) { return a.first == filepath; }; auto found_iter = std::find_if(std::begin(_sounds), std::end(_sounds), finder); if(found_iter == _sounds.end()) { _sounds.emplace_back(std::make_pair(filepath, std::move(std::make_unique<Sound>(*this, filepath)))); found_iter = std::find_if(std::begin(_sounds), std::end(_sounds), finder); } return found_iter->second.get(); } AudioSystem::Sound* AudioSystem::CreateSoundInstance(std::filesystem::path filepath) noexcept { namespace FS = std::filesystem; if(!FS::exists(filepath)) { auto& logger = ServiceLocator::get<IFileLoggerService>(); logger.LogErrorLine("Could not find file: " + filepath.string()); return nullptr; } filepath = FS::canonical(filepath); filepath.make_preferred(); _sounds.emplace_back(std::make_pair(filepath, std::move(std::make_unique<Sound>(*this, filepath)))); return _sounds.back().second.get(); } void AudioSystem::RegisterWavFile(std::filesystem::path filepath) noexcept { namespace FS = std::filesystem; if(!FS::exists(filepath)) { auto& logger = ServiceLocator::get<IFileLoggerService>(); logger.LogErrorLine("Attempting to register wav file that does not exist: " + filepath.string()); return; } filepath = FS::canonical(filepath); if(const auto found = std::find_if(std::cbegin(_wave_files), std::cend(_wave_files), [&filepath](const auto& wav) { return wav.first == filepath; }); found != std::cend(_wave_files)) { return; } if(const auto wav_result = [&]() { auto&& wav = std::make_unique<FileUtils::Wav>(); if(const auto result = wav->Load(filepath); result == FileUtils::Wav::WAV_SUCCESS) { _wave_files.emplace_back(std::make_pair(filepath, std::move(wav))); return result; } else { return result; } }(); //IIIL wav_result != FileUtils::Wav::WAV_SUCCESS) { auto& logger = ServiceLocator::get<IFileLoggerService>(); switch(wav_result) { case FileUtils::Wav::WAV_ERROR_NOT_A_WAV: { logger.LogErrorLine(filepath.string() + " is not a .wav file."); break; } case FileUtils::Wav::WAV_ERROR_BAD_FILE: { logger.LogErrorLine(filepath.string() + " is improperly formatted."); break; } default: { logger.LogErrorLine("Unknown error attempting to load " + filepath.string()); break; } } } } void AudioSystem::Register3DAudioEmitter(Audio3DEmitter* emitter) noexcept { _emitters.emplace_back(emitter); } void AudioSystem::Register3DAudioListener(Audio3DListener* listener) noexcept { _listeners.emplace_back(listener); } void STDMETHODCALLTYPE AudioSystem::Channel::VoiceCallback::OnBufferEnd(void* pBufferContext) { Channel& channel = *static_cast<Channel*>(pBufferContext); channel.Stop(); channel._sound->RemoveChannel(&channel); channel._sound = nullptr; channel._audio_system->DeactivateChannel(channel); } void STDMETHODCALLTYPE AudioSystem::Channel::VoiceCallback::OnLoopEnd(void* pBufferContext) { Channel& channel = *static_cast<Channel*>(pBufferContext); if(channel._desc.stopWhenFinishedLooping && channel._desc.loop_count != XAUDIO2_LOOP_INFINITE) { if(++channel._desc.repeat_count >= channel._desc.loop_count) { channel.Stop(); } } } AudioSystem::Channel::Channel(AudioSystem& audioSystem, const ChannelDesc& desc) noexcept : _audio_system(&audioSystem) , _desc{desc} { static VoiceCallback vcb; _buffer.pContext = this; auto* fmt = reinterpret_cast<const WAVEFORMATEX*>(&(_audio_system->GetFormat())); _audio_system->_xaudio2->CreateSourceVoice(&_voice, fmt, 0, _desc.frequency_max, &vcb); //if(auto* group = _audio_system->GetChannelGroup(desc.groupName); group != nullptr) { // group->AddChannel(this); //} } AudioSystem::Channel::~Channel() noexcept { if(_voice) { Stop(); _voice->DestroyVoice(); _voice = nullptr; } } void AudioSystem::Channel::SetDSPSettings(AudioDSPResults& settings) { if(this && _voice) { if(settings.pMatrixCoefficients && *settings.pMatrixCoefficients) { _voice->SetOutputMatrix(_audio_system->_master_voice, 1, _audio_system->_input_channels, *settings.pMatrixCoefficients); delete[] *settings.pMatrixCoefficients; *settings.pMatrixCoefficients = nullptr; } XAUDIO2_FILTER_PARAMETERS filterParameters{XAUDIO2_FILTER_TYPE::LowPassFilter, 2.0f * std::sin(MathUtils::M_1PI_6 * settings.lowPassFilterDirectCoefficient)}; _voice->SetFilterParameters(&filterParameters); } } void AudioSystem::Channel::SetDSPSettings(AudioDSPResults& settings, uint32_t operationSetId) { if(_voice) { if(settings.pMatrixCoefficients && *settings.pMatrixCoefficients) { _voice->SetOutputMatrix(_audio_system->_master_voice, 1, _audio_system->_input_channels, *settings.pMatrixCoefficients, operationSetId); delete[] *settings.pMatrixCoefficients; *settings.pMatrixCoefficients = nullptr; } XAUDIO2_FILTER_PARAMETERS filterParameters{XAUDIO2_FILTER_TYPE::LowPassFilter, 2.0f * std::sin(MathUtils::M_1PI_6 * settings.lowPassFilterDirectCoefficient)}; _voice->SetFilterParameters(&filterParameters, operationSetId); } } void AudioSystem::Channel::Play(Sound& snd) noexcept { snd.AddChannel(this); _sound = &snd; if(const auto* wav = snd.GetWav()) { _buffer.pAudioData = wav->GetDataBuffer(); _buffer.AudioBytes = wav->GetDataBufferSize(); _buffer.LoopCount = _desc.loop_count; _buffer.LoopBegin = 0; _buffer.LoopLength = 0; if(_desc.loop_count) { _buffer.LoopBegin = _desc.loop_beginSamples; _buffer.LoopLength = _desc.loop_endSamples - _desc.loop_beginSamples; } _voice->SubmitSourceBuffer(&_buffer, nullptr); _voice->SetVolume(_desc.volume); _voice->SetFrequencyRatio(_desc.frequency); _voice->Start(); } } void AudioSystem::Channel::Play(Sound& snd, uint32_t operationSetId) noexcept { snd.AddChannel(this); _sound = &snd; if(const auto* wav = snd.GetWav()) { _buffer.pAudioData = wav->GetDataBuffer(); _buffer.AudioBytes = wav->GetDataBufferSize(); _buffer.LoopCount = _desc.loop_count; _buffer.LoopBegin = 0; _buffer.LoopLength = 0; if(_desc.loop_count) { _buffer.LoopBegin = _desc.loop_beginSamples; _buffer.LoopLength = _desc.loop_endSamples - _desc.loop_beginSamples; } _voice->SubmitSourceBuffer(&_buffer, nullptr); _voice->SetVolume(_desc.volume, operationSetId); _voice->SetFrequencyRatio(_desc.frequency, operationSetId); _voice->Start(0, operationSetId); } } void AudioSystem::Channel::Stop() noexcept { if(_voice) { _voice->Stop(); _voice->FlushSourceBuffers(); } } void AudioSystem::Channel::Stop(uint32_t operationSetId) noexcept { if(_voice) { _voice->Stop(0, operationSetId); _voice->FlushSourceBuffers(); } } void AudioSystem::Channel::Pause() noexcept { if(_voice) { _voice->Stop(); } } void AudioSystem::Channel::Pause(uint32_t operationSetId) noexcept { if(_voice) { _voice->Stop(0, operationSetId); } } AudioSystem::Channel::ChannelDesc::ChannelDesc(AudioSystem* audioSystem) : audio_system{audioSystem} { /* DO NOTHING */ } AudioSystem::Channel::ChannelDesc& AudioSystem::Channel::ChannelDesc::operator=(const SoundDesc& sndDesc) { volume = sndDesc.volume; frequency = sndDesc.frequency; loop_count = sndDesc.loopCount <= -1 ? XAUDIO2_LOOP_INFINITE : (std::clamp(sndDesc.loopCount, 0, XAUDIO2_MAX_LOOP_COUNT)); stopWhenFinishedLooping = sndDesc.stopWhenFinishedLooping; const auto& fmt = audio_system->GetLoadedWavFileFormat(); loop_beginSamples = static_cast<uint32_t>(fmt.samplesPerSecond * sndDesc.loopBegin.count()); loop_endSamples = static_cast<uint32_t>(fmt.samplesPerSecond * sndDesc.loopEnd.count()); groupName = sndDesc.groupName; return *this; } void AudioSystem::Channel::SetStopWhenFinishedLooping(bool value) { _desc.stopWhenFinishedLooping = value; } void AudioSystem::Channel::SetLoopCount(int count) noexcept { if(count <= -1) { _desc.loop_count = XAUDIO2_LOOP_INFINITE; } else { count = std::clamp(count, 0, XAUDIO2_MAX_LOOP_COUNT); _desc.loop_count = count; } } uint32_t AudioSystem::Channel::GetLoopCount() const noexcept { return _desc.loop_count; } void AudioSystem::Channel::SetLoopRange(TimeUtils::FPSeconds start, TimeUtils::FPSeconds end) { SetLoopBegin(start); SetLoopEnd(end); } void AudioSystem::Channel::SetLoopBegin(TimeUtils::FPSeconds start) { const auto& fmt = _audio_system->GetLoadedWavFileFormat(); _desc.loop_beginSamples = static_cast<uint32_t>(fmt.samplesPerSecond * start.count()); } void AudioSystem::Channel::SetLoopEnd(TimeUtils::FPSeconds end) { const auto& fmt = _audio_system->GetLoadedWavFileFormat(); _desc.loop_endSamples = static_cast<uint32_t>(fmt.samplesPerSecond * end.count()); } void AudioSystem::Channel::SetVolume(float newVolume) noexcept { _desc.volume = newVolume; } void AudioSystem::Channel::SetFrequency(float newFrequency) noexcept { newFrequency = std::clamp(newFrequency, XAUDIO2_MIN_FREQ_RATIO, _desc.frequency_max); _desc.frequency = newFrequency; } float AudioSystem::Channel::GetVolume() const noexcept { return _desc.volume; } float AudioSystem::Channel::GetFrequency() const noexcept { return _desc.frequency; } AudioSystem::Sound::Sound(AudioSystem& audiosystem, std::filesystem::path filepath) : _audio_system(&audiosystem) { namespace FS = std::filesystem; GUARANTEE_OR_DIE(FS::exists(filepath), "Attempting to create sound that does not exist.\n"); filepath = FS::canonical(filepath); filepath.make_preferred(); const auto pred = [&filepath](const auto& wav) { return wav.first == filepath; }; auto found = std::find_if(std::begin(_audio_system->_wave_files), std::end(_audio_system->_wave_files), pred); if(found == _audio_system->_wave_files.end()) { _audio_system->RegisterWavFile(filepath); found = std::find_if(std::begin(_audio_system->_wave_files), std::end(_audio_system->_wave_files), pred); } if(found != std::end(_audio_system->_wave_files)) { _my_id = _id++; _wave_file = found->second.get(); } } void AudioSystem::Sound::AddChannel(Channel* channel) noexcept { std::scoped_lock<std::mutex> lock(_cs); _channels.push_back(channel); } void AudioSystem::Sound::RemoveChannel(Channel* channel) noexcept { std::scoped_lock<std::mutex> lock(_cs); _channels.erase(std::remove_if(std::begin(_channels), std::end(_channels), [channel](Channel* c) -> bool { return c == channel; }), std::end(_channels)); } const std::size_t AudioSystem::Sound::GetId() const noexcept { return _my_id; } const std::size_t AudioSystem::Sound::GetCount() noexcept { return _id; } const FileUtils::Wav* const AudioSystem::Sound::GetWav() const noexcept { return _wave_file; } const std::vector<AudioSystem::Channel*>& AudioSystem::Sound::GetChannels() const noexcept { return _channels; } void STDMETHODCALLTYPE AudioSystem::EngineCallback::OnCriticalError(HRESULT error) { std::ostringstream ss; ss << "The Audio System encountered a fatal error: "; ss << "0x" << std::hex << std::setw(8) << std::setfill('0') << error; ERROR_AND_DIE(ss.str().c_str()); }
35.582496
189
0.671183
[ "render", "vector" ]
ca459ca24089366f2b81dc6bfc36ec6c6dc4b6cd
1,726
cc
C++
sdk/src/model/PutObjectResult.cc
pengrui2009/aliyun-oss-cpp-sdk-windows
db3b42fb949d38c577876bcc8d65cd67e31d6dcd
[ "Apache-2.0" ]
null
null
null
sdk/src/model/PutObjectResult.cc
pengrui2009/aliyun-oss-cpp-sdk-windows
db3b42fb949d38c577876bcc8d65cd67e31d6dcd
[ "Apache-2.0" ]
null
null
null
sdk/src/model/PutObjectResult.cc
pengrui2009/aliyun-oss-cpp-sdk-windows
db3b42fb949d38c577876bcc8d65cd67e31d6dcd
[ "Apache-2.0" ]
null
null
null
/* * 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/oss/model/PutObjectResult.h> #include "../utils/Utils.h" #include <alibabacloud/oss/http/HttpType.h> using namespace AlibabaCloud::OSS; PutObjectResult::PutObjectResult(): OssObjectResult(), content_(nullptr) { } PutObjectResult::PutObjectResult(const HeaderCollection& header, const std::shared_ptr<std::iostream>& content): OssObjectResult(header) { if (header.find(Http::ETAG) != header.end()) { eTag_ = TrimQuotes(header.at(Http::ETAG).c_str()); } if (header.find("x-oss-hash-crc64ecma") != header.end()) { crc64_ = std::strtoull(header.at("x-oss-hash-crc64ecma").c_str(), nullptr, 10); } if (content != nullptr && content->peek() != EOF) { content_ = content; } } PutObjectResult::PutObjectResult(const HeaderCollection & header): PutObjectResult(header, nullptr) { } const std::string& PutObjectResult::ETag() const { return eTag_; } uint64_t PutObjectResult::CRC64() { return crc64_; } const std::shared_ptr<std::iostream>& PutObjectResult::Content() const { return content_; }
26.553846
112
0.700463
[ "model" ]
ca4d2607b53f0457c88bd0058fde9610b08960d8
4,815
hpp
C++
include/UnityEngine/ProBuilder/MeshOperations/AppendElements_--c__DisplayClass14_0.hpp
RedBrumbler/BeatSaber-Quest-Codegen
73dda50b5a3e51f10d86b766dcaa24b0c6226e25
[ "Unlicense" ]
null
null
null
include/UnityEngine/ProBuilder/MeshOperations/AppendElements_--c__DisplayClass14_0.hpp
RedBrumbler/BeatSaber-Quest-Codegen
73dda50b5a3e51f10d86b766dcaa24b0c6226e25
[ "Unlicense" ]
null
null
null
include/UnityEngine/ProBuilder/MeshOperations/AppendElements_--c__DisplayClass14_0.hpp
RedBrumbler/BeatSaber-Quest-Codegen
73dda50b5a3e51f10d86b766dcaa24b0c6226e25
[ "Unlicense" ]
null
null
null
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" #include "beatsaber-hook/shared/utils/byref.hpp" // Including type: UnityEngine.ProBuilder.MeshOperations.AppendElements #include "UnityEngine/ProBuilder/MeshOperations/AppendElements.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Begin forward declares // Forward declaring namespace: UnityEngine::ProBuilder namespace UnityEngine::ProBuilder { // Forward declaring type: Edge struct Edge; // Forward declaring type: EdgeLookup struct EdgeLookup; } // Completed forward declares #include "beatsaber-hook/shared/utils/il2cpp-type-check.hpp" NEED_NO_BOX(::UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0); DEFINE_IL2CPP_ARG_TYPE(::UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0*, "UnityEngine.ProBuilder.MeshOperations", "AppendElements/<>c__DisplayClass14_0"); // Type namespace: UnityEngine.ProBuilder.MeshOperations namespace UnityEngine::ProBuilder::MeshOperations { // Size: 0x14 #pragma pack(push, 1) // Autogenerated type: UnityEngine.ProBuilder.MeshOperations.AppendElements/UnityEngine.ProBuilder.MeshOperations.<>c__DisplayClass14_0 // [TokenAttribute] Offset: FFFFFFFF // [CompilerGeneratedAttribute] Offset: FFFFFFFF class AppendElements::$$c__DisplayClass14_0 : public ::Il2CppObject { public: #ifdef USE_CODEGEN_FIELDS public: #else #ifdef CODEGEN_FIELD_ACCESSIBILITY CODEGEN_FIELD_ACCESSIBILITY: #else protected: #endif #endif // public System.Int32 delCount // Size: 0x4 // Offset: 0x10 int delCount; // Field size check static_assert(sizeof(int) == 0x4); public: // Creating conversion operator: operator int constexpr operator int() const noexcept { return delCount; } // Get instance field reference: public System.Int32 delCount int& dyn_delCount(); // UnityEngine.ProBuilder.Edge <AppendVerticesToEdge>b__0(UnityEngine.ProBuilder.EdgeLookup x) // Offset: 0x19E4388 ::UnityEngine::ProBuilder::Edge $AppendVerticesToEdge$b__0(::UnityEngine::ProBuilder::EdgeLookup x); // public System.Void .ctor() // Offset: 0x19E4380 // Implemented from: System.Object // Base method: System.Void Object::.ctor() template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static AppendElements::$$c__DisplayClass14_0* New_ctor() { static auto ___internal__logger = ::Logger::get().WithContext("::UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<AppendElements::$$c__DisplayClass14_0*, creationType>())); } }; // UnityEngine.ProBuilder.MeshOperations.AppendElements/UnityEngine.ProBuilder.MeshOperations.<>c__DisplayClass14_0 #pragma pack(pop) static check_size<sizeof(AppendElements::$$c__DisplayClass14_0), 16 + sizeof(int)> __UnityEngine_ProBuilder_MeshOperations_AppendElements_$$c__DisplayClass14_0SizeCheck; static_assert(sizeof(AppendElements::$$c__DisplayClass14_0) == 0x14); } #include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" // Writing MetadataGetter for method: UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0::$AppendVerticesToEdge$b__0 // Il2CppName: <AppendVerticesToEdge>b__0 template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::UnityEngine::ProBuilder::Edge (UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0::*)(::UnityEngine::ProBuilder::EdgeLookup)>(&UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0::$AppendVerticesToEdge$b__0)> { static const MethodInfo* get() { static auto* x = &::il2cpp_utils::GetClassFromName("UnityEngine.ProBuilder", "EdgeLookup")->byval_arg; return ::il2cpp_utils::FindMethod(classof(UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0*), "<AppendVerticesToEdge>b__0", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{x}); } }; // Writing MetadataGetter for method: UnityEngine::ProBuilder::MeshOperations::AppendElements::$$c__DisplayClass14_0::New_ctor // Il2CppName: .ctor // Cannot get method pointer of value based method overload from template for constructor! // Try using FindMethod instead!
54.101124
337
0.746417
[ "object", "vector" ]
ca53e2f318c5bafe97be9f44b3288900d9ce2a33
7,686
cpp
C++
catkin_workspace/src/third_party/roboticsgroup_gazebo_plugins/src/mimic_joint_plugin.cpp
Sreeni1204/sdp_ws20_collision_monitoring_for_robotic_manipulators
e2262086ee68c0e926fad7745127d97d609251f2
[ "MIT" ]
16
2021-03-10T14:18:04.000Z
2022-03-16T02:18:22.000Z
catkin_workspace/src/third_party/roboticsgroup_gazebo_plugins/src/mimic_joint_plugin.cpp
Sreeni1204/sdp_ws20_collision_monitoring_for_robotic_manipulators
e2262086ee68c0e926fad7745127d97d609251f2
[ "MIT" ]
4
2021-03-23T08:50:22.000Z
2022-02-26T15:15:09.000Z
catkin_workspace/src/third_party/roboticsgroup_gazebo_plugins/src/mimic_joint_plugin.cpp
Sreeni1204/sdp_ws20_collision_monitoring_for_robotic_manipulators
e2262086ee68c0e926fad7745127d97d609251f2
[ "MIT" ]
6
2021-03-12T02:37:59.000Z
2022-02-16T09:19:41.000Z
/** Copyright (c) 2014, Konstantinos Chatzilygeroudis 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 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 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 <roboticsgroup_gazebo_plugins/mimic_joint_plugin.h> #if GAZEBO_MAJOR_VERSION >= 8 namespace math = ignition::math; #else namespace math = gazebo::math; #endif namespace gazebo { MimicJointPlugin::MimicJointPlugin() { joint_.reset(); mimic_joint_.reset(); } MimicJointPlugin::~MimicJointPlugin() { this->updateConnection.reset(); } void MimicJointPlugin::Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf) { model_ = _parent; world_ = model_->GetWorld(); // Error message if the model couldn't be found if (!model_) { ROS_ERROR("Parent model is NULL! MimicJointPlugin could not be loaded."); return; } // Check that ROS has been initialized if (!ros::isInitialized()) { ROS_ERROR("A ROS node for Gazebo has not been initialized, unable to load plugin."); return; } // Check for robot namespace robot_namespace_ = ""; if (_sdf->HasElement("robotNamespace")) { robot_namespace_ = _sdf->GetElement("robotNamespace")->Get<std::string>(); } ros::NodeHandle model_nh(robot_namespace_); // Check for joint element if (!_sdf->HasElement("joint")) { ROS_ERROR("No joint element present. MimicJointPlugin could not be loaded."); return; } joint_name_ = _sdf->GetElement("joint")->Get<std::string>(); // Check for mimicJoint element if (!_sdf->HasElement("mimicJoint")) { ROS_ERROR("No mimicJoint element present. MimicJointPlugin could not be loaded."); return; } mimic_joint_name_ = _sdf->GetElement("mimicJoint")->Get<std::string>(); // Check if PID controller wanted has_pid_ = _sdf->HasElement("hasPID"); if (has_pid_) { std::string name = _sdf->GetElement("hasPID")->Get<std::string>(); if (name.empty()) { name = "gazebo_ros_control/pid_gains/" + mimic_joint_name_; } const ros::NodeHandle nh(model_nh, name); pid_.init(nh); } // Check for multiplier element multiplier_ = 1.0; if (_sdf->HasElement("multiplier")) multiplier_ = _sdf->GetElement("multiplier")->Get<double>(); // Check for offset element offset_ = 0.0; if (_sdf->HasElement("offset")) offset_ = _sdf->GetElement("offset")->Get<double>(); // Check for sensitiveness element sensitiveness_ = 0.0; if (_sdf->HasElement("sensitiveness")) sensitiveness_ = _sdf->GetElement("sensitiveness")->Get<double>(); // Get pointers to joints joint_ = model_->GetJoint(joint_name_); if (!joint_) { ROS_ERROR_STREAM("No joint named \"" << joint_name_ << "\". MimicJointPlugin could not be loaded."); return; } mimic_joint_ = model_->GetJoint(mimic_joint_name_); if (!mimic_joint_) { ROS_ERROR_STREAM("No (mimic) joint named \"" << mimic_joint_name_ << "\". MimicJointPlugin could not be loaded."); return; } // Check for max effort #if GAZEBO_MAJOR_VERSION > 2 max_effort_ = mimic_joint_->GetEffortLimit(0); #else max_effort_ = mimic_joint_->GetMaxForce(0); #endif if (_sdf->HasElement("maxEffort")) { max_effort_ = _sdf->GetElement("maxEffort")->Get<double>(); } // Set max effort if (!has_pid_) { #if GAZEBO_MAJOR_VERSION > 2 mimic_joint_->SetEffortLimit(0, max_effort_); #else mimic_joint_->SetMaxForce(0, max_effort_); #endif } // Listen to the update event. This event is broadcast every // simulation iteration. this->updateConnection = event::Events::ConnectWorldUpdateBegin( boost::bind(&MimicJointPlugin::UpdateChild, this)); // Output some confirmation ROS_INFO_STREAM("MimicJointPlugin loaded! Joint: \"" << joint_name_ << "\", Mimic joint: \"" << mimic_joint_name_ << "\"" << ", Multiplier: " << multiplier_ << ", Offset: " << offset_ << ", MaxEffort: " << max_effort_ << ", Sensitiveness: " << sensitiveness_); } void MimicJointPlugin::UpdateChild() { #if GAZEBO_MAJOR_VERSION >= 8 static ros::Duration period(world_->Physics()->GetMaxStepSize()); #else static ros::Duration period(world_->GetPhysicsEngine()->GetMaxStepSize()); #endif // Set mimic joint's angle based on joint's angle #if GAZEBO_MAJOR_VERSION >= 8 double angle = joint_->Position(0) * multiplier_ + offset_; double a = mimic_joint_->Position(0); #else double angle = joint_->GetAngle(0).Radian() * multiplier_ + offset_; double a = mimic_joint_->GetAngle(0).Radian(); #endif if (fabs(angle - a) >= sensitiveness_) { if (has_pid_) { if (a != a) a = angle; double error = angle - a; double effort = math::clamp(pid_.computeCommand(error, period), -max_effort_, max_effort_); mimic_joint_->SetForce(0, effort); } else { #if GAZEBO_MAJOR_VERSION >= 9 mimic_joint_->SetPosition(0, angle, true); #elif GAZEBO_MAJOR_VERSION > 2 ROS_WARN_ONCE("The mimic_joint plugin is using the Joint::SetPosition method without preserving the link velocity."); ROS_WARN_ONCE("As a result, gravity will not be simulated correctly for your model."); ROS_WARN_ONCE("Please set gazebo_pid parameters or upgrade to Gazebo 9."); ROS_WARN_ONCE("For details, see https://github.com/ros-simulation/gazebo_ros_pkgs/issues/612"); mimic_joint_->SetPosition(0, angle); #else mimic_joint_->SetAngle(0, math::Angle(angle)); #endif } } } GZ_REGISTER_MODEL_PLUGIN(MimicJointPlugin); }
39.415385
142
0.629066
[ "model" ]
ca5811c1f8eb796ad917cc60003c85c2df27df6b
30,849
inl
C++
lib/Runtime/Language/InlineCache.inl
l3dlp-forks/ChakraCore
6efbeaa37087db635c687f1bd1bc66d0c5d40649
[ "MIT" ]
null
null
null
lib/Runtime/Language/InlineCache.inl
l3dlp-forks/ChakraCore
6efbeaa37087db635c687f1bd1bc66d0c5d40649
[ "MIT" ]
null
null
null
lib/Runtime/Language/InlineCache.inl
l3dlp-forks/ChakraCore
6efbeaa37087db635c687f1bd1bc66d0c5d40649
[ "MIT" ]
null
null
null
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- #pragma once namespace Js { template< bool CheckLocal, bool CheckProto, bool CheckAccessor, bool CheckMissing, bool ReturnOperationInfo> bool InlineCache::TryGetProperty( Var const instance, RecyclableObject *const propertyObject, const PropertyId propertyId, Var *const propertyValue, ScriptContext *const requestContext, PropertyCacheOperationInfo *const operationInfo) { CompileAssert(CheckLocal || CheckProto || CheckAccessor); Assert(!ReturnOperationInfo || operationInfo); CompileAssert(!ReturnOperationInfo || (CheckLocal && CheckProto && CheckAccessor)); Assert(instance); Assert(propertyObject); Assert(propertyId != Constants::NoProperty); Assert(propertyValue); Assert(requestContext); DebugOnly(VerifyRegistrationForInvalidation(this, requestContext, propertyId)); Type *const type = propertyObject->GetType(); if (CheckLocal && type == u.local.type) { Assert(propertyObject->GetScriptContext() == requestContext); // we never cache a type from another script context *propertyValue = DynamicObject::FromVar(propertyObject)->GetInlineSlot(u.local.slotIndex); Assert(*propertyValue == JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext) || *propertyValue == JavascriptOperators::GetRootProperty(propertyObject, propertyId, requestContext)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Local; operationInfo->slotType = SlotType_Inline; } return true; } if (CheckLocal && TypeWithAuxSlotTag(type) == u.local.type) { Assert(propertyObject->GetScriptContext() == requestContext); // we never cache a type from another script context *propertyValue = DynamicObject::FromVar(propertyObject)->GetAuxSlot(u.local.slotIndex); Assert(*propertyValue == JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext) || *propertyValue == JavascriptOperators::GetRootProperty(propertyObject, propertyId, requestContext)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Local; operationInfo->slotType = SlotType_Aux; } return true; } if (CheckProto && type == u.proto.type && !this->u.proto.isMissing) { Assert(u.proto.prototypeObject->GetScriptContext() == requestContext); // we never cache a type from another script context *propertyValue = u.proto.prototypeObject->GetInlineSlot(u.proto.slotIndex); Assert(*propertyValue == JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext) || *propertyValue == JavascriptOperators::GetRootProperty(propertyObject, propertyId, requestContext)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Proto; operationInfo->slotType = SlotType_Inline; } return true; } if (CheckProto && TypeWithAuxSlotTag(type) == u.proto.type && !this->u.proto.isMissing) { Assert(u.proto.prototypeObject->GetScriptContext() == requestContext); // we never cache a type from another script context *propertyValue = u.proto.prototypeObject->GetAuxSlot(u.proto.slotIndex); // TODO: This assert often results in Assert(RootObjectBase::Is(object)) inside GetRootProperty, which is misleading // when the problem is that GetProperty returned a different value than propertyValue. Consider reworking it here and elsewhere. Assert(*propertyValue == JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext) || *propertyValue == JavascriptOperators::GetRootProperty(propertyObject, propertyId, requestContext)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Proto; operationInfo->slotType = SlotType_Aux; } return true; } if (CheckAccessor && type == u.accessor.type) { Assert(propertyObject->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(u.accessor.flags & InlineCacheGetterFlag); RecyclableObject *const function = RecyclableObject::FromVar(u.accessor.object->GetInlineSlot(u.accessor.slotIndex)); *propertyValue = JavascriptOperators::CallGetter(function, instance, requestContext); // Can't assert because the getter could have a side effect #ifdef CHKGETTER Assert(JavascriptOperators::Equal(*propertyValue, JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext), requestContext)); #endif if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Getter; operationInfo->slotType = SlotType_Inline; } return true; } if (CheckAccessor && TypeWithAuxSlotTag(type) == u.accessor.type) { Assert(propertyObject->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(u.accessor.flags & InlineCacheGetterFlag); RecyclableObject *const function = RecyclableObject::FromVar(u.accessor.object->GetAuxSlot(u.accessor.slotIndex)); *propertyValue = JavascriptOperators::CallGetter(function, instance, requestContext); // Can't assert because the getter could have a side effect #ifdef CHKGETTER Assert(JavascriptOperators::Equal(*propertyValue, JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext), requestContext)); #endif if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Getter; operationInfo->slotType = SlotType_Aux; } return true; } if (CheckMissing && type == u.proto.type && this->u.proto.isMissing) { Assert(u.proto.prototypeObject->GetScriptContext() == requestContext); // we never cache a type from another script context *propertyValue = u.proto.prototypeObject->GetInlineSlot(u.proto.slotIndex); // TODO: This assert often results in Assert(RootObjectBase::Is(object)) inside GetRootProperty, which is misleading // when the problem is that GetProperty returned a different value than propertyValue. Consider reworking it here and elsewhere. Assert(*propertyValue == JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext) || *propertyValue == JavascriptOperators::GetRootProperty(propertyObject, propertyId, requestContext)); #ifdef MISSING_PROPERTY_STATS if (PHASE_STATS1(MissingPropertyCachePhase)) { requestContext->RecordMissingPropertyHit(); } #endif if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Proto; operationInfo->slotType = SlotType_Inline; } return true; } if (CheckMissing && TypeWithAuxSlotTag(type) == u.proto.type && this->u.proto.isMissing) { Assert(u.proto.prototypeObject->GetScriptContext() == requestContext); // we never cache a type from another script context *propertyValue = u.proto.prototypeObject->GetAuxSlot(u.proto.slotIndex); // TODO: This assert often results in Assert(RootObjectBase::Is(object)) inside GetRootProperty, which is misleading // when the problem is that GetProperty returned a different value than propertyValue. Consider reworking it here and elsewhere. Assert(*propertyValue == JavascriptOperators::GetProperty(propertyObject, propertyId, requestContext) || *propertyValue == JavascriptOperators::GetRootProperty(propertyObject, propertyId, requestContext)); #ifdef MISSING_PROPERTY_STATS if (PHASE_STATS1(MissingPropertyCachePhase)) { requestContext->RecordMissingPropertyHit(); } #endif if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Proto; operationInfo->slotType = SlotType_Aux; } return true; } return false; } template< bool CheckLocal, bool CheckLocalTypeWithoutProperty, bool CheckAccessor, bool ReturnOperationInfo> bool InlineCache::TrySetProperty( RecyclableObject *const object, const PropertyId propertyId, Var propertyValue, ScriptContext *const requestContext, PropertyCacheOperationInfo *const operationInfo, const PropertyOperationFlags propertyOperationFlags) { CompileAssert(CheckLocal || CheckLocalTypeWithoutProperty || CheckAccessor); Assert(!ReturnOperationInfo || operationInfo); CompileAssert(!ReturnOperationInfo || (CheckLocal && CheckLocalTypeWithoutProperty && CheckAccessor)); Assert(object); Assert(propertyId != Constants::NoProperty); Assert(requestContext); DebugOnly(VerifyRegistrationForInvalidation(this, requestContext, propertyId)); #if DBG const bool isRoot = (propertyOperationFlags & PropertyOperation_Root) != 0; bool canSetField; // To verify if we can set a field on the object Var setterValue = nullptr; { // We need to disable implicit call to ensure the check doesn't cause unwanted side effects in debug code // Save old disableImplicitFlags and implicitCallFlags and disable implicit call and exception ThreadContext * threadContext = requestContext->GetThreadContext(); DisableImplicitFlags disableImplicitFlags = *threadContext->GetAddressOfDisableImplicitFlags(); Js::ImplicitCallFlags implicitCallFlags = threadContext->GetImplicitCallFlags(); threadContext->ClearImplicitCallFlags(); *threadContext->GetAddressOfDisableImplicitFlags() = DisableImplicitCallAndExceptionFlag; DescriptorFlags flags = DescriptorFlags::None; canSetField = !JavascriptOperators::CheckPrototypesForAccessorOrNonWritablePropertySlow(object, propertyId, &setterValue, &flags, isRoot, requestContext); if (threadContext->GetImplicitCallFlags() != Js::ImplicitCall_None) { canSetField = true; // If there was an implicit call, inconclusive. Disable debug check. setterValue = nullptr; } else if ((flags & Accessor) == Accessor) { Assert(setterValue != nullptr); } // Restore old disableImplicitFlags and implicitCallFlags *threadContext->GetAddressOfDisableImplicitFlags() = disableImplicitFlags; threadContext->SetImplicitCallFlags(implicitCallFlags); } #endif Type *const type = object->GetType(); if (CheckLocal && type == u.local.type) { Assert(object->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(isRoot || object->GetPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(u.local.slotIndex, true)); Assert(!isRoot || RootObjectBase::FromVar(object)->GetRootPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(u.local.slotIndex, true)); Assert(object->CanStorePropertyValueDirectly(propertyId, isRoot)); DynamicObject::FromVar(object)->SetInlineSlot(SetSlotArgumentsRoot(propertyId, isRoot, u.local.slotIndex, propertyValue)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Local; operationInfo->slotType = SlotType_Inline; } Assert(canSetField); return true; } if (CheckLocal && TypeWithAuxSlotTag(type) == u.local.type) { Assert(object->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(isRoot || object->GetPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(u.local.slotIndex, false)); Assert(!isRoot || RootObjectBase::FromVar(object)->GetRootPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(u.local.slotIndex, false)); Assert(object->CanStorePropertyValueDirectly(propertyId, isRoot)); DynamicObject::FromVar(object)->SetAuxSlot(SetSlotArgumentsRoot(propertyId, isRoot, u.local.slotIndex, propertyValue)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Local; operationInfo->slotType = SlotType_Aux; } Assert(canSetField); return true; } if (CheckLocalTypeWithoutProperty && type == u.local.typeWithoutProperty) { // CAREFUL! CheckIfPrototypeChainHasOnlyWritableDataProperties may do allocation that triggers GC and // clears this cache, so save any info that is needed from the cache before calling those functions. Type *const typeWithProperty = u.local.type; const PropertyIndex propertyIndex = u.local.slotIndex; #if DBG uint16 newAuxSlotCapacity = u.local.requiredAuxSlotCapacity; #endif Assert(object->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(typeWithProperty); Assert(DynamicType::Is(typeWithProperty->GetTypeId())); Assert(((DynamicType*)typeWithProperty)->GetIsShared()); Assert(((DynamicType*)typeWithProperty)->GetTypeHandler()->IsPathTypeHandler()); AssertMsg(!((DynamicType*)u.local.typeWithoutProperty)->GetTypeHandler()->GetIsPrototype(), "Why did we cache a property add for a prototype?"); Assert(((DynamicType*)typeWithProperty)->GetTypeHandler()->CanStorePropertyValueDirectly((const DynamicObject*)object, propertyId, isRoot)); DynamicObject *const dynamicObject = DynamicObject::FromVar(object); // If we're adding a property to an inlined slot, we should never need to adjust auxiliary slot array size. Assert(newAuxSlotCapacity == 0); dynamicObject->type = typeWithProperty; Assert(isRoot || object->GetPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(propertyIndex, true)); Assert(!isRoot || RootObjectBase::FromVar(object)->GetRootPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(propertyIndex, true)); dynamicObject->SetInlineSlot(SetSlotArgumentsRoot(propertyId, isRoot, propertyIndex, propertyValue)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_LocalWithoutProperty; operationInfo->slotType = SlotType_Inline; } Assert(canSetField); return true; } if (CheckLocalTypeWithoutProperty && TypeWithAuxSlotTag(type) == u.local.typeWithoutProperty) { // CAREFUL! CheckIfPrototypeChainHasOnlyWritableDataProperties or AdjustSlots may do allocation that triggers GC and // clears this cache, so save any info that is needed from the cache before calling those functions. Type *const typeWithProperty = TypeWithoutAuxSlotTag(u.local.type); const PropertyIndex propertyIndex = u.local.slotIndex; uint16 newAuxSlotCapacity = u.local.requiredAuxSlotCapacity; Assert(object->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(typeWithProperty); Assert(DynamicType::Is(typeWithProperty->GetTypeId())); Assert(((DynamicType*)typeWithProperty)->GetIsShared()); Assert(((DynamicType*)typeWithProperty)->GetTypeHandler()->IsPathTypeHandler()); AssertMsg(!((DynamicType*)TypeWithoutAuxSlotTag(u.local.typeWithoutProperty))->GetTypeHandler()->GetIsPrototype(), "Why did we cache a property add for a prototype?"); Assert(((DynamicType*)typeWithProperty)->GetTypeHandler()->CanStorePropertyValueDirectly((const DynamicObject*)object, propertyId, isRoot)); DynamicObject *const dynamicObject = DynamicObject::FromVar(object); if (newAuxSlotCapacity > 0) { DynamicTypeHandler::AdjustSlots( dynamicObject, static_cast<DynamicType *>(typeWithProperty)->GetTypeHandler()->GetInlineSlotCapacity(), newAuxSlotCapacity); } dynamicObject->type = typeWithProperty; Assert(isRoot || object->GetPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(propertyIndex, false)); Assert(!isRoot || RootObjectBase::FromVar(object)->GetRootPropertyIndex(propertyId) == DynamicObject::FromVar(object)->GetTypeHandler()->InlineOrAuxSlotIndexToPropertyIndex(propertyIndex, false)); dynamicObject->SetAuxSlot(SetSlotArgumentsRoot(propertyId, isRoot, propertyIndex, propertyValue)); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_LocalWithoutProperty; operationInfo->slotType = SlotType_Aux; } Assert(canSetField); return true; } if (CheckAccessor && type == u.accessor.type) { Assert(object->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(u.accessor.flags & InlineCacheSetterFlag); RecyclableObject *const function = RecyclableObject::FromVar(u.accessor.object->GetInlineSlot(u.accessor.slotIndex)); Assert(setterValue == nullptr || setterValue == function); Js::JavascriptOperators::CallSetter(function, object, propertyValue, requestContext); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Setter; operationInfo->slotType = SlotType_Inline; } return true; } if (CheckAccessor && TypeWithAuxSlotTag(type) == u.accessor.type) { Assert(object->GetScriptContext() == requestContext); // we never cache a type from another script context Assert(u.accessor.flags & InlineCacheSetterFlag); RecyclableObject *const function = RecyclableObject::FromVar(u.accessor.object->GetAuxSlot(u.accessor.slotIndex)); Assert(setterValue == nullptr || setterValue == function); Js::JavascriptOperators::CallSetter(function, object, propertyValue, requestContext); if (ReturnOperationInfo) { operationInfo->cacheType = CacheType_Setter; operationInfo->slotType = SlotType_Aux; } return true; } return false; } template< bool CheckLocal, bool CheckProto, bool CheckAccessor> void PolymorphicInlineCache::CloneInlineCacheToEmptySlotInCollision(Type * const type, uint inlineCacheIndex) { if (CheckLocal && (inlineCaches[inlineCacheIndex].u.local.type == type || inlineCaches[inlineCacheIndex].u.local.type == TypeWithAuxSlotTag(type))) { return; } if (CheckProto && (inlineCaches[inlineCacheIndex].u.proto.type == type || inlineCaches[inlineCacheIndex].u.proto.type == TypeWithAuxSlotTag(type))) { return; } if (CheckAccessor && (inlineCaches[inlineCacheIndex].u.accessor.type == type || inlineCaches[inlineCacheIndex].u.accessor.type == TypeWithAuxSlotTag(type))) { return; } if (this->IsFull()) { // If the cache is full, we won't find an empty slot to move the contents of the colliding inline cache to. return; } // Collision is with a cache having a different type. uint tryInlineCacheIndex = GetNextInlineCacheIndex(inlineCacheIndex); // Iterate over the inline caches in the polymorphic cache, stop when: // 1. an empty inline cache is found, or // 2. a cache already populated with the incoming type is found, or // 3. all the inline caches have been looked at. while (!inlineCaches[tryInlineCacheIndex].IsEmpty() && tryInlineCacheIndex != inlineCacheIndex) { if (CheckLocal && (inlineCaches[tryInlineCacheIndex].u.local.type == type || inlineCaches[tryInlineCacheIndex].u.local.type == TypeWithAuxSlotTag(type))) { break; } if (CheckProto && (inlineCaches[tryInlineCacheIndex].u.proto.type == type || inlineCaches[tryInlineCacheIndex].u.proto.type == TypeWithAuxSlotTag(type))) { Assert(GetInlineCacheIndexForType(inlineCaches[tryInlineCacheIndex].u.proto.type) == inlineCacheIndex); break; } if (CheckAccessor && (inlineCaches[tryInlineCacheIndex].u.accessor.type == type || inlineCaches[tryInlineCacheIndex].u.accessor.type == TypeWithAuxSlotTag(type))) { Assert(GetInlineCacheIndexForType(inlineCaches[tryInlineCacheIndex].u.accessor.type) == inlineCacheIndex); break; } tryInlineCacheIndex = GetNextInlineCacheIndex(tryInlineCacheIndex); } if (tryInlineCacheIndex != inlineCacheIndex) { if (inlineCaches[inlineCacheIndex].invalidationListSlotPtr != nullptr) { Assert(*(inlineCaches[inlineCacheIndex].invalidationListSlotPtr) == &inlineCaches[inlineCacheIndex]); if (inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr != nullptr) { Assert(*(inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr) == &inlineCaches[tryInlineCacheIndex]); } else { inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr = inlineCaches[inlineCacheIndex].invalidationListSlotPtr; *(inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr) = &inlineCaches[tryInlineCacheIndex]; inlineCaches[inlineCacheIndex].invalidationListSlotPtr = nullptr; } } inlineCaches[tryInlineCacheIndex].u = inlineCaches[inlineCacheIndex].u; UpdateInlineCachesFillInfo(tryInlineCacheIndex, true /*set*/); // Let's clear the cache slot on which we had the collision. We might have stolen the invalidationListSlotPtr, // so it may not pass VerifyRegistrationForInvalidation. Besides, it will be repopulated with the incoming data, // and registered for invalidation, if necessary. inlineCaches[inlineCacheIndex].Clear(); Assert((this->inlineCachesFillInfo & (1 << inlineCacheIndex)) != 0); UpdateInlineCachesFillInfo(inlineCacheIndex, false /*set*/); } } #ifdef CLONE_INLINECACHE_TO_EMPTYSLOT template <typename TDelegate> bool PolymorphicInlineCache::CheckClonedInlineCache(uint inlineCacheIndex, TDelegate mapper) { bool success = false; uint tryInlineCacheIndex = GetNextInlineCacheIndex(inlineCacheIndex); do { if (inlineCaches[tryInlineCacheIndex].IsEmpty()) { break; } success = mapper(tryInlineCacheIndex); if (success) { Assert(inlineCaches[inlineCacheIndex].invalidationListSlotPtr == nullptr || *inlineCaches[inlineCacheIndex].invalidationListSlotPtr == &inlineCaches[inlineCacheIndex]); Assert(inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr == nullptr || *inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr == &inlineCaches[tryInlineCacheIndex]); // Swap inline caches, including their invalidationListSlotPtrs. InlineCache temp = inlineCaches[tryInlineCacheIndex]; inlineCaches[tryInlineCacheIndex] = inlineCaches[inlineCacheIndex]; inlineCaches[inlineCacheIndex] = temp; // Fix up invalidationListSlotPtrs to point to their owners. if (inlineCaches[inlineCacheIndex].invalidationListSlotPtr != nullptr) { *inlineCaches[inlineCacheIndex].invalidationListSlotPtr = &inlineCaches[inlineCacheIndex]; } if (inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr != nullptr) { *inlineCaches[tryInlineCacheIndex].invalidationListSlotPtr = &inlineCaches[tryInlineCacheIndex]; } break; } tryInlineCacheIndex = GetNextInlineCacheIndex(tryInlineCacheIndex); } while (tryInlineCacheIndex != inlineCacheIndex); return success; } #endif template< bool CheckLocal, bool CheckProto, bool CheckAccessor, bool CheckMissing, bool IsInlineCacheAvailable, bool ReturnOperationInfo> bool PolymorphicInlineCache::TryGetProperty( Var const instance, RecyclableObject *const propertyObject, const PropertyId propertyId, Var *const propertyValue, ScriptContext *const requestContext, PropertyCacheOperationInfo *const operationInfo, InlineCache *const inlineCacheToPopulate) { Assert(!IsInlineCacheAvailable || inlineCacheToPopulate); Assert(!ReturnOperationInfo || operationInfo); Type * const type = propertyObject->GetType(); uint inlineCacheIndex = GetInlineCacheIndexForType(type); InlineCache *cache = &inlineCaches[inlineCacheIndex]; #ifdef INLINE_CACHE_STATS bool isEmpty = false; if (PHASE_STATS1(Js::PolymorphicInlineCachePhase)) { isEmpty = cache->IsEmpty(); } #endif bool result = cache->TryGetProperty<CheckLocal, CheckProto, CheckAccessor, CheckMissing, ReturnOperationInfo>( instance, propertyObject, propertyId, propertyValue, requestContext, operationInfo); #ifdef CLONE_INLINECACHE_TO_EMPTYSLOT if (!result && !cache->IsEmpty()) { result = CheckClonedInlineCache(inlineCacheIndex, [&](uint tryInlineCacheIndex) -> bool { cache = &inlineCaches[tryInlineCacheIndex]; return cache->TryGetProperty<CheckLocal, CheckProto, CheckAccessor, CheckMissing, ReturnOperationInfo>( instance, propertyObject, propertyId, propertyValue, requestContext, operationInfo); }); } #endif if (IsInlineCacheAvailable && result) { cache->CopyTo(propertyId, requestContext, inlineCacheToPopulate); } #ifdef INLINE_CACHE_STATS if (PHASE_STATS1(Js::PolymorphicInlineCachePhase)) { bool collision = !result && !isEmpty; this->functionBody->GetScriptContext()->LogCacheUsage(this, /*isGet*/ true, propertyId, result, collision); } #endif return result; } template< bool CheckLocal, bool CheckLocalTypeWithoutProperty, bool CheckAccessor, bool IsInlineCacheAvailable, bool ReturnOperationInfo> bool PolymorphicInlineCache::TrySetProperty( RecyclableObject *const object, const PropertyId propertyId, Var propertyValue, ScriptContext *const requestContext, PropertyCacheOperationInfo *const operationInfo, InlineCache *const inlineCacheToPopulate, const PropertyOperationFlags propertyOperationFlags) { Assert(!IsInlineCacheAvailable || inlineCacheToPopulate); Assert(!ReturnOperationInfo || operationInfo); Type * const type = object->GetType(); uint inlineCacheIndex = GetInlineCacheIndexForType(type); InlineCache *cache = &inlineCaches[inlineCacheIndex]; #ifdef INLINE_CACHE_STATS bool isEmpty = false; if (PHASE_STATS1(Js::PolymorphicInlineCachePhase)) { isEmpty = cache->IsEmpty(); } #endif bool result = cache->TrySetProperty<CheckLocal, CheckLocalTypeWithoutProperty, CheckAccessor, ReturnOperationInfo>( object, propertyId, propertyValue, requestContext, operationInfo, propertyOperationFlags); #ifdef CLONE_INLINECACHE_TO_EMPTYSLOT if (!result && !cache->IsEmpty()) { result = CheckClonedInlineCache(inlineCacheIndex, [&](uint tryInlineCacheIndex) -> bool { cache = &inlineCaches[tryInlineCacheIndex]; return cache->TrySetProperty<CheckLocal, CheckLocalTypeWithoutProperty, CheckAccessor, ReturnOperationInfo>( object, propertyId, propertyValue, requestContext, operationInfo, propertyOperationFlags); }); } #endif if (IsInlineCacheAvailable && result) { cache->CopyTo(propertyId, requestContext, inlineCacheToPopulate); } #ifdef INLINE_CACHE_STATS if (PHASE_STATS1(Js::PolymorphicInlineCachePhase)) { bool collision = !result && !isEmpty; this->functionBody->GetScriptContext()->LogCacheUsage(this, /*isGet*/ false, propertyId, result, collision); } #endif return result; } }
48.504717
212
0.651723
[ "object" ]
ca596557c3cb1231e9f44c088fa0628cc4393c3a
911
cpp
C++
Online-Judges/HackerEarth/Xsquare_And_Double_Strings.cpp
shihab4t/Competitive-Programming
e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be
[ "Unlicense" ]
3
2021-06-15T01:19:23.000Z
2022-03-16T18:23:53.000Z
Online-Judges/HackerEarth/Xsquare_And_Double_Strings.cpp
shihab4t/Competitive-Programming
e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be
[ "Unlicense" ]
null
null
null
Online-Judges/HackerEarth/Xsquare_And_Double_Strings.cpp
shihab4t/Competitive-Programming
e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be
[ "Unlicense" ]
null
null
null
#include <bits/stdc++.h> using namespace std; //typedef typedef long long int lli; typedef long double ld; typedef string str; //define #define endn "\n" #define faststdio ios_base::sync_with_stdio(false); #define fastcincout cin.tie(NULL); cout.tie(NULL); #define fastio faststdio fastcincout #define tc(sl) int T; cin >>T; while (T--) {sl;} #define vec vector //functions template <typename T> inline void print_vector(vector<T> &vac) { for (int ele:vac) cout <<ele <<" "; cout <<"\n";} // Solve void test(void) { str st; cin >>st; vec<int> chr_hash(27, 0); for (int i = 0; i < st.size(); i++) { chr_hash[st[i]-97]++; if (chr_hash[st[i]-97] > 1) { cout <<"Yes" <<endn; return; } } cout <<"No" <<endn; } int main(void) { fastio; tc(test()); return 0; } // Solved By: shihab4t // Thursday, June 17, 2021 | 06:54:36 PM (+06)
21.186047
51
0.591658
[ "vector" ]
ca59a2671284aacc313ea0ce676524e9f44961e1
5,451
cpp
C++
gnc/matlab/code_generation/bpm_blower_1_propulsion_module_ert_rtw/blower_aerodynamics.cpp
sahibdhanjal/astrobee
5bc4e6e58adcf1bc7e1c3719ced736063bba276c
[ "Apache-2.0" ]
1
2018-07-07T06:13:20.000Z
2018-07-07T06:13:20.000Z
gnc/matlab/code_generation/bpm_blower_1_propulsion_module_ert_rtw/blower_aerodynamics.cpp
sahibdhanjal/astrobee
5bc4e6e58adcf1bc7e1c3719ced736063bba276c
[ "Apache-2.0" ]
null
null
null
gnc/matlab/code_generation/bpm_blower_1_propulsion_module_ert_rtw/blower_aerodynamics.cpp
sahibdhanjal/astrobee
5bc4e6e58adcf1bc7e1c3719ced736063bba276c
[ "Apache-2.0" ]
1
2018-09-09T05:49:51.000Z
2018-09-09T05:49:51.000Z
// // File: blower_aerodynamics.cpp // // Code generated for Simulink model 'bpm_blower_1_propulsion_module'. // // Model version : 1.1142 // Simulink Coder version : 8.11 (R2016b) 25-Aug-2016 // C/C++ source code generated on : Wed Jan 31 12:34:43 2018 // // Target selection: ert.tlc // Embedded hardware selection: 32-bit Generic // Code generation objectives: Unspecified // Validation result: Not run // #include "blower_aerodynamics.h" // Include model header file for global data #include "bpm_blower_1_propulsion_module.h" #include "bpm_blower_1_propulsion_module_private.h" // System initialize for atomic system: '<S1>/blower_aerodynamics' void bpm_bl_blower_aerodynamics_Init(DW_blower_aerodynamics_bpm_bl_T *localDW, P_blower_aerodynamics_bpm_blo_T *localP, real_T rtp_noz_randn_seed) { uint32_T tseed; int32_T r; int32_T t; real_T y1; int32_T i; for (i = 0; i < 6; i++) { // InitializeConditions for DiscreteIntegrator: '<S2>/Discrete-Time Integrator' localDW->DiscreteTimeIntegrator_DSTATE[i] = localP->DiscreteTimeIntegrator_IC; // InitializeConditions for RandomNumber: '<S2>/random_noise' y1 = floor(rtp_noz_randn_seed + rtCP_random_noise_rtw_collapsed[i]); if (rtIsNaN(y1) || rtIsInf(y1)) { y1 = 0.0; } else { y1 = fmod(y1, 4.294967296E+9); } tseed = y1 < 0.0 ? (uint32_T)(int32_T)-(int32_T)(uint32_T)-y1 : (uint32_T)y1; r = (int32_T)(uint32_T)(tseed >> 16U); t = (int32_T)(uint32_T)(tseed & 32768U); tseed = (uint32_T)((uint32_T)((uint32_T)((uint32_T)((uint32_T)(tseed - (uint32_T)((uint32_T)r << 16U)) + (uint32_T)t) << 16U) + (uint32_T)t) + (uint32_T)r); if (tseed < 1U) { tseed = 1144108930U; } else { if (tseed > 2147483646U) { tseed = 2147483646U; } } y1 = rt_nrand_Upu32_Yd_f_pw_snf(&tseed) * localP->random_noise_StdDev[i] + localP->random_noise_Mean; localDW->NextOutput[i] = y1; localDW->RandSeed[i] = tseed; // End of InitializeConditions for RandomNumber: '<S2>/random_noise' } } // Output and update for atomic system: '<S1>/blower_aerodynamics' void bpm_blower__blower_aerodynamics(real32_T rtu_rotor_speed, const real32_T rtu_nozzle_areas[6], B_blower_aerodynamics_bpm_blo_T *localB, DW_blower_aerodynamics_bpm_bl_T *localDW, P_blower_aerodynamics_bpm_blo_T *localP, real32_T rtp_imp_zero_thrust_area, real32_T rtp_imp_zero_thrust_area_error, real32_T rtp_noise_on_flag, const real32_T rtp_noz_cd[6], const real32_T rtp_noz_cd_error[6], const real32_T rtp_imp_cdp_lookup[334], const real32_T rtp_imp_area_lookup[334], real32_T rtp_imp_diameter, real32_T rtp_const_air_den, const real_T rtp_noz_thrust_noise_feedback[6]) { real32_T rtb_walking_bias[6]; real32_T rtb_Product2_i[6]; real32_T rtb_Cdp; int32_T i; for (i = 0; i < 6; i++) { // Sum: '<S2>/Add3' incorporates: // Constant: '<S2>/Constant3' // Constant: '<S2>/Constant8' // Gain: '<S2>/Gain1' rtb_Cdp = rtp_noise_on_flag * rtp_noz_cd_error[i] + rtp_noz_cd[i]; // Product: '<S2>/Product2' rtb_Product2_i[i] = rtb_Cdp * rtu_nozzle_areas[i]; // Sum: '<S2>/Add3' rtb_walking_bias[i] = rtb_Cdp; } // Sum: '<S2>/Sum of Elements1' rtb_Cdp = rtb_Product2_i[0]; for (i = 0; i < 5; i++) { rtb_Cdp += rtb_Product2_i[(int32_T)(i + 1)]; } // End of Sum: '<S2>/Sum of Elements1' // Sum: '<S2>/Add' incorporates: // Constant: '<S2>/Constant5' // Constant: '<S2>/Constant6' // Gain: '<S2>/Gain2' rtb_Cdp += rtp_noise_on_flag * rtp_imp_zero_thrust_area_error + rtp_imp_zero_thrust_area; // Lookup_n-D: '<S2>/bpm_Cdp_lookup' rtb_Cdp = look1_iflf_binlxpw(rtb_Cdp, rtp_imp_area_lookup, rtp_imp_cdp_lookup, 333U); // Product: '<S2>/Product3' incorporates: // Constant: '<S2>/Constant1' // Constant: '<S2>/Constant2' rtb_Cdp = rtu_rotor_speed * rtu_rotor_speed * rtb_Cdp * rtp_imp_diameter * rtp_imp_diameter * rtp_const_air_den; // Constant: '<S2>/Constant7' localB->Constant7 = localP->Constant7_Value; for (i = 0; i < 6; i++) { // Sum: '<S2>/Add1' incorporates: // Constant: '<S2>/Constant4' // DataTypeConversion: '<S2>/Data Type Conversion' // DiscreteIntegrator: '<S2>/Discrete-Time Integrator' // Product: '<S2>/Product1' // Product: '<S2>/Product6' // Product: '<S2>/Product7' localB->Add1[i] = localP->Constant4_Value * rtb_walking_bias[i] * rtb_walking_bias[i] * rtb_Cdp * rtu_nozzle_areas[i] + (real32_T) localDW->DiscreteTimeIntegrator_DSTATE[i]; // Update for DiscreteIntegrator: '<S2>/Discrete-Time Integrator' incorporates: // DiscreteIntegrator: '<S2>/Discrete-Time Integrator' // Gain: '<S2>/Gain3' // RandomNumber: '<S2>/random_noise' // Sum: '<S2>/Sum' localDW->DiscreteTimeIntegrator_DSTATE[i] += (localDW->NextOutput[i] - rtp_noz_thrust_noise_feedback[i] * localDW-> DiscreteTimeIntegrator_DSTATE[i]) * localP->DiscreteTimeIntegrator_gainval; // Update for RandomNumber: '<S2>/random_noise' localDW->NextOutput[i] = rt_nrand_Upu32_Yd_f_pw_snf(&localDW->RandSeed[i]) * localP->random_noise_StdDev[i] + localP->random_noise_Mean; } } // Termination for atomic system: '<S1>/blower_aerodynamics' void bpm_bl_blower_aerodynamics_Term(void) { } // // File trailer for generated code. // // [EOF] //
33.237805
84
0.679508
[ "model" ]
3ee3c16a6d49cb1f3bfb06713985eb95e06141b6
5,202
cxx
C++
Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx
ferdymercury/ITK
b0a86ded2edd698a6f4a3e58a9db23523a7eb871
[ "Apache-2.0" ]
2
2021-02-01T17:24:16.000Z
2021-02-02T02:18:46.000Z
Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx
ferdymercury/ITK
b0a86ded2edd698a6f4a3e58a9db23523a7eb871
[ "Apache-2.0" ]
1
2021-09-17T23:40:16.000Z
2021-09-17T23:40:16.000Z
Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx
ferdymercury/ITK
b0a86ded2edd698a6f4a3e58a9db23523a7eb871
[ "Apache-2.0" ]
2
2015-03-27T16:14:47.000Z
2019-01-17T23:40:03.000Z
/*========================================================================= * * Copyright NumFOCUS * * 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.txt * * 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 "itkVoronoiSegmentationImageFilter.h" #include "itkVoronoiSegmentationImageFilterBase.h" #include "itkTestingMacros.h" int itkVoronoiSegmentationImageFilterTest(int argc, char * argv[]) { if (argc != 9) { std::cerr << "Missing Parameters." << std::endl; std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " mean std meanTolerance stdTolerance numberOfSeeds steps meanPercentError stdPercentError" << std::endl; return EXIT_FAILURE; } constexpr int width = 256; constexpr int height = 256; using UShortImage = itk::Image<unsigned short, 2>; using PriorImage = itk::Image<unsigned char, 2>; using VoronoiSegmentationImageFilterType = itk::VoronoiSegmentationImageFilter<UShortImage, UShortImage, PriorImage>; auto voronoiSegmenter = VoronoiSegmentationImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( voronoiSegmenter, VoronoiSegmentationImageFilter, VoronoiSegmentationImageFilterBase); auto inputImage = UShortImage::New(); UShortImage::SizeType size = { { width, height } }; UShortImage::IndexType index; index.Fill(0); UShortImage::RegionType region; region.SetSize(size); region.SetIndex(index); std::cout << "Allocating image" << std::endl; inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->SetRequestedRegion(region); inputImage->Allocate(); itk::ImageRegionIteratorWithIndex<UShortImage> it(inputImage, region); // Background: random field with mean: 500, std: 50 std::cout << "Setting background random pattern image" << std::endl; while (!it.IsAtEnd()) { it.Set((unsigned short)(vnl_sample_uniform(450, 550))); ++it; } // Object (2): random field with mean: 520, std: 20 std::cout << "Defining object #2" << std::endl; unsigned int i; unsigned int j; for (i = 30; i < 94; ++i) { index[0] = i; for (j = 30; j < 94; ++j) { index[1] = j; inputImage->SetPixel(index, (unsigned short)(vnl_sample_uniform(500, 540))); } } for (i = 150; i < 214; ++i) { index[0] = i; for (j = 150; j < 214; ++j) { index[1] = j; inputImage->SetPixel(index, (unsigned short)(vnl_sample_uniform(500, 540))); } } int k; unsigned short TestImg[65536]; voronoiSegmenter->SetInput(inputImage); auto mean = std::stod(argv[1]); voronoiSegmenter->SetMean(mean); ITK_TEST_SET_GET_VALUE(mean, voronoiSegmenter->GetMean()); auto std = std::stod(argv[2]); voronoiSegmenter->SetSTD(std); ITK_TEST_SET_GET_VALUE(std, voronoiSegmenter->GetSTD()); auto meanTolerance = std::stod(argv[3]); voronoiSegmenter->SetMeanTolerance(meanTolerance); ITK_TEST_SET_GET_VALUE(meanTolerance, voronoiSegmenter->GetMeanTolerance()); auto stdTolerance = std::stod(argv[4]); voronoiSegmenter->SetSTDTolerance(stdTolerance); ITK_TEST_SET_GET_VALUE(stdTolerance, voronoiSegmenter->GetSTDTolerance()); auto numberOfSeeds = std::stoi(argv[5]); voronoiSegmenter->SetNumberOfSeeds(numberOfSeeds); ITK_TEST_SET_GET_VALUE(numberOfSeeds, voronoiSegmenter->GetNumberOfSeeds()); auto steps = std::stoi(argv[6]); voronoiSegmenter->SetSteps(steps); ITK_TEST_SET_GET_VALUE(steps, voronoiSegmenter->GetSteps()); auto meanPercentError = std::stod(argv[7]); voronoiSegmenter->SetMeanPercentError(meanPercentError); ITK_TEST_SET_GET_VALUE(meanPercentError, voronoiSegmenter->GetMeanPercentError()); auto stdPercentError = std::stod(argv[8]); voronoiSegmenter->SetSTDPercentError(stdPercentError); ITK_TEST_SET_GET_VALUE(stdPercentError, voronoiSegmenter->GetSTDPercentError()); std::cout << "Running algorithm" << std::endl; voronoiSegmenter->Update(); std::cout << "Walking output" << std::endl; itk::ImageRegionIteratorWithIndex<UShortImage> ot(voronoiSegmenter->GetOutput(), region); k = 0; while (!ot.IsAtEnd()) { TestImg[k] = ot.Get(); (void)(TestImg[k]); // prevents "set but not used" warning k++; ++ot; } /* Test OK on local machine. FILE *imgfile = fopen("output.raw","wb"); fwrite(TestImg,2,65536,imgfile); fclose(imgfile); imgfile = fopen("input.raw","wb"); it.GoToBegin(); k=0; while( !it.IsAtEnd()){ TestImg[k]=it.Get(); k++; ++it; } fwrite(TestImg,2,65536,imgfile); fclose(imgfile);*/ std::cout << "Test Succeeded!" << std::endl; return EXIT_SUCCESS; }
30.781065
119
0.675125
[ "object" ]
3ee401a63d4d1587499e4ad7fa4e3072ba512513
4,904
cc
C++
thirdparty/aria2/src/json.cc
deltegic/deltegic
9b4f3a505a6842db52efbe850150afbab3af5e2f
[ "BSD-3-Clause" ]
null
null
null
thirdparty/aria2/src/json.cc
deltegic/deltegic
9b4f3a505a6842db52efbe850150afbab3af5e2f
[ "BSD-3-Clause" ]
2
2021-04-08T08:46:23.000Z
2021-04-08T08:57:58.000Z
thirdparty/aria2/src/json.cc
deltegic/deltegic
9b4f3a505a6842db52efbe850150afbab3af5e2f
[ "BSD-3-Clause" ]
null
null
null
/* <!-- copyright */ /* * aria2 - The high speed download utility * * Copyright (C) 2011 Tatsuhiro Tsujikawa * * 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; either version 2 of the License, or * (at your option) any later version. * * 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 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. */ /* copyright --> */ #include "json.h" #include <sstream> #include "array_fun.h" #include "a2functional.h" #include "util.h" #include "base64.h" namespace aria2 { namespace json { std::string jsonEscape(const std::string& s) { std::string t; for (std::string::const_iterator i = s.begin(), eoi = s.end(); i != eoi; ++i) { if (*i == '"' || *i == '\\' || *i == '/') { t += "\\"; t += *i; } else if (*i == '\b') { t += "\\b"; } else if (*i == '\f') { t += "\\f"; } else if (*i == '\n') { t += "\\n"; } else if (*i == '\r') { t += "\\r"; } else if (*i == '\t') { t += "\\t"; } else if (in(static_cast<unsigned char>(*i), 0x00u, 0x1Fu)) { t += "\\u00"; char temp[3]; temp[2] = '\0'; temp[0] = (*i >> 4); temp[1] = (*i) & 0x0Fu; for (int j = 0; j < 2; ++j) { if (temp[j] < 10) { temp[j] += '0'; } else { temp[j] += 'A' - 10; } } t += temp; } else { t.append(i, i + 1); } } return t; } // Serializes JSON object or array. std::string encode(const ValueBase* json) { std::ostringstream out; return encode(out, json).str(); } JsonGetParam::JsonGetParam(const std::string& request, const std::string& callback) : request(request), callback(callback) { } JsonGetParam decodeGetParams(const std::string& query) { std::string jsonRequest; std::string callback; if (query.empty() || query[0] != '?') { return JsonGetParam(jsonRequest, callback); } Scip method = std::make_pair(query.end(), query.end()); Scip id = std::make_pair(query.end(), query.end()); Scip params = std::make_pair(query.end(), query.end()); std::vector<Scip> getParams; util::splitIter(query.begin() + 1, query.end(), std::back_inserter(getParams), '&'); for (const auto& i : getParams) { if (util::startsWith(i.first, i.second, "method=")) { method.first = i.first + 7; method.second = i.second; } else if (util::startsWith(i.first, i.second, "id=")) { id.first = i.first + 3; id.second = i.second; } else if (util::startsWith(i.first, i.second, "params=")) { params.first = i.first + 7; params.second = i.second; } else if (util::startsWith(i.first, i.second, "jsoncallback=")) { callback.assign(i.first + 13, i.second); } } std::string decparam = util::percentDecode(params.first, params.second); std::string jsonParam = base64::decode(decparam.begin(), decparam.end()); if (method.first == method.second && id.first == id.second) { // Assume batch call. jsonRequest = jsonParam; } else { jsonRequest = "{"; if (method.first != method.second) { jsonRequest += "\"method\":\""; jsonRequest.append(method.first, method.second); jsonRequest += "\""; } if (id.first != id.second) { jsonRequest += ",\"id\":\""; jsonRequest.append(id.first, id.second); jsonRequest += "\""; } if (params.first != params.second) { jsonRequest += ",\"params\":"; jsonRequest += jsonParam; } jsonRequest += "}"; } return JsonGetParam(jsonRequest, callback); } } // namespace json } // namespace aria2
29.017751
80
0.597675
[ "object", "vector" ]
3eebcec5f5341a5efa52228cff6e67178972111f
2,730
cpp
C++
clients/cpp-pistache-server/generated/model/BundleDataProp.cpp
shinesolutions/swagger-aem
b41f1ae3d23917de38ca5cf116cbcc173368d1e8
[ "Apache-2.0" ]
39
2016-10-02T06:45:12.000Z
2021-09-08T20:39:53.000Z
clients/cpp-pistache-server/generated/model/BundleDataProp.cpp
shinesolutions/swagger-aem
b41f1ae3d23917de38ca5cf116cbcc173368d1e8
[ "Apache-2.0" ]
35
2016-11-02T05:06:34.000Z
2021-09-03T06:03:08.000Z
clients/cpp-pistache-server/generated/model/BundleDataProp.cpp
shinesolutions/swagger-aem
b41f1ae3d23917de38ca5cf116cbcc173368d1e8
[ "Apache-2.0" ]
23
2016-11-07T04:14:42.000Z
2021-02-15T09:49:13.000Z
/** * Adobe Experience Manager (AEM) API * Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API * * The version of the OpenAPI document: 3.5.0-pre.0 * Contact: opensource@shinesolutions.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ #include "BundleDataProp.h" #include "Helpers.h" #include <sstream> namespace org::openapitools::server::model { BundleDataProp::BundleDataProp() { m_Key = ""; m_KeyIsSet = false; m_Value = ""; m_ValueIsSet = false; } void BundleDataProp::validate() const { std::stringstream msg; if (!validate(msg)) { throw org::openapitools::server::helpers::ValidationException(msg.str()); } } bool BundleDataProp::validate(std::stringstream& msg) const { return validate(msg, ""); } bool BundleDataProp::validate(std::stringstream& msg, const std::string& pathPrefix) const { bool success = true; const std::string _pathPrefix = pathPrefix.empty() ? "BundleDataProp" : pathPrefix; return success; } bool BundleDataProp::operator==(const BundleDataProp& rhs) const { return ((!keyIsSet() && !rhs.keyIsSet()) || (keyIsSet() && rhs.keyIsSet() && getKey() == rhs.getKey())) && ((!valueIsSet() && !rhs.valueIsSet()) || (valueIsSet() && rhs.valueIsSet() && getValue() == rhs.getValue())) ; } bool BundleDataProp::operator!=(const BundleDataProp& rhs) const { return !(*this == rhs); } void to_json(nlohmann::json& j, const BundleDataProp& o) { j = nlohmann::json(); if(o.keyIsSet()) j["key"] = o.m_Key; if(o.valueIsSet()) j["value"] = o.m_Value; } void from_json(const nlohmann::json& j, BundleDataProp& o) { if(j.find("key") != j.end()) { j.at("key").get_to(o.m_Key); o.m_KeyIsSet = true; } if(j.find("value") != j.end()) { j.at("value").get_to(o.m_Value); o.m_ValueIsSet = true; } } std::string BundleDataProp::getKey() const { return m_Key; } void BundleDataProp::setKey(std::string const& value) { m_Key = value; m_KeyIsSet = true; } bool BundleDataProp::keyIsSet() const { return m_KeyIsSet; } void BundleDataProp::unsetKey() { m_KeyIsSet = false; } std::string BundleDataProp::getValue() const { return m_Value; } void BundleDataProp::setValue(std::string const& value) { m_Value = value; m_ValueIsSet = true; } bool BundleDataProp::valueIsSet() const { return m_ValueIsSet; } void BundleDataProp::unsetValue() { m_ValueIsSet = false; } } // namespace org::openapitools::server::model
20.073529
112
0.638462
[ "model" ]
3eedcc1fe10804e94160a5bdcbc36cdd08987911
47,224
cc
C++
alljoyn/alljoyn_c/unit_test/SignalsTest.cc
octoblu/alljoyn
a74003fa25af1d0790468bf781a4d49347ec05c4
[ "ISC" ]
37
2015-01-18T21:27:23.000Z
2018-01-12T00:33:43.000Z
alljoyn/alljoyn_c/unit_test/SignalsTest.cc
octoblu/alljoyn
a74003fa25af1d0790468bf781a4d49347ec05c4
[ "ISC" ]
14
2015-02-24T11:44:01.000Z
2020-07-20T18:48:44.000Z
alljoyn/alljoyn_c/unit_test/SignalsTest.cc
octoblu/alljoyn
a74003fa25af1d0790468bf781a4d49347ec05c4
[ "ISC" ]
29
2015-01-23T16:40:52.000Z
2019-10-21T12:22:30.000Z
/****************************************************************************** * Copyright (c) 2012-2014, AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ #include <gtest/gtest.h> #include <alljoyn_c/DBusStdDefines.h> #include <alljoyn_c/BusAttachment.h> #include <alljoyn_c/InterfaceDescription.h> #include <qcc/Thread.h> #include <qcc/Util.h> #include "ajTestCommon.h" #define SESSION_PORT 666 /* * values used for the registersignalhandler test */ bool registersignalhandler_flag; bool registersignalhandler_flag2; bool registersignalhandler_flag3; char sourcePath1[256]; char sourcePath2[256]; char sourcePath3[256]; void AJ_CALL registersignalHandler_Handler(const alljoyn_interfacedescription_member* member, const char* srcPath, alljoyn_message message) { QStatus status = ER_FAIL; EXPECT_STREQ(sourcePath1, srcPath); char* str; status = alljoyn_msgarg_get(alljoyn_message_getarg(message, 0), "s", &str); EXPECT_EQ(ER_OK, status); EXPECT_STREQ("AllJoyn", str); registersignalhandler_flag = true; } void AJ_CALL registersignalHandler_Handler2(const alljoyn_interfacedescription_member* member, const char* srcPath, alljoyn_message message) { QStatus status = ER_FAIL; EXPECT_STREQ(sourcePath2, srcPath); char* str; status = alljoyn_msgarg_get(alljoyn_message_getarg(message, 0), "s", &str); EXPECT_EQ(ER_OK, status); EXPECT_STREQ("AllJoyn", str); registersignalhandler_flag2 = true; } void AJ_CALL registersignalHandler_Handler3(const alljoyn_interfacedescription_member* member, const char* srcPath, alljoyn_message message) { QStatus status = ER_FAIL; EXPECT_STREQ(sourcePath3, srcPath); char* str; status = alljoyn_msgarg_get(alljoyn_message_getarg(message, 0), "s", &str); EXPECT_EQ(ER_OK, status); EXPECT_STREQ("AllJoyn", str); registersignalhandler_flag3 = true; } static QCC_BOOL AJ_CALL accept_session_joiner(const void* context, alljoyn_sessionport sessionPort, const char* joiner, const alljoyn_sessionopts opts) { return QCC_TRUE; } static void AJ_CALL session_joined(const void* context, alljoyn_sessionport sessionPort, alljoyn_sessionid id, const char* joiner) { //printf("session_joined\n"); } TEST(SignalsTest, registersignalhandler_basic) { QStatus status = ER_OK; registersignalhandler_flag = false; registersignalhandler_flag2 = false; snprintf(sourcePath1, 256, "/org/alljoyn/test/signal"); alljoyn_busattachment bus = NULL; bus = alljoyn_busattachment_create("SignalsTest", QCC_TRUE); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { //alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "my_signal", "a{ys}", NULL, NULL, 0); status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; alljoyn_busobject testObj = alljoyn_busobject_create("/org/alljoyn/test/signal", QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObj, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObj); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_member my_signal_member; QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); EXPECT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_addmatch(bus, "type='signal',interface='org.alljoyn.test.signalstest',member='testSignal'"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg_destroy(arg); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag) { break; } qcc::Sleep(10); } EXPECT_TRUE(registersignalhandler_flag); status = alljoyn_busattachment_stop(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_join(bus); alljoyn_busattachment_destroy(bus); alljoyn_busobject_destroy(testObj); } TEST(SignalsTest, registersignalhandler_multiple_signals) { QStatus status = ER_OK; registersignalhandler_flag = false; snprintf(sourcePath1, 256, "/org/alljoyn/test/signal"); snprintf(sourcePath2, 256, "/org/alljoyn/test/signal"); alljoyn_busattachment bus = NULL; bus = alljoyn_busattachment_create("SignalsTest", QCC_TRUE); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { //alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "my_signal", "a{ys}", NULL, NULL, 0); status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; alljoyn_busobject testObj = alljoyn_busobject_create(sourcePath1, QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObj, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObj); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_member my_signal_member; QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); EXPECT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_addmatch(bus, "type='signal',interface='org.alljoyn.test.signalstest',member='testSignal'"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg_destroy(arg); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag && registersignalhandler_flag2) { break; } qcc::Sleep(10); } EXPECT_TRUE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); status = alljoyn_busattachment_stop(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_join(bus); alljoyn_busattachment_destroy(bus); alljoyn_busobject_destroy(testObj); } TEST(SignalsTest, unregistersignalhandler) { QStatus status = ER_OK; registersignalhandler_flag = false; registersignalhandler_flag2 = false; snprintf(sourcePath1, 256, "/org/alljoyn/test/signal"); snprintf(sourcePath2, 256, "/org/alljoyn/test/signal"); alljoyn_busattachment bus = NULL; bus = alljoyn_busattachment_create("SignalsTest", QCC_TRUE); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { //alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "my_signal", "a{ys}", NULL, NULL, 0); status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; alljoyn_busobject testObj = alljoyn_busobject_create(sourcePath1, QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObj, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObj); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_member my_signal_member; QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); ASSERT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_addmatch(bus, "type='signal',interface='org.alljoyn.test.signalstest',member='testSignal'"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag && registersignalhandler_flag2) { break; } qcc::Sleep(10); } EXPECT_TRUE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); registersignalhandler_flag = false; registersignalhandler_flag2 = false; status = alljoyn_busattachment_unregistersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag) { break; } qcc::Sleep(10); } alljoyn_msgarg_destroy(arg); //wait a little longer to make sure the signal still did not come through qcc::Sleep(50); EXPECT_TRUE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); status = alljoyn_busattachment_stop(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_join(bus); alljoyn_busattachment_destroy(bus); alljoyn_busobject_destroy(testObj); } TEST(SignalsTest, register_unregister_signalhandler_with_sourcePath) { QStatus status = ER_OK; registersignalhandler_flag = false; registersignalhandler_flag2 = false; snprintf(sourcePath1, 256, "/org/alljoyn/test/signal/A"); snprintf(sourcePath2, 256, "/org/alljoyn/test/signal/B"); alljoyn_busattachment bus = NULL; bus = alljoyn_busattachment_create("SignalsTest", QCC_TRUE); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { //alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "my_signal", "a{ys}", NULL, NULL, 0); status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; alljoyn_busobject testObjA = alljoyn_busobject_create(sourcePath1, QCC_FALSE, &busObjCbs, NULL); alljoyn_busobject testObjB = alljoyn_busobject_create(sourcePath2, QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObjA, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_addinterface(testObjB, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObjA); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObjB); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_member my_signal_member; QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); ASSERT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_addmatch(bus, "type='signal',interface='org.alljoyn.test.signalstest',member='testSignal'"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //register signal handler with corresponding sourcePath status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler, my_signal_member, sourcePath1); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, sourcePath2); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //send Two signals one for each path status = alljoyn_busobject_signal(testObjA, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObjB, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag && registersignalhandler_flag2) { break; } qcc::Sleep(10); } EXPECT_TRUE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); //Test sending only the signal with the first sourcePath registersignalhandler_flag = false; registersignalhandler_flag2 = false; //send only one signal for sourcePath1 status = alljoyn_busobject_signal(testObjA, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag) { break; } qcc::Sleep(10); } //wait a little longer to make sure the signal still did not come through qcc::Sleep(50); EXPECT_TRUE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); //test sending only the signal with the second sourcePath registersignalhandler_flag = false; registersignalhandler_flag2 = false; //send only one signal for sourcePath2 status = alljoyn_busobject_signal(testObjB, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag2) { break; } qcc::Sleep(10); } //wait a little longer to make sure the signal still did not come through qcc::Sleep(50); EXPECT_FALSE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); //unregister signal using sourcePath registersignalhandler_flag = false; registersignalhandler_flag2 = false; //unregistersignalhandler using wronge sourcePath status = alljoyn_busattachment_unregistersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, sourcePath1); EXPECT_EQ(ER_FAIL, status) << " Actual Status: " << QCC_StatusText(status); //unregistersignalhandler using right sourcePath status = alljoyn_busattachment_unregistersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, sourcePath2); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObjA, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObjB, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg_destroy(arg); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag) { break; } qcc::Sleep(10); } //wait a little longer to make sure the signal still did not come through qcc::Sleep(50); EXPECT_TRUE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); //unregistersignalhandler that has already been unregistered using sourcePath status = alljoyn_busattachment_unregistersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, sourcePath2); EXPECT_EQ(ER_FAIL, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_stop(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_join(bus); alljoyn_busattachment_destroy(bus); alljoyn_busobject_destroy(testObjA); alljoyn_busobject_destroy(testObjB); } TEST(SignalsTest, register_unregister_signalhandler_with_rule) { QStatus status = ER_OK; registersignalhandler_flag = false; registersignalhandler_flag2 = false; snprintf(sourcePath1, 256, "/org/alljoyn/test/signal/A"); snprintf(sourcePath2, 256, "/org/alljoyn/test/signal/B"); snprintf(sourcePath3, 256, "/org/alljoyn/test/signal/C"); char rule1[256], rule2[265], rule3[256], altrule3[256]; snprintf(rule1, sizeof(rule1), "type='signal',member='testSignal',interface='org.alljoyn.test.signalstest',path='%s'", sourcePath1); snprintf(rule2, sizeof(rule2), "type='signal',member='testSignal',interface='org.alljoyn.test.signalstest',path='%s'", sourcePath2); snprintf(rule3, sizeof(rule3), "type='signal',member='testSignal',interface='org.alljoyn.test.signalstest',path='%s'", sourcePath3); snprintf(altrule3, sizeof(altrule3), "member='testSignal',interface='org.alljoyn.test.signalstest',type='signal',path='%s'", sourcePath3); alljoyn_busattachment bus = NULL; bus = alljoyn_busattachment_create("SignalsTest", QCC_TRUE); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { //alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "my_signal", "a{ys}", NULL, NULL, 0); status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; alljoyn_busobject testObjA = alljoyn_busobject_create(sourcePath1, QCC_FALSE, &busObjCbs, NULL); alljoyn_busobject testObjB = alljoyn_busobject_create(sourcePath2, QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObjA, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_addinterface(testObjB, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObjA); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObjB); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_member my_signal_member; QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); ASSERT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_addmatch(bus, "type='signal',interface='org.alljoyn.test.signalstest',member='testSignal'"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //register signal handler with corresponding rule status = alljoyn_busattachment_registersignalhandlerwithrule(bus, &registersignalHandler_Handler, my_signal_member, rule1); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandlerwithrule(bus, &registersignalHandler_Handler2, my_signal_member, rule2); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandlerwithrule(bus, &registersignalHandler_Handler3, my_signal_member, rule3); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //send two signals: for signal handlers 1 and 2, but not for 3 status = alljoyn_busobject_signal(testObjA, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObjB, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag && registersignalhandler_flag2) { break; } qcc::Sleep(10); } EXPECT_TRUE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); EXPECT_FALSE(registersignalhandler_flag3); //Test sending only the signal with the first sourcePath registersignalhandler_flag = false; registersignalhandler_flag2 = false; registersignalhandler_flag3 = false; //send only one signal for sourcePath1 status = alljoyn_busobject_signal(testObjA, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag) { break; } qcc::Sleep(10); } //wait a little longer to make sure the signal still did not come through qcc::Sleep(50); EXPECT_TRUE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); EXPECT_FALSE(registersignalhandler_flag3); //test sending only the signal with the second sourcePath registersignalhandler_flag = false; registersignalhandler_flag2 = false; registersignalhandler_flag3 = false; //send only one signal for sourcePath2 status = alljoyn_busobject_signal(testObjB, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag2) { break; } qcc::Sleep(10); } //wait a little longer to make sure the signal still did not come through qcc::Sleep(50); EXPECT_FALSE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); EXPECT_FALSE(registersignalhandler_flag3); //unregister signal using sourcePath registersignalhandler_flag = false; registersignalhandler_flag2 = false; registersignalhandler_flag3 = false; //unregistersignalhandler using wrong rule status = alljoyn_busattachment_unregistersignalhandlerwithrule(bus, &registersignalHandler_Handler2, my_signal_member, rule1); EXPECT_EQ(ER_FAIL, status) << " Actual Status: " << QCC_StatusText(status); //unregistersignalhandler using right rule status = alljoyn_busattachment_unregistersignalhandlerwithrule(bus, &registersignalHandler_Handler2, my_signal_member, rule2); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //unregistersignalhandler using right rule with alternate formulation status = alljoyn_busattachment_unregistersignalhandlerwithrule(bus, &registersignalHandler_Handler3, my_signal_member, altrule3); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObjA, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObjB, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg_destroy(arg); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag) { break; } qcc::Sleep(10); } //wait a little longer to make sure the signal still did not come through qcc::Sleep(50); EXPECT_TRUE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); //unregistersignalhandler that has already been unregistered using sourcePath status = alljoyn_busattachment_unregistersignalhandlerwithrule(bus, &registersignalHandler_Handler2, my_signal_member, rule2); EXPECT_EQ(ER_FAIL, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_stop(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_join(bus); alljoyn_busattachment_destroy(bus); alljoyn_busobject_destroy(testObjA); alljoyn_busobject_destroy(testObjB); } TEST(SignalsTest, unregisterallhandlers) { QStatus status = ER_OK; registersignalhandler_flag = false; registersignalhandler_flag2 = false; snprintf(sourcePath1, 256, "/org/alljoyn/test/signal"); snprintf(sourcePath2, 256, "/org/alljoyn/test/signal"); alljoyn_busattachment bus = NULL; bus = alljoyn_busattachment_create("SignalsTest", QCC_TRUE); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { //alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "my_signal", "a{ys}", NULL, NULL, 0); status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; alljoyn_busobject testObj = alljoyn_busobject_create(sourcePath1, QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObj, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObj); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_member my_signal_member; QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); ASSERT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_addmatch(bus, "type='signal',interface='org.alljoyn.test.signalstest',member='testSignal'"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registersignalhandler(bus, &registersignalHandler_Handler2, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag && registersignalhandler_flag2) { break; } qcc::Sleep(10); } EXPECT_TRUE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); registersignalhandler_flag = false; registersignalhandler_flag2 = false; status = alljoyn_busattachment_unregisterallhandlers(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, 0, NULL); alljoyn_msgarg_destroy(arg); //wait a little while to make sure the signal still did not come through qcc::Sleep(100); EXPECT_FALSE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); status = alljoyn_busattachment_stop(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_join(bus); alljoyn_busattachment_destroy(bus); alljoyn_busobject_destroy(testObj); } TEST(SignalsTest, register_unregister_sessionlesssignals) { QStatus status = ER_OK; registersignalhandler_flag = false; registersignalhandler_flag2 = false; snprintf(sourcePath1, 256, "/org/alljoyn/test/signal"); alljoyn_busattachment bus = NULL; bus = alljoyn_busattachment_create("SignalsTest", QCC_TRUE); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; alljoyn_busobject testObj = alljoyn_busobject_create(sourcePath1, QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObj, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObj); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_member my_signal_member; QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); ASSERT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_addmatch(bus, "type='signal',sessionless='t',interface='org.alljoyn.test.signalstest',member='testSignal'"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_message msg = alljoyn_message_create(bus); alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, ALLJOYN_MESSAGE_FLAG_SESSIONLESS, msg); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_cancelsessionlessmessage_serial(testObj, alljoyn_message_getcallserial(msg)); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, 0, my_signal_member, arg, 1, 0, ALLJOYN_MESSAGE_FLAG_SESSIONLESS, msg); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_cancelsessionlessmessage(testObj, msg); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); /* * short pause to allow the background cancelsessionless call to complete. * This is not required it just keeps the daemon from printing errors because * its trying to do things the same time it is being shut down. */ qcc::Sleep(10); alljoyn_msgarg_destroy(arg); alljoyn_message_destroy(msg); status = alljoyn_busattachment_stop(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_join(bus); alljoyn_busattachment_destroy(bus); alljoyn_busobject_destroy(testObj); } class Participant { public: Participant(alljoyn_messagereceiver_signalhandler_ptr handler) { SetUp(handler); } ~Participant() { TearDown(); } void SetUp(alljoyn_messagereceiver_signalhandler_ptr handler) { bus = alljoyn_busattachment_create("SessionTest", false); busname = ajn::genUniqueName(bus); status = alljoyn_busattachment_start(bus); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_connect(bus, ajn::getConnectArg().c_str()); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription testIntf = NULL; status = alljoyn_busattachment_createinterface(bus, "org.alljoyn.test.signalstest", &testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); ASSERT_TRUE(testIntf != NULL); if (status == ER_OK) { //alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "my_signal", "a{ys}", NULL, NULL, 0); status = alljoyn_interfacedescription_addmember(testIntf, ALLJOYN_MESSAGE_SIGNAL, "testSignal", "s", NULL, "newName", 0); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_interfacedescription_activate(testIntf); } /* Set up bus object */ alljoyn_busobject_callbacks busObjCbs = { NULL, NULL, NULL, NULL }; testObj = alljoyn_busobject_create("/org/alljoyn/test/signal", QCC_FALSE, &busObjCbs, NULL); status = alljoyn_busobject_addinterface(testObj, testIntf); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_registerbusobject(bus, testObj); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); QCC_BOOL foundMember = alljoyn_interfacedescription_getmember(testIntf, "testSignal", &my_signal_member); EXPECT_EQ(QCC_TRUE, foundMember); status = alljoyn_busattachment_registersignalhandler(bus, handler, my_signal_member, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); /* request name */ uint32_t flags = DBUS_NAME_FLAG_REPLACE_EXISTING | DBUS_NAME_FLAG_DO_NOT_QUEUE; status = alljoyn_busattachment_requestname(bus, busname.c_str(), flags); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); /* Create session port listener */ alljoyn_sessionportlistener_callbacks spl_cbs = { &accept_session_joiner, /* accept session joiner CB */ &session_joined /* session joined CB */ }; sessionPortListener = alljoyn_sessionportlistener_create(&spl_cbs, NULL); /* Bind SessionPort */ alljoyn_sessionopts opts = alljoyn_sessionopts_create(ALLJOYN_TRAFFIC_TYPE_MESSAGES, QCC_FALSE, ALLJOYN_PROXIMITY_ANY, ALLJOYN_TRANSPORT_ANY); alljoyn_sessionport sp = SESSION_PORT; status = alljoyn_busattachment_bindsessionport(bus, &sp, opts, sessionPortListener); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); /* Advertise Name */ status = alljoyn_busattachment_advertisename(bus, busname.c_str(), alljoyn_sessionopts_get_transports(opts)); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_sessionopts_destroy(opts); } void TearDown() { alljoyn_busattachment_stop(bus); alljoyn_busattachment_join(bus); EXPECT_NO_FATAL_FAILURE(alljoyn_busattachment_destroy(bus)); alljoyn_sessionportlistener_destroy(sessionPortListener); alljoyn_busobject_destroy(testObj); } void Emit() { alljoyn_msgarg arg = alljoyn_msgarg_array_create(1); size_t numArgs = 1; status = alljoyn_msgarg_array_set(arg, &numArgs, "s", "AllJoyn"); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busobject_signal(testObj, NULL, ALLJOYN_SESSION_ID_ALL_HOSTED, my_signal_member, arg, 1, 0, 0, NULL); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_msgarg_destroy(arg); } QStatus status; alljoyn_busattachment bus; alljoyn_busobject testObj; alljoyn_buslistener buslistener; alljoyn_sessionportlistener sessionPortListener; alljoyn_interfacedescription_member my_signal_member; qcc::String busname; }; TEST(SignalsTest, registersignalhandler_sessioncast) { QStatus status = ER_OK; registersignalhandler_flag = registersignalhandler_flag2 = registersignalhandler_flag3 = false; Participant one(&registersignalHandler_Handler); Participant two(&registersignalHandler_Handler2); Participant three(&registersignalHandler_Handler3); snprintf(sourcePath1, 256, "/org/alljoyn/test/signal"); snprintf(sourcePath2, 256, "/org/alljoyn/test/signal"); snprintf(sourcePath3, 256, "/org/alljoyn/test/signal"); /* no sessions set up yet */ one.Emit(); two.Emit(); three.Emit(); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag || registersignalhandler_flag2 || registersignalhandler_flag3) { break; } qcc::Sleep(10); } EXPECT_FALSE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); EXPECT_FALSE(registersignalhandler_flag3); registersignalhandler_flag = registersignalhandler_flag2 = registersignalhandler_flag3 = false; /* set up some sessions */ alljoyn_sessionopts opts = alljoyn_sessionopts_create(ALLJOYN_TRAFFIC_TYPE_MESSAGES, QCC_FALSE, ALLJOYN_PROXIMITY_ANY, ALLJOYN_TRANSPORT_ANY); alljoyn_sessionid sid; status = alljoyn_busattachment_joinsession(two.bus, one.busname.c_str(), SESSION_PORT, NULL, &sid, opts); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); status = alljoyn_busattachment_joinsession(three.bus, one.busname.c_str(), SESSION_PORT, NULL, &sid, opts); EXPECT_EQ(ER_OK, status) << " Actual Status: " << QCC_StatusText(status); alljoyn_sessionopts_destroy(opts); /* give the host bus attachment some time to catch up on all this */ qcc::Sleep(500); /* now we should see some signals */ one.Emit(); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag || (registersignalhandler_flag2 && registersignalhandler_flag3)) { break; } qcc::Sleep(10); } EXPECT_FALSE(registersignalhandler_flag); EXPECT_TRUE(registersignalhandler_flag2); EXPECT_TRUE(registersignalhandler_flag3); registersignalhandler_flag = registersignalhandler_flag2 = registersignalhandler_flag3 = false; /* we expect nothing if we emit from the joiners... */ two.Emit(); three.Emit(); //Wait upto 2 seconds for the signal to complete. for (int i = 0; i < 200; ++i) { if (registersignalhandler_flag || registersignalhandler_flag2 || registersignalhandler_flag3) { break; } qcc::Sleep(10); } EXPECT_FALSE(registersignalhandler_flag); EXPECT_FALSE(registersignalhandler_flag2); EXPECT_FALSE(registersignalhandler_flag3); registersignalhandler_flag = registersignalhandler_flag2 = registersignalhandler_flag3 = false; }
43.970205
150
0.706759
[ "object" ]
3eee080dccbe493d6cca08c539d151f13ba95238
6,575
cpp
C++
src/core/electrodeRenderer.cpp
BetaRavener/BrainActivityVisualizer
baf61856d67fbe31880bc4c6610621142777ac19
[ "BSD-3-Clause" ]
null
null
null
src/core/electrodeRenderer.cpp
BetaRavener/BrainActivityVisualizer
baf61856d67fbe31880bc4c6610621142777ac19
[ "BSD-3-Clause" ]
null
null
null
src/core/electrodeRenderer.cpp
BetaRavener/BrainActivityVisualizer
baf61856d67fbe31880bc4c6610621142777ac19
[ "BSD-3-Clause" ]
1
2021-07-12T00:49:41.000Z
2021-07-12T00:49:41.000Z
// Author: Ivan Sevcik <ivan-sevcik@hotmail.com> // Licensed under BSD 3-Clause License (see licenses/LICENSE.txt) #include "electrodeRenderer.h" #include <iostream> #include <string> #include <glm/gtc/type_ptr.hpp> #include "glmHelpers.h" #include "GL/glew.h" #include <QImage> #include <QPainter> #include <QString> ElectrodeRenderer::ElectrodeRenderer() : _electrodeCount(0), _electrodesChanged(false) { } ElectrodeRenderer::~ElectrodeRenderer() { } void ElectrodeRenderer::init() { _renderEngine = new us::UniShader(); _namesEngine = new us::UniShader(); _electrodePosAttrBuf = us::Buffer<float>::create(); _electrodeColorAttrBuf = us::Buffer<float>::create(); _namesBottomLeftUVAttrBuf = us::Buffer<float>::create(); _namesTopRightUVAttrBuf = us::Buffer<float>::create(); initializeShaders(); } void ElectrodeRenderer::render() { if (_electrodesChanged) { updateElectrodes(); prepareNamesTexture(); _electrodesChanged = false; } if (_electrodeCount > 0) { prepareColorBuffer(); _renderEngine->render(us::PrimitiveType::POINTS, _electrodeCount); if (_showNames) { glEnable(GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); _namesEngine->render(us::PrimitiveType::POINTS, _electrodeCount); glDisable(GL_BLEND); } } } void ElectrodeRenderer::update(glm::vec3 eyePos, glm::vec3 upDir, glm::vec3 rightDir, glm::mat4 mvpMatrix) { _namesEyePosUnif->setSource(glm::value_ptr(eyePos), 3); _namesUpDirUnif->setSource(glm::value_ptr(upDir), 3); _namesRightDirUnif->setSource(glm::value_ptr(rightDir), 3); _namesMvpMatrixUnif->setSource(glm::value_ptr(mvpMatrix), 16); } void ElectrodeRenderer::electrodes(std::vector<Electrode::WeakPtr> electrodes) { _electrodes = std::vector<Electrode::WeakPtr>(); for (auto electrode : electrodes) { if (electrodePresent(electrode)) _electrodes.push_back(electrode); } _electrodesChanged = true; } void ElectrodeRenderer::reloadShaders() { if (_renderEngine != nullptr) { _renderEngine->disconnectProgram(); delete _renderEngine; _renderEngine = new us::UniShader(); } initializeShaders(); } void ElectrodeRenderer::showNames(bool show) { _showNames = show; } void ElectrodeRenderer::initializeShaders() { auto vertexShader = us::ShaderObject::create(); vertexShader->loadFile("shaders/electrodeNames.vert"); auto geometryShader = us::ShaderObject::create(); geometryShader->loadFile("shaders/electrodeNames.geom"); auto fragmentShader = us::ShaderObject::create(); fragmentShader->loadFile("shaders/electrodeNames.frag"); auto program = us::ShaderProgram::create(); program->addShaderObject(vertexShader); program->addShaderObject(geometryShader); program->addShaderObject(fragmentShader); program->ensureLink(); auto input = program->getInput(); _namesPosAttr = input->addAttribute("position"); _namesBottomLeftUVAttr = input->addAttribute("bottomLeftUV"); _namesTopRightUVAttr = input->addAttribute("topRightUV"); _namesEyePosUnif = input->addUniform("eyePos"); _namesUpDirUnif = input->addUniform("upDir"); _namesRightDirUnif = input->addUniform("rightDir"); _namesTextureUnif = input->addUniform("namesTextureSampler"); _namesMvpMatrixUnif = input->addUniform("mvpMatrix"); _namesTextureAspectUnif = input->addUniform("textureAspect"); _namesPosAttr->connectBuffer(_electrodePosAttrBuf); _namesPosAttr->setReadingMode(us::Attribute::ReadingMode::FLOAT); _namesBottomLeftUVAttr->connectBuffer(_namesBottomLeftUVAttrBuf); _namesBottomLeftUVAttr->setReadingMode(us::Attribute::ReadingMode::FLOAT); _namesTopRightUVAttr->connectBuffer(_namesTopRightUVAttrBuf); _namesTopRightUVAttr->setReadingMode(us::Attribute::ReadingMode::FLOAT); _namesEngine->connectProgram(program); } void ElectrodeRenderer::prepareNamesTexture() { if (_electrodes.size() == 0) return; int maxHorizontal = 2048; QSize imageSize(2048,0); QPoint currentPos(0,0); int currentLineHeight = 0; QFont font("Times", 50, QFont::Bold); QFontMetrics metrics(font); std::vector<QRect> electrodeNameRects; for (unsigned int i = 0; i < _electrodes.size(); i++) { QString str = QString::fromStdString(_electrodes[i]->name()); QRect rect = metrics.boundingRect(str); if (currentPos.x() + rect.width() + 1 > maxHorizontal) { imageSize.setHeight(imageSize.height() + currentLineHeight); currentPos.setX(0); currentPos.setY(currentPos.y() + currentLineHeight); currentLineHeight = 0; } rect.moveTopLeft(currentPos); electrodeNameRects.push_back(rect); currentPos = rect.topRight(); currentPos.setX(currentPos.x() + 1); if (rect.height() > currentLineHeight) currentLineHeight = rect.height(); } imageSize.setHeight(imageSize.height() + currentLineHeight); imageSize.setHeight(glm::Helpers::geqPow2(imageSize.height())); QImage img(imageSize, QImage::Format_RGBA8888); QPainter painter(&img); painter.setPen(Qt::white); painter.setFont(font); std::vector<float> bottomLeftVec; std::vector<float> topRightVec; for (unsigned int i = 0; i < electrodeNameRects.size(); i++) { QString str = QString::fromStdString(_electrodes[i]->name()); painter.drawText(electrodeNameRects[i], str); QRect& rect = electrodeNameRects[i]; glm::Helpers::pushBack(bottomLeftVec, glm::vec2((float)rect.left() / imageSize.width(), (float)rect.bottom() / imageSize.height())); glm::Helpers::pushBack(topRightVec, glm::vec2((float)rect.right() / imageSize.width(), (float)rect.top() / imageSize.height())); } painter.end(); _namesBottomLeftUVAttrBuf->setData(bottomLeftVec); _namesTopRightUVAttrBuf->setData(topRightVec); us::Texture::Ptr texture = us::Texture::create(us::Texture::TextureType::TWO_DIM); texture->setData(img.constBits(), imageSize.width(), imageSize.height()); texture->setMipmaping(true); _namesTextureUnif->setSource(texture); _namesTextureAspectUnif->setSource((float)imageSize.width() / imageSize.height()); }
31.610577
106
0.673308
[ "render", "vector" ]
3ef08720f7d3c99df2a2899a4520b561bc1b649c
6,750
cpp
C++
ArcGISRuntimeSDKQt_CppSamples/EditData/UpdateAttributesFeatureService/UpdateAttributesFeatureService.cpp
acmorris/arcgis-runtime-samples-qt
8881b619142afaabd6bda4f28b80ce74b8c8e71c
[ "Apache-2.0" ]
null
null
null
ArcGISRuntimeSDKQt_CppSamples/EditData/UpdateAttributesFeatureService/UpdateAttributesFeatureService.cpp
acmorris/arcgis-runtime-samples-qt
8881b619142afaabd6bda4f28b80ce74b8c8e71c
[ "Apache-2.0" ]
null
null
null
ArcGISRuntimeSDKQt_CppSamples/EditData/UpdateAttributesFeatureService/UpdateAttributesFeatureService.cpp
acmorris/arcgis-runtime-samples-qt
8881b619142afaabd6bda4f28b80ce74b8c8e71c
[ "Apache-2.0" ]
null
null
null
// [WriteFile Name=UpdateAttributesFeatureService, Category=EditData] // [Legal] // Copyright 2016 Esri. // 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. // [Legal] #include "UpdateAttributesFeatureService.h" #include "Map.h" #include "MapQuickView.h" #include "Basemap.h" #include "Viewpoint.h" #include "Point.h" #include "SpatialReference.h" #include "ServiceFeatureTable.h" #include "FeatureLayer.h" #include "Feature.h" #include "ArcGISFeature.h" #include "FeatureEditResult.h" #include "FeatureQueryResult.h" #include <QUrl> #include <QUuid> #include <QMouseEvent> using namespace Esri::ArcGISRuntime; UpdateAttributesFeatureService::UpdateAttributesFeatureService(QQuickItem* parent) : QQuickItem(parent) { } UpdateAttributesFeatureService::~UpdateAttributesFeatureService() { } void UpdateAttributesFeatureService::init() { qmlRegisterType<MapQuickView>("Esri.Samples", 1, 0, "MapView"); qmlRegisterType<UpdateAttributesFeatureService>("Esri.Samples", 1, 0, "UpdateAttributesFeatureServiceSample"); } void UpdateAttributesFeatureService::componentComplete() { QQuickItem::componentComplete(); // find QML MapView component m_mapView = findChild<MapQuickView*>("mapView"); m_mapView->setWrapAroundMode(WrapAroundMode::Disabled); // create a Map by passing in the Basemap m_map = new Map(Basemap::streets(this), this); m_map->setInitialViewpoint(Viewpoint(Point(-10800000, 4500000, SpatialReference(102100)), 3e7)); // set map on the map view m_mapView->setMap(m_map); // create the ServiceFeatureTable m_featureTable = new ServiceFeatureTable(QUrl("http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0"), this); // create the FeatureLayer with the ServiceFeatureTable and add it to the Map m_featureLayer = new FeatureLayer(m_featureTable, this); m_featureLayer->setSelectionWidth(3); m_map->operationalLayers()->append(m_featureLayer); connectSignals(); } void UpdateAttributesFeatureService::connectSignals() { // connect to the mouse clicked signal on the MapQuickView connect(m_mapView, &MapQuickView::mouseClicked, this, [this](QMouseEvent& mouseEvent) { // first clear the selection m_featureLayer->clearSelection(); // set the properties for qml m_screenX = mouseEvent.x(); emit screenXChanged(); m_screenY = mouseEvent.y(); emit screenYChanged(); emit hideWindow(); // call identify on the map view m_mapView->identifyLayer(m_featureLayer, mouseEvent.x(), mouseEvent.y(), 5, false, 1); }); // connect to the viewpoint changed signal on the MapQuickView connect(m_mapView, &MapQuickView::viewpointChanged, this, [this]() { m_featureLayer->clearSelection(); emit hideWindow(); }); // connect to the identifyLayerCompleted signal on the map view connect(m_mapView, &MapQuickView::identifyLayerCompleted, this, [this](QUuid, IdentifyLayerResult* identifyResult) { if(!identifyResult) return; if (!identifyResult->geoElements().empty()) { // select the item in the result m_featureLayer->selectFeature(static_cast<Feature*>(identifyResult->geoElements().at(0))); // obtain the selected feature with attributes QueryParameters queryParams; QString whereClause = "objectid=" + identifyResult->geoElements().at(0)->attributes()->attributeValue("objectid").toString(); queryParams.setWhereClause(whereClause); m_featureTable->queryFeatures(queryParams); } }); // connect to the queryFeaturesCompleted signal on the feature table connect(m_featureTable, &FeatureTable::queryFeaturesCompleted, this, [this](QUuid, FeatureQueryResult* featureQueryResult) { if (featureQueryResult && featureQueryResult->iterator().hasNext()) { // first delete if not nullptr if (m_selectedFeature != nullptr) delete m_selectedFeature; // set selected feature member m_selectedFeature = static_cast<ArcGISFeature*>(featureQueryResult->iterator().next(this)); m_featureType = m_selectedFeature->attributes()->attributeValue("typdamage").toString(); emit featureTypeChanged(); emit featureSelected(); } }); // connect to the updateFeatureCompleted signal to determine if the update was successful connect(m_featureTable, &ServiceFeatureTable::updateFeatureCompleted, this, [this](QUuid, bool success) { // if the update was successful, call apply edits to apply to the service if (success) m_featureTable->applyEdits(); }); // connect to the applyEditsCompleted signal from the ServiceFeatureTable connect(m_featureTable, &ServiceFeatureTable::applyEditsCompleted, this, [this](QUuid, const QList<FeatureEditResult*>& featureEditResults) { // check if result list is not empty if (!featureEditResults.isEmpty()) { // obtain the first item in the list auto featureEditResult = featureEditResults.first(); // check if there were errors, and if not, log the new object ID if (!featureEditResult->isCompletedWithErrors()) qDebug() << "Successfully updated attribute for Object ID:" << featureEditResult->objectId(); else qDebug() << "Apply edits error."; } m_featureLayer->clearSelection(); }); } void UpdateAttributesFeatureService::updateSelectedFeature(QString fieldVal) { // connect to load status changed signal connect(m_selectedFeature, &ArcGISFeature::loadStatusChanged, this, [this, fieldVal](Esri::ArcGISRuntime::LoadStatus) { if (m_selectedFeature->loadStatus() == LoadStatus::Loaded) { disconnect(m_selectedFeature, &ArcGISFeature::loadStatusChanged, 0, 0); // bad... // update the select feature's attribute value m_selectedFeature->attributes()->replaceAttribute("typdamage", fieldVal); // update the feature in the feature table m_featureTable->updateFeature(m_selectedFeature); } }); // load selecte feature m_selectedFeature->load(); } int UpdateAttributesFeatureService::screenX() const { return m_screenX; } int UpdateAttributesFeatureService::screenY() const { return m_screenY; } QString UpdateAttributesFeatureService::featureType() const { return m_featureType; }
33.58209
150
0.734519
[ "object" ]
3ef49cfc6cc8560da36998d5271ff76d52383e63
2,995
cpp
C++
ios/versioned-react-native/ABI34_0_0/ReactCommon/ABI34_0_0fabric/imagemanager/ABI34_0_0ImageResponseObserverCoordinator.cpp
rudylee/expo
b3e65a7a5b205f14a3eb6cd6fa8d13c8d663b1cc
[ "Apache-2.0", "MIT" ]
2
2020-01-02T06:07:18.000Z
2021-09-30T11:09:41.000Z
ios/versioned-react-native/ABI34_0_0/ReactCommon/ABI34_0_0fabric/imagemanager/ABI34_0_0ImageResponseObserverCoordinator.cpp
rudylee/expo
b3e65a7a5b205f14a3eb6cd6fa8d13c8d663b1cc
[ "Apache-2.0", "MIT" ]
19
2020-04-07T07:36:24.000Z
2022-03-26T09:32:12.000Z
ios/versioned-react-native/ABI34_0_0/ReactCommon/ABI34_0_0fabric/imagemanager/ABI34_0_0ImageResponseObserverCoordinator.cpp
rudylee/expo
b3e65a7a5b205f14a3eb6cd6fa8d13c8d663b1cc
[ "Apache-2.0", "MIT" ]
2
2019-02-22T08:41:09.000Z
2019-02-22T08:47:56.000Z
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "ABI34_0_0ImageResponseObserverCoordinator.h" #include <algorithm> namespace facebook { namespace ReactABI34_0_0 { ImageResponseObserverCoordinator::ImageResponseObserverCoordinator() { status_ = ImageResponse::Status::Loading; } ImageResponseObserverCoordinator::~ImageResponseObserverCoordinator() {} void ImageResponseObserverCoordinator::addObserver( ImageResponseObserver *observer) const { ImageResponse::Status status = [this] { std::shared_lock<folly::SharedMutex> read(mutex_); return status_; }(); if (status == ImageResponse::Status::Loading) { std::unique_lock<folly::SharedMutex> write(mutex_); observers_.push_back(observer); } else if (status == ImageResponse::Status::Completed) { ImageResponse imageResponseCopy = [this] { std::unique_lock<folly::SharedMutex> read(mutex_); return ImageResponse(imageData_); }(); observer->didReceiveImage(imageResponseCopy); } else { observer->didReceiveFailure(); } } void ImageResponseObserverCoordinator::removeObserver( ImageResponseObserver *observer) const { std::unique_lock<folly::SharedMutex> write(mutex_); auto position = std::find(observers_.begin(), observers_.end(), observer); if (position != observers_.end()) { observers_.erase(position, observers_.end()); } } void ImageResponseObserverCoordinator::nativeImageResponseProgress( float progress) const { std::vector<ImageResponseObserver *> observersCopy = [this] { std::shared_lock<folly::SharedMutex> read(mutex_); return observers_; }(); for (auto observer : observersCopy) { observer->didReceiveProgress(progress); } } void ImageResponseObserverCoordinator::nativeImageResponseComplete( const ImageResponse &imageResponse) const { { std::unique_lock<folly::SharedMutex> write(mutex_); imageData_ = imageResponse.getImage(); status_ = ImageResponse::Status::Completed; } std::vector<ImageResponseObserver *> observersCopy = [this] { std::shared_lock<folly::SharedMutex> read(mutex_); return observers_; }(); for (auto observer : observersCopy) { ImageResponse imageResponseCopy = [this] { std::unique_lock<folly::SharedMutex> read(mutex_); return ImageResponse(imageData_); }(); observer->didReceiveImage(imageResponseCopy); } } void ImageResponseObserverCoordinator::nativeImageResponseFailed() const { { std::unique_lock<folly::SharedMutex> write(mutex_); status_ = ImageResponse::Status::Failed; } std::vector<ImageResponseObserver *> observersCopy = [this] { std::shared_lock<folly::SharedMutex> read(mutex_); return observers_; }(); for (auto observer : observersCopy) { observer->didReceiveFailure(); } } } // namespace ReactABI34_0_0 } // namespace facebook
28.798077
76
0.726878
[ "vector" ]
3ef71834c035d4ff36cb21c9910ba73612796569
11,876
cpp
C++
src/Dron.cpp
KPO-2020-2021/zad5_2-BFigaj
02efc658b3edcb35b19de3731e5228243871ecc8
[ "Unlicense" ]
null
null
null
src/Dron.cpp
KPO-2020-2021/zad5_2-BFigaj
02efc658b3edcb35b19de3731e5228243871ecc8
[ "Unlicense" ]
null
null
null
src/Dron.cpp
KPO-2020-2021/zad5_2-BFigaj
02efc658b3edcb35b19de3731e5228243871ecc8
[ "Unlicense" ]
null
null
null
#include <iostream> #include <fstream> #include <math.h> #include "Dron.hh" #define PLIK_TRASY_PRZELOTU "dat/trasa_przelotu.dat" using namespace std; /*! * \file * \brief W tym pliku zdefiniowane sa funkcje i metody związane z klasa Dron */ /*! * \brief Funkcja okreslajaca ktory to dron * * Funkcja przypisuje parametry poczatkowe w zaleznosci * ktory to dron. * \param[in] i zmienna int jako index okreslajacy drona */ void Dron::KtoryDron(int i) { this->i=i; if(i==0) { Polozenie[0]=20; Polozenie[1]=20; Polozenie[2]=0; } if(i==1) { Polozenie[0]=80; Polozenie[1]=40; Polozenie[2]=0; } } /*! * \brief Funkcja planujaca poczatkowa sciezke drona * * Funkcja wyrysowuje droge jaka dron ma przebyc * \param[in] KatSkretu_stopnie double kat * \param[in] DlugoscLotu double jako wysokosc lotu drona * \param[in] Przemieszczenie wektor3D okreslajacy gdzie mamy przemiescic drona * wpisywany przez uzytkownika * \param[in] kontener szablon vectora z biblioteki std * \param[in] Lacze referencja PzG::LaczeDoGNUPlota */ void Dron::PlanujPoczatkowaSciezke(double KatSkretu_stopnie, double DlugoscLotu, Wektor3D Przemieszczenie, std::vector<Wektor3D> kontener, PzG::LaczeDoGNUPlota& Lacze) { Wektor3D wierz_trasy; ofstream StrmWy(PLIK_TRASY_PRZELOTU); if (!StrmWy.is_open()) { cerr << endl << " Nie mozna otworzyc do zapisu pliku: " << PLIK_TRASY_PRZELOTU << endl << endl; } kontener.reserve(4); wierz_trasy=Polozenie; kontener.push_back(wierz_trasy); wierz_trasy[2]+=DlugoscLotu; kontener.push_back(wierz_trasy); wierz_trasy=wierz_trasy+Przemieszczenie; kontener.push_back(wierz_trasy); wierz_trasy[2]-=DlugoscLotu; kontener.push_back(wierz_trasy); if(Przemieszczenie[2]==0) { StrmWy << kontener[0] << endl << kontener[1] << endl; StrmWy << kontener[2] << endl << kontener[3] << endl; Lacze.DodajNazwePliku(PLIK_TRASY_PRZELOTU); } KatOrientacji_stopnie=KatSkretu_stopnie; for(unsigned int index;index<4;++index) { kontener.pop_back(); } } /*! * \brief Funkcja obliczajaca wspolrzedne globalne drona * * Funkcja oblicza wspolrzedne globalne drona. Wykorzystujac funkcje * olbiczania wspolrzedne globalnych korpusu i obliczania wspolrzedne globalne rotorow. * \param[out] true jesli zarowno zostana poprawnie obliczone wsp. korpusu * jak i rotorow * \param[out] false jezeli wystapi jakikolwiek blad */ bool Dron::Oblicz_i_Zapisz_WspGlbDrona() { if(!Oblicz_i_Zapisz_WspGlbKorpusu()) { cerr << ":( Operacja obliczania i zapisywania wspolrzednych globalnych korpusu nie powiodla sie." << endl; return false; } for(unsigned int j=0;j<4;++j) { if(!Oblicz_i_Zapisz_WspGlbRotora(RotorDrona[j],j)) { cerr << ":( Operacja obliczania i zapisywania wspolrzednych globalnych rotora nie powiodla sie." << endl; return false; } } return true; } /*! * \brief Funkcja obliczajaca wspolrzedne globalne korpusu * * Funkcja oblicza wspolrzedne globalne korpusu. * \param[out] true jesli zostana poprawnie otwarte pliki * \param[out] false jezeli wystapi jakikolwiek blad z otwarciem pliku */ bool Dron::Oblicz_i_Zapisz_WspGlbKorpusu() { Wektor3D vec,skala,trans; ofstream Strumien_plikowy_wy; ifstream Strumien_plikowy_wej; int LicznikWierzcholkow; skala[0]=10; skala[1]=8; skala[2]=4; trans[0]=0; trans[1]=0; trans[2]=2; KorpusDrona.StworzSkale(skala); KorpusDrona.polozenie(trans); KorpusDrona.NazwaplikuW(i,0); KorpusDrona.NazwaplikuF(i,0); /*KorpusDrona.WezNazwePliku_BrylaWzorcowa()*/ Strumien_plikowy_wej.open(KorpusDrona.WezNazwePliku_BrylaWzorcowa()); if (!Strumien_plikowy_wej.is_open()) { cerr << ":( Operacja otwarcia do wczytania korupusu \"" << KorpusDrona.WezNazwePliku_BrylaWzorcowa() << "\"" << endl << ":( nie powiodla sie." << endl; return false; } Strumien_plikowy_wy.open(KorpusDrona.WezNazwePliku_BrylaFinalna()); if (!Strumien_plikowy_wy.is_open()) { cerr << ":( Operacja otwarcia do zapisu \"" << KorpusDrona.WezNazwePliku_BrylaFinalna() << "\"" << endl << ":( nie powiodla sie." << endl; return false; } Strumien_plikowy_wej >> vec; while (!Strumien_plikowy_wej.fail()) { LicznikWierzcholkow=0; for(;LicznikWierzcholkow<4;++LicznikWierzcholkow) { //std::cout << vec << endl; vec=KorpusDrona.Skaluj(vec); //std::cout <<"po skalowaniu korp"<< vec << endl; vec=KorpusDrona.TransfDoUklWspRodzica(vec); //std::cout <<"po rot.trans korp"<< vec << endl; vec=TransfDoUklWspRodzica(vec); //std::cout <<"po trans korp"<< vec << endl; Strumien_plikowy_wy << vec << endl; Strumien_plikowy_wej >> vec; } Strumien_plikowy_wy << endl; } Strumien_plikowy_wej.close(); Strumien_plikowy_wy.close(); return true; } /*! * \brief Funkcja obliczajaca wspolrzedne globalne rotora * * Funkcja oblicza wspolrzedne globalne rotora * \param[out] true jesli zostana poprawnie otwarte pliki * \param[out] false jezeli wystapi jakikolwiek blad z otwarciem pliku */ bool Dron::Oblicz_i_Zapisz_WspGlbRotora(const Graniastoslup6& Rotor,int k) { Wektor3D vec,skala,trans; ofstream Strumien_plikowy_wy; ifstream Strumien_plikowy_wej; int LicznikWierzcholkow; skala[0]=8; skala[1]=8; skala[2]=2; if(k==0) { trans[0]=5; trans[1]=4; trans[2]=5; } if(k==1) { trans[0]=5; trans[1]=-4; trans[2]=5; } if(k==2) { trans[0]=-5; trans[1]=4; trans[2]=5; } if(k==3) { trans[0]=-5; trans[1]=-4; trans[2]=5; } RotorDrona[k].StworzSkale(skala); RotorDrona[k].polozenie(trans); RotorDrona[k].NazwaplikuW(i,k+1); RotorDrona[k].NazwaplikuF(i,k+1); Strumien_plikowy_wej.open(Rotor.WezNazwePliku_BrylaWzorcowa()); if (!Strumien_plikowy_wej.is_open()) { cerr << ":( Operacja otwarcia do wczytania rotora" << Rotor.WezNazwePliku_BrylaWzorcowa() << "" << endl << ":( nie powiodla sie." << endl; return false; } Strumien_plikowy_wy.open(Rotor.WezNazwePliku_BrylaFinalna()); if (!Strumien_plikowy_wy.is_open()) { cerr << ":( Operacja otwarcia do zapisu \"" << Rotor.WezNazwePliku_BrylaFinalna() << "\"" << endl << ":( nie powiodla sie." << endl; return false; } Strumien_plikowy_wej >> vec; while (!Strumien_plikowy_wej.fail()) { LicznikWierzcholkow=0; for(;LicznikWierzcholkow<4;++LicznikWierzcholkow) { //std::cout << vec << endl; vec=Rotor.Skaluj(vec); //std::cout <<"po skalowaniu rotora"<< vec << endl; vec=Rotor.TransfDoUklWspRodzica(vec); //std::cout <<"po rot.trans rotora"<< vec << endl; vec=TransfDoUklWspRodzica(vec); //std::cout <<"po trans rotora"<< vec << endl; Strumien_plikowy_wy << vec << endl; Strumien_plikowy_wej >> vec; } Strumien_plikowy_wy << endl; } Strumien_plikowy_wej.close(); Strumien_plikowy_wy.close(); return true; } /*! * \brief Funkcja wykonujaca pionowy lot * * Funkcja animuje lot w gore lub w dol drona. * \param[in] DlugoscLotu zmienna double oznaczajaca wysokosc lotu * \param[in] Lacze referencja do PzG::LaczeDoGNUPlota * \param[out] true jesli jest poprawna wysokosc * \param[out] false jezeli nie jest poprawna wysokosc */ bool Dron::WykonajPionowyLot(double DlugoscLotu,PzG::LaczeDoGNUPlota& Lacze) { if(Polozenie[2]==0) { std::cout << endl << "Wznoszenie ... " << endl; //std::cout << Polozenie; for (; Polozenie[2] < DlugoscLotu; Polozenie[2] += 2) { //std::cout << Polozenie<< endl; if (!Oblicz_i_Zapisz_WspGlbDrona()) return false; for(unsigned index=0;index<4;++index) { if(index%2==0) { RotorDrona[index].kat(10); } else { RotorDrona[index].kat(-10); } } usleep(100000); // 0.1 ms Lacze.Rysuj(); } if (!Oblicz_i_Zapisz_WspGlbDrona()) return false; for(unsigned index=0;index<4;++index) { if(index%2==0) { RotorDrona[index].kat(10); } else { RotorDrona[index].kat(-10); } } usleep(100000); // 0.1 ms Lacze.Rysuj(); return true; } else if(Polozenie[2]==DlugoscLotu) { std::cout << endl << "Ladowanie ... " << endl; for (; Polozenie[2] > 0; Polozenie[2] -= 2) { if (!Oblicz_i_Zapisz_WspGlbDrona()) return false; for(unsigned index=0;index<4;++index) { if(index%2==0) { RotorDrona[index].kat(10); } else { RotorDrona[index].kat(-10); } } usleep(100000); // 0.1 ms Lacze.Rysuj(); //std::cout << Polozenie[2] <<"==?" << DlugoscLotu << endl; } if (!Oblicz_i_Zapisz_WspGlbDrona()) return false; for(unsigned index=0;index<4;++index) { if(index%2==0) { RotorDrona[index].kat(10); } else { RotorDrona[index].kat(-10); } } usleep(100000); // 0.1 ms Lacze.Rysuj(); //std::cout << Polozenie[2] <<"==?" << DlugoscLotu << endl; return true; } return false; } /*! * \brief Funkcja wykonujaca poziomy lot * * Funkcja animuje lot poziomy drona. * \param[in] DlugoscLotu zmienna double oznaczajaca wysokosc lotu * \param[in] Przemieszczenie zmienna typu wektor3D potrzebna do animowania * \param[in] Lacze referencja do PzG::LaczeDoGNUPlota * \param[out] true jesli jest poprawna wysokosc * \param[out] false jezeli nie jest poprawna wysokosc */ bool Dron::WykonajPoziomyLot(double DlugoscLotu,Wektor3D Przemieszczenie,PzG::LaczeDoGNUPlota& Lacze) { double j=0,KatSzukany; //std::cout << Polozenie[2] <<"==?" << DlugoscLotu << endl; KatSzukany=atan((Przemieszczenie[1]/Przemieszczenie[0])); for (;KatOrientacji_stopnie<((180*KatSzukany)/(M_PI));KatOrientacji_stopnie+=(((180*KatSzukany)/(M_PI))/20)) { //std::cout << KatSzukany << "katO"<< KatOrientacji_stopnie << endl; if (!Oblicz_i_Zapisz_WspGlbDrona()) return false; usleep(100000); // 0.1 ms Lacze.Rysuj(); } //std::cout << Polozenie[2] <<"==?" << DlugoscLotu << endl; if(Polozenie[2]==DlugoscLotu) { std::cout << endl << "Lot do miejsca docelowego ... " << endl; for (double i=0;i<50;i=i+1) { j=j+1; Polozenie[0]=Polozenie[0]+(Przemieszczenie[0]/50); Polozenie[1]=Polozenie[1]+(Przemieszczenie[1]/50); if (!Oblicz_i_Zapisz_WspGlbDrona()) return false; for(unsigned index=0;index<4;++index) { if(index%2==0) { RotorDrona[index].kat(10); } else { RotorDrona[index].kat(-10); } } usleep(100000); // 0.1 ms Lacze.Rysuj(); } if (!Oblicz_i_Zapisz_WspGlbDrona()) return false; for(unsigned index=0;index<4;++index) { if(index%2==0) { RotorDrona[index].kat(10); } else { RotorDrona[index].kat(-10); } } usleep(100000); // 0.1 ms Lacze.Rysuj(); //std::cout << Polozenie << endl; return true; } cerr << "Nie poprawna wysokosc lotu" << endl; return false; } /*! * \brief Funkcja transformujaca wspolrzedne do ukladu rodzica * * Funkcja transformuje wspolrzedne wierzcholkow do ukladu rodzica * \param[in] Wierz wektor3D ktory chcemy transformowac * \param[out] Nowy_polozenie wektor3D przetranformowany */ Wektor3D Dron::TransfDoUklWspRodzica(const Wektor3D& Wierz)const { Wektor3D Nowe_polozenie; Macierz3x3 mtx; mtx=rotmtxz(KatOrientacji_stopnie,mtx); Nowe_polozenie=(Wierz*mtx)+Polozenie; return Nowe_polozenie; }
27.682984
112
0.634641
[ "vector" ]
41025337a03223a328b68ffc2fef280965bcebfd
13,775
cc
C++
content/renderer/media/crypto/key_systems.cc
SlimKatLegacy/android_external_chromium_org
ee480ef5039d7c561fc66ccf52169ead186f1bea
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
2
2015-03-04T02:36:53.000Z
2016-06-25T11:22:17.000Z
content/renderer/media/crypto/key_systems.cc
j4ckfrost/android_external_chromium_org
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
content/renderer/media/crypto/key_systems.cc
j4ckfrost/android_external_chromium_org
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
4
2015-02-09T08:49:30.000Z
2017-08-26T02:03:34.000Z
// Copyright 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. #include "content/renderer/media/crypto/key_systems.h" #include <map> #include <string> #include "base/lazy_instance.h" #include "base/logging.h" #include "base/strings/string_util.h" #include "content/public/common/content_client.h" #include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/key_system_info.h" #include "content/renderer/media/crypto/key_systems_support_uma.h" #include "net/base/mime_util.h" #include "third_party/WebKit/public/platform/WebCString.h" #include "third_party/WebKit/public/platform/WebString.h" #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. namespace content { const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; const char kAudioWebM[] = "audio/webm"; const char kVideoWebM[] = "video/webm"; const char kVorbis[] = "vorbis"; const char kVorbisVP8[] = "vorbis,vp8,vp8.0"; #if defined(USE_PROPRIETARY_CODECS) const char kAudioMp4[] = "audio/mp4"; const char kVideoMp4[] = "video/mp4"; const char kMp4a[] = "mp4a"; const char kMp4aAvc1Avc3[] = "mp4a,avc1,avc3"; #endif // defined(USE_PROPRIETARY_CODECS) #if !defined(GOOGLE_TV) inline std::string KeySystemNameForUMAInternal( const blink::WebString& key_system) { if (key_system == kClearKeyKeySystem) return "ClearKey"; #if defined(WIDEVINE_CDM_AVAILABLE) if (key_system == kWidevineKeySystem) return "Widevine"; #endif // WIDEVINE_CDM_AVAILABLE return "Unknown"; } #else // Declares the function, which is defined in another file. std::string KeySystemNameForUMAInternal(const blink::WebString& key_system); #endif // !defined(GOOGLE_TV) // Convert a WebString to ASCII, falling back on an empty string in the case // of a non-ASCII string. static std::string ToASCIIOrEmpty(const blink::WebString& string) { return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); } static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) { KeySystemInfo info(kClearKeyKeySystem); info.supported_types.push_back(std::make_pair(kAudioWebM, kVorbis)); info.supported_types.push_back(std::make_pair(kVideoWebM, kVorbisVP8)); #if defined(USE_PROPRIETARY_CODECS) info.supported_types.push_back(std::make_pair(kAudioMp4, kMp4a)); info.supported_types.push_back(std::make_pair(kVideoMp4, kMp4aAvc1Avc3)); #endif // defined(USE_PROPRIETARY_CODECS) info.use_aes_decryptor = true; concrete_key_systems->push_back(info); } class KeySystems { public: static KeySystems& GetInstance(); bool IsConcreteSupportedKeySystem(const std::string& key_system); bool IsSupportedKeySystemWithMediaMimeType( const std::string& mime_type, const std::vector<std::string>& codecs, const std::string& key_system); bool UseAesDecryptor(const std::string& concrete_key_system); #if defined(ENABLE_PEPPER_CDMS) std::string GetPepperType(const std::string& concrete_key_system); #elif defined(OS_ANDROID) std::vector<uint8> GetUUID(const std::string& concrete_key_system); #endif private: void AddConcreteSupportedKeySystems( const std::vector<KeySystemInfo>& concrete_key_systems); void AddConcreteSupportedKeySystem( const std::string& key_system, bool use_aes_decryptor, #if defined(ENABLE_PEPPER_CDMS) const std::string& pepper_type, #elif defined(OS_ANDROID) const std::vector<uint8>& uuid, #endif const std::vector<KeySystemInfo::ContainerCodecsPair>& supported_types, const std::string& parent_key_system); friend struct base::DefaultLazyInstanceTraits<KeySystems>; typedef base::hash_set<std::string> CodecSet; typedef std::map<std::string, CodecSet> MimeTypeMap; struct KeySystemProperties { KeySystemProperties() : use_aes_decryptor(false) {} bool use_aes_decryptor; #if defined(ENABLE_PEPPER_CDMS) std::string pepper_type; #elif defined(OS_ANDROID) std::vector<uint8> uuid; #endif MimeTypeMap types; }; typedef std::map<std::string, KeySystemProperties> KeySystemPropertiesMap; typedef std::map<std::string, std::string> ParentKeySystemMap; KeySystems(); ~KeySystems() {} void AddSupportedType(const std::string& mime_type, const std::string& codecs_list, KeySystemProperties* properties); bool IsSupportedKeySystemWithContainerAndCodec(const std::string& mime_type, const std::string& codec, const std::string& key_system); // Map from key system string to capabilities. KeySystemPropertiesMap concrete_key_system_map_; // Map from parent key system to the concrete key system that should be used // to represent its capabilities. ParentKeySystemMap parent_key_system_map_; KeySystemsSupportUMA key_systems_support_uma_; DISALLOW_COPY_AND_ASSIGN(KeySystems); }; static base::LazyInstance<KeySystems> g_key_systems = LAZY_INSTANCE_INITIALIZER; KeySystems& KeySystems::GetInstance() { return g_key_systems.Get(); } // Because we use a LazyInstance, the key systems info must be populated when // the instance is lazily initiated. KeySystems::KeySystems() { std::vector<KeySystemInfo> key_systems_info; GetContentClient()->renderer()->AddKeySystems(&key_systems_info); // Clear Key is always supported. AddClearKey(&key_systems_info); AddConcreteSupportedKeySystems(key_systems_info); #if defined(WIDEVINE_CDM_AVAILABLE) key_systems_support_uma_.AddKeySystemToReport(kWidevineKeySystem); #endif // defined(WIDEVINE_CDM_AVAILABLE) } void KeySystems::AddConcreteSupportedKeySystems( const std::vector<KeySystemInfo>& concrete_key_systems) { for (size_t i = 0; i < concrete_key_systems.size(); ++i) { const KeySystemInfo& key_system_info = concrete_key_systems[i]; AddConcreteSupportedKeySystem(key_system_info.key_system, key_system_info.use_aes_decryptor, #if defined(ENABLE_PEPPER_CDMS) key_system_info.pepper_type, #elif defined(OS_ANDROID) key_system_info.uuid, #endif key_system_info.supported_types, key_system_info.parent_key_system); } } void KeySystems::AddConcreteSupportedKeySystem( const std::string& concrete_key_system, bool use_aes_decryptor, #if defined(ENABLE_PEPPER_CDMS) const std::string& pepper_type, #elif defined(OS_ANDROID) const std::vector<uint8>& uuid, #endif const std::vector<KeySystemInfo::ContainerCodecsPair>& supported_types, const std::string& parent_key_system) { DCHECK(!IsConcreteSupportedKeySystem(concrete_key_system)) << "Key system '" << concrete_key_system << "' already registered"; DCHECK(parent_key_system_map_.find(concrete_key_system) == parent_key_system_map_.end()) << "'" << concrete_key_system << " is already registered as a parent"; KeySystemProperties properties; properties.use_aes_decryptor = use_aes_decryptor; #if defined(ENABLE_PEPPER_CDMS) DCHECK_EQ(use_aes_decryptor, pepper_type.empty()); properties.pepper_type = pepper_type; #elif defined(OS_ANDROID) DCHECK_EQ(use_aes_decryptor, uuid.empty()); DCHECK(use_aes_decryptor || uuid.size() == 16); properties.uuid = uuid; #endif for (size_t i = 0; i < supported_types.size(); ++i) { const KeySystemInfo::ContainerCodecsPair& pair = supported_types[i]; const std::string& mime_type = pair.first; const std::string& codecs_list = pair.second; AddSupportedType(mime_type, codecs_list, &properties); } concrete_key_system_map_[concrete_key_system] = properties; if (!parent_key_system.empty()) { DCHECK(!IsConcreteSupportedKeySystem(parent_key_system)) << "Parent '" << parent_key_system << "' already registered concrete"; DCHECK(parent_key_system_map_.find(parent_key_system) == parent_key_system_map_.end()) << "Parent '" << parent_key_system << "' already registered"; parent_key_system_map_[parent_key_system] = concrete_key_system; } } void KeySystems::AddSupportedType(const std::string& mime_type, const std::string& codecs_list, KeySystemProperties* properties) { std::vector<std::string> mime_type_codecs; net::ParseCodecString(codecs_list, &mime_type_codecs, false); CodecSet codecs(mime_type_codecs.begin(), mime_type_codecs.end()); MimeTypeMap& mime_types_map = properties->types; // mime_types_map must not be repeated for a given key system. DCHECK(mime_types_map.find(mime_type) == mime_types_map.end()); mime_types_map[mime_type] = codecs; } bool KeySystems::IsConcreteSupportedKeySystem(const std::string& key_system) { return concrete_key_system_map_.find(key_system) != concrete_key_system_map_.end(); } bool KeySystems::IsSupportedKeySystemWithContainerAndCodec( const std::string& mime_type, const std::string& codec, const std::string& key_system) { bool has_type = !mime_type.empty(); DCHECK(has_type || codec.empty()); key_systems_support_uma_.ReportKeySystemQuery(key_system, has_type); KeySystemPropertiesMap::const_iterator key_system_iter = concrete_key_system_map_.find(key_system); if (key_system_iter == concrete_key_system_map_.end()) return false; key_systems_support_uma_.ReportKeySystemSupport(key_system, false); if (mime_type.empty()) return true; const MimeTypeMap& mime_types_map = key_system_iter->second.types; MimeTypeMap::const_iterator mime_iter = mime_types_map.find(mime_type); if (mime_iter == mime_types_map.end()) return false; if (codec.empty()) { key_systems_support_uma_.ReportKeySystemSupport(key_system, true); return true; } const CodecSet& codecs = mime_iter->second; if (codecs.find(codec) == codecs.end()) return false; key_systems_support_uma_.ReportKeySystemSupport(key_system, true); return true; } bool KeySystems::IsSupportedKeySystemWithMediaMimeType( const std::string& mime_type, const std::vector<std::string>& codecs, const std::string& key_system) { // If |key_system| is a parent key_system, use its concrete child. // Otherwise, use |key_system|. std::string concrete_key_system; ParentKeySystemMap::iterator parent_key_system_iter = parent_key_system_map_.find(key_system); if (parent_key_system_iter != parent_key_system_map_.end()) concrete_key_system = parent_key_system_iter->second; else concrete_key_system = key_system; if (codecs.empty()) { return IsSupportedKeySystemWithContainerAndCodec( mime_type, std::string(), concrete_key_system); } for (size_t i = 0; i < codecs.size(); ++i) { if (!IsSupportedKeySystemWithContainerAndCodec( mime_type, codecs[i], concrete_key_system)) { return false; } } return true; } bool KeySystems::UseAesDecryptor(const std::string& concrete_key_system) { KeySystemPropertiesMap::iterator key_system_iter = concrete_key_system_map_.find(concrete_key_system); if (key_system_iter == concrete_key_system_map_.end()) { DLOG(FATAL) << concrete_key_system << " is not a known concrete system"; return false; } return key_system_iter->second.use_aes_decryptor; } #if defined(ENABLE_PEPPER_CDMS) std::string KeySystems::GetPepperType(const std::string& concrete_key_system) { KeySystemPropertiesMap::iterator key_system_iter = concrete_key_system_map_.find(concrete_key_system); if (key_system_iter == concrete_key_system_map_.end()) { DLOG(FATAL) << concrete_key_system << " is not a known concrete system"; return std::string(); } const std::string& type = key_system_iter->second.pepper_type; DLOG_IF(FATAL, type.empty()) << concrete_key_system << " is not Pepper-based"; return type; } #elif defined(OS_ANDROID) std::vector<uint8> KeySystems::GetUUID(const std::string& concrete_key_system) { KeySystemPropertiesMap::iterator key_system_iter = concrete_key_system_map_.find(concrete_key_system); if (key_system_iter == concrete_key_system_map_.end()) { DLOG(FATAL) << concrete_key_system << " is not a known concrete system"; return std::vector<uint8>(); } return key_system_iter->second.uuid; } #endif //------------------------------------------------------------------------------ bool IsConcreteSupportedKeySystem(const blink::WebString& key_system) { return KeySystems::GetInstance().IsConcreteSupportedKeySystem( ToASCIIOrEmpty(key_system)); } bool IsSupportedKeySystemWithMediaMimeType( const std::string& mime_type, const std::vector<std::string>& codecs, const std::string& key_system) { return KeySystems::GetInstance().IsSupportedKeySystemWithMediaMimeType( mime_type, codecs, key_system); } std::string KeySystemNameForUMA(const blink::WebString& key_system) { return KeySystemNameForUMAInternal(key_system); } std::string KeySystemNameForUMA(const std::string& key_system) { return KeySystemNameForUMAInternal(blink::WebString::fromUTF8(key_system)); } bool CanUseAesDecryptor(const std::string& concrete_key_system) { return KeySystems::GetInstance().UseAesDecryptor(concrete_key_system); } #if defined(ENABLE_PEPPER_CDMS) std::string GetPepperType(const std::string& concrete_key_system) { return KeySystems::GetInstance().GetPepperType(concrete_key_system); } #elif defined(OS_ANDROID) std::vector<uint8> GetUUID(const std::string& concrete_key_system) { return KeySystems::GetInstance().GetUUID(concrete_key_system); } #endif } // namespace content
34.785354
80
0.735463
[ "vector" ]
41074093c8a7ecb272bb941a0f0ea05572a37ecd
40,599
cc
C++
cc/py/chart-v3.cc
skepner/ae
d53336a561df1a46a39debb143c9f9496b222a46
[ "MIT" ]
null
null
null
cc/py/chart-v3.cc
skepner/ae
d53336a561df1a46a39debb143c9f9496b222a46
[ "MIT" ]
null
null
null
cc/py/chart-v3.cc
skepner/ae
d53336a561df1a46a39debb143c9f9496b222a46
[ "MIT" ]
null
null
null
#include "py/module.hh" #include "py/chart-v3.hh" #include "chart/v3/common.hh" #include "chart/v3/selected-antigens-sera.hh" #include "chart/v3/procrustes.hh" #include "chart/v3/grid-test.hh" #include "chart/v3/chart-seqdb.hh" #include "pybind11/detail/common.h" // ====================================================================== namespace ae::py { using Chart = ae::chart::v3::Chart; struct InfoRef { std::shared_ptr<Chart> chart; ae::chart::v3::TableSource& table_source; std::vector<ae::chart::v3::TableSource>* sources; InfoRef(std::shared_ptr<Chart> a_chart) : chart{a_chart}, table_source{a_chart->info()}, sources{&a_chart->info().sources()} {} InfoRef(std::shared_ptr<Chart> a_chart, ae::chart::v3::TableSource& a_table_source) : chart{a_chart}, table_source{a_table_source}, sources{nullptr} {} InfoRef(const InfoRef&) = delete; InfoRef& operator=(const InfoRef&) = delete; std::string_view virus() const { return *table_source.virus(); } std::string_view type_subtype() const { return *table_source.type_subtype(); } std::string_view assay() const { return *table_source.assay(); } std::string assay_HI_or_Neut() const { return table_source.assay().HI_or_Neut(ae::chart::v3::Assay::no_hi::no); } std::string assay_hi_or_neut() const { return table_source.assay().hi_or_neut(ae::chart::v3::Assay::no_hi::no); } std::string assay_Neut() const { return table_source.assay().HI_or_Neut(ae::chart::v3::Assay::no_hi::yes); } std::string assay_neut() const { return table_source.assay().hi_or_neut(ae::chart::v3::Assay::no_hi::yes); } std::string_view rbc_species() const { return *table_source.rbc_species(); } std::string_view lab() const { return *table_source.lab(); } std::string_view date() const { return *table_source.date(); } std::string_view name() const { return table_source.name(); } std::string_view name_or_date() const { return table_source.name_or_date(); } size_t number_of_sources() const { return sources ? sources->size() : 0ul; } InfoRef* source(size_t no) { if (!sources || sources->empty()) throw std::invalid_argument{"chart table has no sources"}; else if (no >= sources->size()) throw std::invalid_argument{fmt::format("invalid source_no {}, number of sources in the chart table: {}", no, sources->size())}; return new InfoRef{chart, (*sources)[no]}; } }; // ---------------------------------------------------------------------- struct TiterMergeReport { ae::chart::v3::Titers::titer_merge_report report; TiterMergeReport(ae::chart::v3::Titers::titer_merge_report&& a_report) : report{std::move(a_report)} {} std::string brief(size_t ag_no, size_t sr_no) const { if (const auto found = std::find_if(report.begin(), report.end(), [ag_no = antigen_index{ag_no}, sr_no = serum_index{sr_no}](const auto& entry) { return entry.antigen == ag_no && entry.serum == sr_no; }); found != report.end()) return value_brief(found->report); else return {}; } static inline std::string value_brief(ae::chart::v3::Titers::titer_merge data) { using titer_merge = ae::chart::v3::Titers::titer_merge; switch (data) { case titer_merge::all_dontcare: return "*"; case titer_merge::less_and_more_than: return "<>"; case titer_merge::less_than_only: return "<"; case titer_merge::more_than_only_adjust_to_next: return ">+1"; case titer_merge::more_than_only_to_dontcare: return ">*"; case titer_merge::sd_too_big: return "sd>"; case titer_merge::regular_only: return "+"; case titer_merge::max_less_than_bigger_than_max_regular: return "<<+"; case titer_merge::less_than_and_regular: return "<+"; case titer_merge::min_more_than_less_than_min_regular: return ">>+"; case titer_merge::more_than_and_regular: return ">+"; } return "???"; } static inline std::string value_long(ae::chart::v3::Titers::titer_merge data) { using titer_merge = ae::chart::v3::Titers::titer_merge; switch (data) { case titer_merge::all_dontcare: return "all source titers are dont-care"; case titer_merge::less_and_more_than: return "both less-than and more-than present"; case titer_merge::less_than_only: return "less-than only"; case titer_merge::more_than_only_adjust_to_next: return "more-than only, adjust to next"; case titer_merge::more_than_only_to_dontcare: return "more-than only, convert to dont-care"; case titer_merge::sd_too_big: return "standard deviation is too big"; case titer_merge::regular_only: return "regular only"; case titer_merge::max_less_than_bigger_than_max_regular: return "max of less than is bigger than max of regulars"; case titer_merge::less_than_and_regular: return "less than and regular"; case titer_merge::min_more_than_less_than_min_regular: return "min of more-than is less than min of regular"; case titer_merge::more_than_and_regular: return "more than and regular"; } return "(internal error)"; } static inline std::string brief_description() { using titer_merge = ae::chart::v3::Titers::titer_merge; fmt::memory_buffer out; for (auto tm : {titer_merge::all_dontcare, titer_merge::less_and_more_than, titer_merge::less_than_only, titer_merge::more_than_only_adjust_to_next, titer_merge::more_than_only_to_dontcare, titer_merge::sd_too_big, titer_merge::regular_only, titer_merge::max_less_than_bigger_than_max_regular, titer_merge::less_than_and_regular, titer_merge::min_more_than_less_than_min_regular, titer_merge::more_than_and_regular}) { fmt::format_to(std::back_inserter(out), "{:>3s} {}\n", value_brief(tm), value_long(tm)); } return fmt::to_string(out); } }; // ---------------------------------------------------------------------- static inline ae::chart::v3::procrustes_data_t procrustes(const ProjectionRef& proj1, const ProjectionRef& proj2, const ae::chart::v3::common_antigens_sera_t& common, bool scaling) { return ae::chart::v3::procrustes(proj1.projection, proj2.projection, common, scaling ? ae::chart::v3::procrustes_scaling_t::yes : ae::chart::v3::procrustes_scaling_t::no); } static inline serum_indexes make_serum_indexes(const std::vector<size_t>& indexes) { serum_indexes sera; for (const auto sr_no : indexes) sera.push_back(serum_index{sr_no}); return sera; } } // namespace ae::py // ====================================================================== void ae::py::chart_v3(pybind11::module_& mdl) { using namespace std::string_view_literals; using namespace pybind11::literals; using namespace ae::chart::v3; // ---------------------------------------------------------------------- auto chart_v3_submodule = mdl.def_submodule("chart_v3", "chart_v3 api"); pybind11::class_<Chart, std::shared_ptr<Chart>>(chart_v3_submodule, "Chart") // .def(pybind11::init<>(), pybind11::doc("creates an empty chart")) // .def(pybind11::init<const std::filesystem::path&>(), "filename"_a, pybind11::doc("imports chart from a file")) // .def(pybind11::init<const Chart&>(), "chart"_a, pybind11::doc("clone chart")) // .def("write", &Chart::write, "filename"_a, pybind11::doc("exports chart into a file")) // .def( "export", [](const Chart& chart) -> pybind11::bytes { return chart.export_to_json(); }, pybind11::doc("exports chart into json uncompressed, bytes")) // .def("__str__", [](const Chart& chart) { return chart.name(); }) // .def( "name", [](const Chart& chart, std::optional<size_t> projection_no) { if (projection_no.has_value()) return chart.name(projection_index{*projection_no}); else return chart.name(std::nullopt); }, "projection_no"_a = std::nullopt, pybind11::doc("short name of a chart")) // .def("name_for_file", &Chart::name_for_file, pybind11::doc("name of a chart to be used as a filename")) // .def("number_of_antigens", [](const Chart& chart) -> size_t { return *chart.antigens().size(); }) // .def("number_of_sera", [](const Chart& chart) -> size_t { return *chart.sera().size(); }) // .def("number_of_projections", [](const Chart& chart) -> size_t { return *chart.projections().size(); }) // .def("forced_column_bases", [](const Chart& chart) { return chart.forced_column_bases().data(); }) // .def( "column_bases", [](const Chart& chart, std::string_view mcb) { return chart.column_bases(minimum_column_basis{mcb}).data(); }, "minimum_column_basis"_a = "none") // .def("info", [](std::shared_ptr<Chart> chart) { return new InfoRef{chart}; }) // .def("populate_from_seqdb", &populate_from_seqdb, pybind11::doc("populate with sequences from seqdb, returns number of antigens and number of sera that have sequences")) // .def("lineage", [](const Chart& chart) -> std::string_view { return chart.lineage(); }) // .def( "subtype_lineage", [](const Chart& chart) -> std::string { if (const auto subtype = chart.info().type_subtype(); subtype.h_or_b() == "B") return fmt::format("{}{}", subtype, chart.lineage()); else return std::string{*subtype}; }, pybind11::doc("returns A(H1N1), A(H3N2), BV, BY")) // // ---------------------------------------------------------------------- .def( "projection", [](std::shared_ptr<Chart> chart, size_t projection_no) { if (projection_index{projection_no} >= chart->projections().size()) { if (chart->projections().empty()) throw std::invalid_argument{"chart has no projections"}; else throw std::invalid_argument{fmt::format("invalid projection no: {}, number of projections in chart: {}", projection_no, chart->projections().size())}; } return new ProjectionRef{chart, chart->projections()[projection_index{projection_no}]}; // owned by python program }, "projection_no"_a = 0) // .def("combine_projections", &Chart::combine_projections, "merge_in"_a) // // ---------------------------------------------------------------------- .def("titers", pybind11::overload_cast<>(&Chart::titers), pybind11::return_value_policy::reference_internal) // .def("styles", pybind11::overload_cast<>(&Chart::styles), pybind11::return_value_policy::reference_internal) // // ---------------------------------------------------------------------- .def( "relax", // [](Chart& chart, size_t number_of_dimensions, size_t number_of_optimizations, std::string_view mcb, bool dimension_annealing, bool rough, size_t /*number_of_best_distinct_projections_to_keep*/, std::shared_ptr<SelectedAntigens> antigens_to_disconnect, std::shared_ptr<SelectedSera> sera_to_disconnect) { if (number_of_optimizations == 0) number_of_optimizations = 100; optimization_options opt; opt.precision = rough ? optimization_precision::rough : optimization_precision::fine; opt.dimension_annealing = use_dimension_annealing_from_bool(dimension_annealing); ae::disconnected_points disconnect; if (antigens_to_disconnect && !antigens_to_disconnect->empty()) disconnect.insert_if_not_present(antigens_to_disconnect->points()); if (sera_to_disconnect && !sera_to_disconnect->empty()) disconnect.insert_if_not_present(sera_to_disconnect->points()); chart.relax(number_of_optimizations_t{number_of_optimizations}, minimum_column_basis{mcb}, number_of_dimensions_t{number_of_dimensions}, opt, disconnect); chart.projections().sort(chart); }, // "number_of_dimensions"_a = 2, "number_of_optimizations"_a = 0, "minimum_column_basis"_a = "none", "dimension_annealing"_a = false, "rough"_a = false, // "unused_number_of_best_distinct_projections_to_keep"_a = 5, "disconnect_antigens"_a = nullptr, "disconnect_sera"_a = nullptr, // pybind11::doc{"makes one or more antigenic maps from random starting layouts, adds new projections, projections are sorted by stress"}) // .def( "relax_incremental", // [](Chart& chart, size_t projection_no, size_t number_of_optimizations, bool rough, size_t /*number_of_best_distinct_projections_to_keep*/, bool remove_source_projection, bool unmovable_non_nan_points) { if (number_of_optimizations == 0) number_of_optimizations = 100; optimization_options opt; opt.precision = rough ? optimization_precision::rough : optimization_precision::fine; opt.rsp = remove_source_projection ? ae::chart::v3::remove_source_projection::yes : ae::chart::v3::remove_source_projection::no; opt.unnp = unmovable_non_nan_points ? ae::chart::v3::unmovable_non_nan_points::yes : ae::chart::v3::unmovable_non_nan_points::no; chart.relax_incremental(projection_index{projection_no}, number_of_optimizations_t{number_of_optimizations}, opt); chart.projections().sort(chart); }, // "projection_no"_a = 0, "number_of_optimizations"_a = 0, "rough"_a = false, "number_of_best_distinct_projections_to_keep"_a = 5, "remove_source_projection"_a = true, "unmovable_non_nan_points"_a = false) // // ---------------------------------------------------------------------- .def( "grid_test", [](Chart& chart, size_t projection_no) { return grid_test::test(chart, projection_index{projection_no}); }, "projection_no"_a = 0) // // ---------------------------------------------------------------------- .def( "antigen", [](Chart& chart, size_t antigen_no) -> Antigen& { return chart.antigens()[antigen_index{antigen_no}]; }, "antigen_no"_a, pybind11::return_value_policy::reference_internal) // .def( "serum", [](Chart& chart, size_t serum_no) -> Serum& { return chart.sera()[serum_index{serum_no}]; }, "serum_no"_a, pybind11::return_value_policy::reference_internal) // .def( "antigen_date_range", [](const Chart& chart, bool test_only) { return chart.antigens().date_range(test_only, chart.reference()); }, "test_only"_a = true, pybind11::doc("returns pair of dates (str), date range is inclusive!")) // .def( "select_antigens", // [](std::shared_ptr<Chart> chart, const std::function<bool(const SelectionData<Antigen>&)>& func, size_t projection_no) { return new SelectedAntigens{chart, func, projection_index{projection_no}}; }, // "predicate"_a, "projection_no"_a = 0, // pybind11::doc("Passed predicate (function with one arg: SelectionDataAntigen object)\n" "is called for each antigen, selects just antigens for which predicate\n" "returns True, returns SelectedAntigens object.")) // .def( "select_all_antigens", // [](std::shared_ptr<Chart> chart) { return new SelectedAntigens{chart}; }, // pybind11::doc(R"(Select all antigens.)")) // .def( "select_no_antigens", // [](std::shared_ptr<Chart> chart) { return new SelectedAntigens{chart, SelectedAntigens::None}; }, // pybind11::doc(R"(Select no antigens.)")) // .def( "select_reference_antigens", // [](std::shared_ptr<Chart> chart) { return new SelectedAntigens{chart, chart->reference()}; }, // pybind11::doc(R"(Select reference antigens.)")) // .def( "select_new_antigens", // [](std::shared_ptr<Chart> chart, const Chart& previous_chart) { auto* selected = new SelectedAntigens{chart}; selected->filter_new(previous_chart.antigens()); return selected; }, "previous_chart"_a, // pybind11::doc(R"(Select antigens not found in the previous_chart.)")) // // .def("antigens_by_aa_at_pos", &ae::py::antigens_sera_by_aa_at_pos<SelectedAntigens>, "pos"_a, // pybind11::doc(R"(Returns dict with AA at passed pos as keys and SelectedAntigens as values.)")) // // .def("sera_by_aa_at_pos", &ae::py::antigens_sera_by_aa_at_pos<SelectedSera>, "pos"_a, // pybind11::doc(R"(Returns dict with AA at passed pos as keys and SelectedSera as values.)")) // .def( "select_sera", // [](std::shared_ptr<Chart> chart, const std::function<bool(const SelectionData<Serum>&)>& func, size_t projection_no) { return new SelectedSera{chart, func, projection_index{projection_no}}; }, // "predicate"_a, "projection_no"_a = 0, // pybind11::doc("Passed predicate (function with one arg: SelectionDataSerum object)\n" "is called for each serum, selects just sera for which predicate\n" "returns True, returns SelectedSera object.")) // .def( "select_all_sera", // [](std::shared_ptr<Chart> chart) { return new SelectedSera{chart}; }, // pybind11::doc(R"(Select all sera.)")) // .def( "select_no_sera", // [](std::shared_ptr<Chart> chart) { return new SelectedSera{chart, SelectedSera::None}; }, // pybind11::doc(R"(Select no sera.)")) // .def("duplicates_distinct", &Chart::duplicates_distinct, pybind11::doc("make duplicating antigens/sera distinct")) // // ---------------------------------------------------------------------- .def("remove_all_projections", // [](Chart& chart) { return chart.projections().remove_all(); }) // // .def( // "remove_all_projections_except", // // [](Chart& chart, size_t to_keep) { return chart.projections_modify().remove_all_except(to_keep); }, "keep"_a) // .def( "remove_projection", // [](Chart& chart, size_t to_remove) { return chart.projections().remove(projection_index{to_remove}); }, "projection_no"_a) // .def( "keep_projections", // [](Chart& chart, size_t to_keep) { return chart.projections().keep(projection_index{to_keep}); }, // "keep"_a) // // .def( // "orient_to", // [](Chart& chart, const Chart& master, size_t projection_no) { // ae::chart::v3::CommonAntigensSera common(master, chart, CommonAntigensSera::match_level_t::strict); // const auto procrustes_data = ae::chart::v3::procrustes(*master.projection(0), *chart.projection(projection_no), common.points(), ae::chart::v3::procrustes_scaling_t::no); // chart.projection_modify(projection_no)->transformation(procrustes_data.transformation); // }, // // "master"_a, "projection_no"_a = 0) // // // .def( // // "select_antigens_by_aa", // // // [](std::shared_ptr<Chart> chart, const std::vector<std::string>& criteria, bool report) { // // auto selected = std::make_shared<SelectedAntigensModify>(chart); // // ae::py::populate_from_seqdb(chart); // // ae::py::select_by_aa(selected->indexes, *chart->antigens(), criteria); // // AD_PRINT_L(report, [&selected]() { return selected->report("{ag_sr} {no0:{num_digits}d} {name_full_passage}\n"); }); // // return selected; // // }, // // // "criteria"_a, "report"_a = false, // // // pybind11::doc(R"(Criteria is a list of strings, e.g. ["156K", "!145K"], all criteria is the list must match)")) // // // .def( // // "select_antigens_by_clade", // // // [](std::shared_ptr<Chart> chart, const std::vector<std::string>& clades, bool report) { // // auto selected = std::make_shared<SelectedAntigensModify>(chart); // // ae::py::populate_from_seqdb(chart); // // const auto pred = [&clades, antigens = chart->antigens()](auto index) { return antigens->at(index)->clades().exists_any_of(clades); }; // // selected->indexes.get().erase(std::remove_if(selected->indexes.begin(), selected->indexes.end(), pred), selected->indexes.end()); // // AD_PRINT_L(report, [&selected]() { return selected->report("{ag_sr} {no0:{num_digits}d} {name_full_passage}\n"); }); // // return selected; // // }, // // // "clades"_a, "report"_a = false, // // // pybind11::doc(R"(Select antigens with a clade from clades, one or more entries in clades must match)")) // // // .def( // // "select_sera_by_aa", // // // [](std::shared_ptr<Chart> chart, const std::vector<std::string>& criteria, bool report) { // // auto selected = std::make_shared<SelectedSeraModify>(chart); // // ae::py::populate_from_seqdb(chart); // // ae::py::select_by_aa(selected->indexes, *chart->sera(), criteria); // // AD_PRINT_L(report, [&selected]() { return selected->report("{ag_sr} {no0:{num_digits}d} {name_full_passage}\n"); }); // // return selected; // // }, // // // "criteria"_a, "report"_a = false, // // // pybind11::doc("Criteria is a list of strings, e.g. [\"156K\", \"!145K\"], all criteria is the list must match")) // // // .def( // // "select_sera_by_clade", // // // [](std::shared_ptr<Chart> chart, const std::vector<std::string>& clades, bool report) { // // auto selected = std::make_shared<SelectedSeraModify>(chart); // // ae::py::populate_from_seqdb(chart); // // const auto pred = [&clades, sera = chart->sera()](auto index) { return sera->at(index)->clades().exists_any_of(clades); }; // // selected->indexes.get().erase(std::remove_if(selected->indexes.begin(), selected->indexes.end(), pred), selected->indexes.end()); // // AD_PRINT_L(report, [&selected]() { return selected->report("{ag_sr} {no0:{num_digits}d} {name_full_passage}\n"); }); // // return selected; // // }, // // // "clades"_a, "report"_a = false, // // // pybind11::doc(R"(Select sera with a clade from clades, one or more entries in clades must match)")) // // .def("column_basis", &Chart::column_basis, "serum_no"_a, "projection_no"_a = 0, pybind11::doc("return column_basis for the passed serum")) // .def( // "column_bases", [](const Chart& chart, std::string_view minimum_column_basis) { return chart.column_bases(MinimumColumnBasis{minimum_column_basis})->data(); }, // "minimum_column_basis"_a, pybind11::doc("get column bases")) // // .def( // "column_bases", [](Chart& chart, const std::vector<double>& column_bases) { chart.forced_column_bases_modify(ColumnBasesData{column_bases}); }, "column_bases"_a, // pybind11::doc("set forced column bases")) // // .def("plot_spec", [](Chart& chart) { return PlotSpecRef{.plot_spec = chart.plot_spec_modify_ptr(), .number_of_antigens = chart.number_of_antigens()}; }) // // .def( // "remove_antigens_sera", // [](Chart& chart, std::shared_ptr<SelectedAntigensModify> antigens, std::shared_ptr<SelectedSeraModify> sera, bool remove_projections) { // if (remove_projections) // chart.projections_modify().remove_all(); // if (antigens && !antigens->empty()) // chart.remove_antigens(ae::chart::v3::ReverseSortedIndexes{*antigens->indexes}); // if (sera && !sera->empty()) // chart.remove_sera(ae::chart::v3::ReverseSortedIndexes{*sera->indexes}); // }, // // "antigens"_a = nullptr, "sera"_a = nullptr, "remove_projections"_a = false, // // pybind11::doc(R"( // Usage: // chart.remove_antigens_sera(antigens=chart.select_antigens(lambda ag: ag.lineage == "VICTORIA"), sera=chart.select_sera(lambda sr: sr.lineage == "VICTORIA")) // )")) // // .def( // "keep_antigens_sera", // [](Chart& chart, std::shared_ptr<SelectedAntigensModify> antigens, std::shared_ptr<SelectedSeraModify> sera, bool remove_projections) { // if (remove_projections) // chart.projections_modify().remove_all(); // if (antigens && !antigens->empty()) { // ae::chart::v3::ReverseSortedIndexes antigens_to_remove(chart.number_of_antigens()); // antigens_to_remove.remove(*antigens->indexes); // // AD_INFO("antigens_to_remove: {} {}", antigens_to_remove.size(), antigens_to_remove); // chart.remove_antigens(antigens_to_remove); // } // if (sera && !sera->empty()) { // ae::chart::v3::ReverseSortedIndexes sera_to_remove(chart.number_of_sera()); // sera_to_remove.remove(*sera->indexes); // // AD_INFO("sera_to_remove: {} {}", sera_to_remove.size(), sera_to_remove); // chart.remove_sera(sera_to_remove); // } // }, // // "antigens"_a = nullptr, "sera"_a = nullptr, "remove_projections"_a = false, // // pybind11::doc(R"( // Usage: // chart.remove_antigens_sera(antigens=chart.select_antigens(lambda ag: ag.lineage == "VICTORIA"), sera=chart.select_sera(lambda sr: sr.lineage == "VICTORIA")) // )")) // ; // ---------------------------------------------------------------------- pybind11::class_<Titers>(chart_v3_submodule, "Titers") // .def("number_of_layers", [](const Titers& titers) { return *titers.number_of_layers(); }) // .def( "titer", [](const Titers& titers, size_t ag_no, size_t sr_no) { return titers.titer(antigen_index{ag_no}, serum_index{sr_no}); }, "antigen_no"_a, "serum_no"_a) // .def( "titer_of_layer", [](const Titers& titers, size_t layer_no, size_t ag_no, size_t sr_no) { return titers.titer_of_layer(layer_index{layer_no}, antigen_index{ag_no}, serum_index{sr_no}); }, "layer_no"_a, "antigen_no"_a, "serum_no"_a) // .def("set_from_layers_report", [](const Titers& titers) { return new TiterMergeReport{titers.set_from_layers_report()}; }) // .def( "titrations_for_antigen", [](const Titers& titers, size_t antigen_no) { return titers.titrations_for_antigen(antigen_index{antigen_no}); }, "antigen_no"_a) // .def( "titrations_for_serum", [](const Titers& titers, size_t serum_no) { return titers.titrations_for_serum(serum_index{serum_no}); }, "serum_no"_a) // .def( "layers_with_antigen", [](const Titers& titers, size_t antigen_no) { return to_vector_base_t(titers.layers_with_antigen(antigen_index{antigen_no})); }, "antigen_no"_a) // .def( "layers_with_serum", [](const Titers& titers, size_t serum_no) { return to_vector_base_t(titers.layers_with_serum(serum_index{serum_no})); }, "serum_no"_a) // .def( "serum_coverage", [](const Titers& titers, size_t antigen_no, size_t serum_no, double fold) { return serum_coverage(titers, antigen_index{antigen_no}, serum_index{serum_no}, serum_circle_fold{fold}); }, "antigen_no"_a, "serum_no"_a, "fold"_a = 2.0) // ; pybind11::class_<Titer>(chart_v3_submodule, "Titer") // .def("__str__", pybind11::overload_cast<>(&Titer::get, pybind11::const_)) // .def("logged", &Titer::logged) // .def("logged_with_thresholded", &Titer::logged_with_thresholded) // .def("value", &Titer::value) // .def("value_with_thresholded", &Titer::value_with_thresholded, pybind11::doc("returns 20 for <40, 20480 for >10240")) // .def("is_dont_care", &Titer::is_dont_care) // .def("is_regular", &Titer::is_regular) // .def("is_less_than", &Titer::is_less_than) // .def("is_more_than", &Titer::is_more_than) // ; pybind11::class_<TiterMergeReport>(chart_v3_submodule, "TiterMergeReport") // .def("brief", &TiterMergeReport::brief, "antigen_no"_a, "serum_no"_a) // .def_static("brief_description", &TiterMergeReport::brief_description) // ; // ---------------------------------------------------------------------- pybind11::class_<ProjectionRef>(chart_v3_submodule, "Projection") // .def("stress", &ProjectionRef::stress) // .def("recalculate_stress", &ProjectionRef::recalculate_stress) // .def("comment", &ProjectionRef::comment) // .def("minimum_column_basis", &ProjectionRef::minimum_column_basis) // .def("forced_column_bases", &ProjectionRef::forced_column_bases) // .def("disconnected", &ProjectionRef::disconnected) // .def("unmovable", &ProjectionRef::unmovable) // .def("unmovable_in_the_last_dimension", &ProjectionRef::unmovable_in_the_last_dimension) // .def("layout", &ProjectionRef::layout, pybind11::return_value_policy::reference_internal) // .def("transformation", &ProjectionRef::transformation, pybind11::return_value_policy::reference_internal) // .def( "relax", [](ProjectionRef& projection, bool rough) { return projection.relax(rough ? optimization_precision::rough : optimization_precision::fine); }, "rough"_a = false) // .def("avidity_test", &ProjectionRef::avidity_test, "adjust_step"_a, "min_adjust"_a, "max_adjust"_a, "rough"_a) // .def("serum_circles", &ProjectionRef::serum_circles, "fold"_a = 2.0) // .def( "serum_circle_for_multiple_sera", [](const ProjectionRef& projection, const std::vector<size_t>& serum_no, double fold, bool conservative) { return projection.serum_circle_for_multiple_sera(make_serum_indexes(serum_no), fold, conservative); }, "sera"_a, "fold"_a = 2.0, "conservative"_a = false, pybind11::doc("description is in serum_circles.cc")) // ; pybind11::class_<Layout>(chart_v3_submodule, "Layout") // .def("__len__", [](const Layout& layout) -> size_t { return *layout.number_of_points(); }) // .def("number_of_dimensions", [](const Layout& layout) -> size_t { return *layout.number_of_dimensions(); }) // .def( "__getitem__", [](Layout& layout, ssize_t index) { if (index >= 0 && point_index{index} < layout.number_of_points()) return layout[point_index{index}]; else if (index < 0 && point_index{-index} <= layout.number_of_points()) return layout[layout.number_of_points() + index]; else throw std::invalid_argument{fmt::format("wrong index: {}, number of points in layout: {}", index, layout.number_of_points())}; }, "index"_a, pybind11::doc("negative index counts from the layout end")) // .def("minmax", &Layout::minmax) // .def( "connected", [](const Layout& layout, size_t index) { return layout.point_has_coordinates(point_index{index}); }, "index"_a) // // .def("__str__", [](const Layout& layout) { return fmt::format("{}", layout); }) // ; pybind11::class_<point_coordinates>(chart_v3_submodule, "PointCoordinates") // .def("__len__", [](const point_coordinates& pc) -> size_t { return *pc.number_of_dimensions(); }) // .def( "__getitem__", [](point_coordinates& pc, size_t dim_no) -> double& { return pc[number_of_dimensions_t{dim_no}]; }, "dim"_a) // .def( "__iter__", [](const point_coordinates& pc) { return pybind11::make_iterator(pc.begin(), pc.end()); }, pybind11::keep_alive<0, 1>()) // .def("__str__", [](const point_coordinates& pc) { return fmt::format("{}", pc); }) // ; pybind11::class_<Transformation>(chart_v3_submodule, "Transformation") // .def("__str__", [](const Transformation& transformation) { return fmt::format("{}", transformation); }) // ; // ---------------------------------------------------------------------- pybind11::class_<InfoRef>(chart_v3_submodule, "Info") // .def("virus", &InfoRef::virus) // .def("type_subtype", &InfoRef::type_subtype) // .def("assay", &InfoRef::assay) // .def("assay_HI_or_Neut", &InfoRef::assay_HI_or_Neut) // .def("assay_hi_or_neut", &InfoRef::assay_hi_or_neut) // .def("assay_Neut", &InfoRef::assay_Neut) // .def("assay_neut", &InfoRef::assay_neut) // .def("rbc_species", &InfoRef::rbc_species) // .def("lab", &InfoRef::lab) // .def("date", &InfoRef::date) // .def("name", &InfoRef::name) // .def("name_or_date", &InfoRef::name_or_date) // .def("number_of_sources", &InfoRef::number_of_sources) // .def("source", &InfoRef::source, "source_no"_a) // ; // ---------------------------------------------------------------------- chart_v3_antigens(chart_v3_submodule); chart_v3_plot_spec(chart_v3_submodule); chart_v3_tests(chart_v3_submodule); chart_v3_submodule.def("procrustes", &ae::py::procrustes, "chart1"_a, "chart2"_a, "common"_a, "scaling"_a = false); // ---------------------------------------------------------------------- } // ----------------------------------------------------------------------
67.552413
199
0.506318
[ "object", "vector" ]
41082017c843cb9c59275fa0a9953fa585dbb710
908
hpp
C++
data-structure-2d/2d-cumulative-sum.hpp
ngthanhtrung23/library
a2910e45b8c97b2e1e789a2de20b0760739e1761
[ "CC0-1.0" ]
69
2020-11-06T05:21:42.000Z
2022-03-29T03:38:35.000Z
data-structure-2d/2d-cumulative-sum.hpp
vanloc1808/library-Forked
a2910e45b8c97b2e1e789a2de20b0760739e1761
[ "CC0-1.0" ]
21
2020-07-25T04:47:12.000Z
2022-02-01T14:39:29.000Z
data-structure-2d/2d-cumulative-sum.hpp
vanloc1808/library-Forked
a2910e45b8c97b2e1e789a2de20b0760739e1761
[ "CC0-1.0" ]
9
2020-11-06T11:55:10.000Z
2022-03-20T04:45:31.000Z
#pragma once // Don't Forget to call build() !!!!! template <class T> struct CumulativeSum2D { vector<vector<T> > data; CumulativeSum2D(int H, int W) : data(H + 3, vector<int>(W + 3, 0)) {} void add(int i, int j, T z) { ++i, ++j; if (i >= (int)data.size() || j >= (int)data[0].size()) return; data[i][j] += z; } // add [ [i1,j1], [i2,j2] ) void imos(int i1, int j1, int i2, int j2, T z) { add(i1, j1, 1); add(i1, j2, -1); add(i2, j1, -1); add(i2, j2, 1); } void build() { for (int i = 1; i < (int)data.size(); i++) { for (int j = 1; j < (int)data[i].size(); j++) { data[i][j] += data[i][j - 1] + data[i - 1][j] - data[i - 1][j - 1]; } } } T query(int i1, int j1, int i2, int j2) { return (data[i2][j2] - data[i1][j2] - data[i2][j1] + data[i1][j1]); } }; /* * @brief 二次元累積和 * @docs docs/data-structure-2d/ds-2d.md */
22.146341
75
0.484581
[ "vector" ]
410bac0cc4bc1d1db0f2b6936f4ea3d9563b1925
6,483
cpp
C++
arbor/morph/cv_data.cpp
kanzl/arbor
86b1eb065ac252bf0026de7cf7cbc6748a528254
[ "BSD-3-Clause" ]
null
null
null
arbor/morph/cv_data.cpp
kanzl/arbor
86b1eb065ac252bf0026de7cf7cbc6748a528254
[ "BSD-3-Clause" ]
null
null
null
arbor/morph/cv_data.cpp
kanzl/arbor
86b1eb065ac252bf0026de7cf7cbc6748a528254
[ "BSD-3-Clause" ]
null
null
null
#include <vector> #include <arbor/common_types.hpp> #include <arbor/morph/cv_data.hpp> #include <arbor/morph/embed_pwlin.hpp> #include "morph/cv_data.hpp" #include "util/partition.hpp" #include "util/pw_over_cable.hpp" #include "util/rangeutil.hpp" #include "util/span.hpp" #include "util/unique.hpp" namespace arb { cell_cv_data_impl::cell_cv_data_impl(const cable_cell& cell, const locset& lset) { auto pop = [](auto& vec) { auto h = vec.back(); return vec.pop_back(), h; }; const auto& mp = cell.provider(); const auto& m = mp.morphology(); if (m.empty()) { return; } mlocation_list locs = thingify(lset, mp); // Filter out root, terminal locations and repeated locations so as to // avoid trivial CVs outside of fork points. (This is not necessary for // correctness, but is for the convenience of specification by lset.) auto neither_root_nor_terminal = [&m](mlocation x) { return !(x.pos==0 && x.branch==(m.branch_children(mnpos).size()>1u? mnpos: 0)) // root? && !(x.pos==1 && m.branch_children(x.branch).empty()); // terminal? }; locs.erase(std::partition(locs.begin(), locs.end(), neither_root_nor_terminal), locs.end()); util::sort(locs); util::unique_in_place(locs); // Collect cables constituting each CV, maintaining a stack of CV // proximal 'head' points, and recursing down branches in the morphology // within each CV. constexpr fvm_index_type no_parent = -1; std::vector<std::pair<mlocation, fvm_index_type>> next_cv_head; // head loc, parent cv index next_cv_head.emplace_back(mlocation{mnpos, 0}, no_parent); mcable_list cables; std::vector<msize_t> branches; cv_cables_divs.push_back(0); fvm_index_type cv_index = 0; while (!next_cv_head.empty()) { auto next = pop(next_cv_head); mlocation h = next.first; cables.clear(); branches.clear(); branches.push_back(h.branch); cv_parent.push_back(next.second); while (!branches.empty()) { msize_t b = pop(branches); // Find most proximal point in locs on this branch, strictly more distal than h. auto it = locs.end(); if (b!=mnpos && b==h.branch) { it = std::upper_bound(locs.begin(), locs.end(), h); } else if (b!=mnpos) { it = std::lower_bound(locs.begin(), locs.end(), mlocation{b, 0}); } // If found, use as an end point, and stop descent. // Otherwise, recurse over child branches. if (it!=locs.end() && it->branch==b) { cables.push_back({b, b==h.branch? h.pos: 0, it->pos}); next_cv_head.emplace_back(*it, cv_index); } else { if (b!=mnpos) { cables.push_back({b, b==h.branch? h.pos: 0, 1}); } for (auto& c: m.branch_children(b)) { branches.push_back(c); } } } util::sort(cables); util::append(cv_cables, std::move(cables)); cv_cables_divs.push_back(cv_cables.size()); ++cv_index; } auto n_cv = cv_index; arb_assert(n_cv>0); arb_assert(cv_parent.front()==-1); arb_assert(util::all_of(util::subrange_view(cv_parent, 1, n_cv), [](auto v) { return v!=no_parent; })); // Construct CV children mapping by sorting CV indices by parent. assign(cv_children, util::make_span(1, n_cv)); util::stable_sort_by(cv_children, [this](auto cv) { return cv_parent[cv]; }); cv_children_divs.reserve(n_cv+1); cv_children_divs.push_back(0); auto b = cv_children.begin(); auto e = cv_children.end(); auto from = b; for (fvm_index_type cv = 0; cv<n_cv; ++cv) { from = std::partition_point(from, e, [cv, this](auto i) { return cv_parent[i]<=cv; }); cv_children_divs.push_back(from-b); } } mcable_list cell_cv_data::cables(fvm_size_type cv_index) const { auto partn = util::partition_view(impl_->cv_cables_divs); auto view = util::subrange_view(impl_->cv_cables, partn[cv_index]); return mcable_list{view.begin(), view.end()}; } std::vector<fvm_index_type> cell_cv_data::children(fvm_size_type cv_index) const { auto partn = util::partition_view(impl_->cv_children_divs); auto view = util::subrange_view(impl_->cv_children, partn[cv_index]); return std::vector<fvm_index_type>{view.begin(), view.end()}; } fvm_index_type cell_cv_data::parent(fvm_size_type cv_index) const { return impl_->cv_parent[cv_index]; } fvm_size_type cell_cv_data::size() const { return impl_->cv_parent.size(); } std::optional<cell_cv_data> cv_data(const cable_cell& cell) { if (auto policy = cell.decorations().defaults().discretization) { return cell_cv_data(cell, policy->cv_boundary_points(cell)); } return {}; } using impl_ptr = std::unique_ptr<cell_cv_data_impl, void (*)(cell_cv_data_impl*)>; impl_ptr make_impl(cell_cv_data_impl* c) { return impl_ptr(c, [](cell_cv_data_impl* p){delete p;}); } cell_cv_data::cell_cv_data(const cable_cell& cell, const locset& lset): impl_(make_impl(new cell_cv_data_impl(cell, lset))), provider_(cell.provider()) {} std::vector<cv_proportion> intersect_region(const region& reg, const cell_cv_data& geom, bool by_length) { const auto& mp = geom.provider(); const auto& embedding = mp.embedding(); std::vector<cv_proportion> intersection; auto extent = thingify(reg, mp); mcable_map<double> support; for (auto& cable: extent) { support.insert(cable, 1.); } if(support.empty()) { return {}; } for (auto cv: util::make_span(geom.size())) { double cv_total = 0, reg_on_cv = 0; for (mcable c: geom.cables(cv)) { if (by_length) { cv_total += embedding.integrate_length(c); reg_on_cv += embedding.integrate_length(c.branch, util::pw_over_cable(support, c, 0.)); } else { cv_total += embedding.integrate_area(c); reg_on_cv += embedding.integrate_area(c.branch, util::pw_over_cable(support, c, 0.)); } } if (reg_on_cv>0) { intersection.push_back({cv, reg_on_cv/cv_total}); } } return intersection; } } //namespace arb
33.942408
106
0.616227
[ "vector" ]
410e3efeb52f0ea0d9ca0a9f5865261dd81929f9
7,261
hh
C++
src/expr/GetValueImpl.hh
taless474/plexil1
0da24f0330404c41a695ea367bb760fb9c7ee8dd
[ "BSD-3-Clause" ]
1
2022-03-30T20:16:43.000Z
2022-03-30T20:16:43.000Z
src/expr/GetValueImpl.hh
taless474/plexil1
0da24f0330404c41a695ea367bb760fb9c7ee8dd
[ "BSD-3-Clause" ]
null
null
null
src/expr/GetValueImpl.hh
taless474/plexil1
0da24f0330404c41a695ea367bb760fb9c7ee8dd
[ "BSD-3-Clause" ]
null
null
null
/* Copyright (c) 2006-2021, Universities Space Research Association (USRA). * 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 Universities Space Research Association 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 USRA ``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 USRA 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. */ #ifndef PLEXIL_GET_VALUE_IMPL_HH #define PLEXIL_GET_VALUE_IMPL_HH #include "Expression.hh" namespace PLEXIL { //* // @class GetValueImpl template <typename T> class GetValueImpl : virtual public Expression { protected: GetValueImpl() = default; private: // Not implemented GetValueImpl(GetValueImpl const &) = delete; GetValueImpl(GetValueImpl &&) = delete; public: virtual ~GetValueImpl() = default; /** * @brief Return the value type. * @return A constant enumeration. * @note May be overridden by derived classes. */ virtual ValueType valueType() const override; /** * @brief Determine whether the value is known or unknown. * @return True if known, false otherwise. * @note May be overridden by derived classes. */ virtual bool isKnown() const override; /** * @brief Get the value of this expression as a Value instance. * @return The Value instance. */ virtual Value toValue() const override; /** * @brief Retrieve the value of this object in its native type. * @param The appropriately typed place to put the result. * @return True if known, false if unknown. */ virtual bool getValue(T &result) const override = 0; virtual void printValue(std::ostream &s) const override; }; // Specialization for Integer template <> class GetValueImpl<Integer> : virtual public Expression { protected: GetValueImpl() = default; private: // Not implemented GetValueImpl(GetValueImpl const &) = delete; GetValueImpl(GetValueImpl &&) = delete; public: virtual ~GetValueImpl() = default; /** * @brief Return the value type. * @return A constant enumeration. * @note May be overridden by derived classes. */ virtual ValueType valueType() const override; /** * @brief Determine whether the value is known or unknown. * @return True if known, false otherwise. * @note May be overridden by derived classes. */ virtual bool isKnown() const override; /** * @brief Get the value of this expression as a Value instance. * @return The Value instance. */ virtual Value toValue() const override; /** * @brief Retrieve the value of this object in its native type. * @param The appropriately typed place to put the result. * @return True if known, false if unknown. */ virtual bool getValue(Integer &result) const override = 0; /** * @brief Retrieve the value of this object as a Real. * @param Reference to Real variable. * @return True if known, false if unknown. * @note Conversion method. */ virtual bool getValue(Real &result) const override; virtual void printValue(std::ostream &s) const override; }; // Specialization for string template <> class GetValueImpl<String> : virtual public Expression { protected: GetValueImpl() = default; private: // Not implemented GetValueImpl(GetValueImpl const &) = delete; GetValueImpl(GetValueImpl &&) = delete; public: virtual ~GetValueImpl() = default; /** * @brief Return the value type. * @return A constant enumeration. * @note May be overridden by derived classes. */ virtual ValueType valueType() const override; /** * @brief Determine whether the value is known or unknown. * @return True if known, false otherwise. * @note May be overridden by derived classes. */ virtual bool isKnown() const override; /** * @brief Get the value of this expression as a Value instance. * @return The Value instance. */ virtual Value toValue() const override; /** * @brief Retrieve the value of this object in its native type. * @param The appropriately typed place to put the result. * @return True if known, false if unknown. */ virtual bool getValue(String &result) const override = 0; /** * @brief Retrieve the value of this object as a pointer to const. * @param ptr Reference to the pointer variable. * @return True if known, false if unknown. */ virtual bool getValuePointer(String const *&) const override = 0; virtual void printValue(std::ostream &s) const override; }; // Specialization for array types template <typename T> class GetValueImpl<ArrayImpl<T> > : virtual public Expression { protected: GetValueImpl() = default; private: // Not implemented GetValueImpl(GetValueImpl const &) = delete; GetValueImpl(GetValueImpl &&) = delete; public: virtual ~GetValueImpl() = default; /** * @brief Return the value type. * @return A constant enumeration. * @note May be overridden by derived classes. */ virtual ValueType valueType() const override; /** * @brief Determine whether the value is known or unknown. * @return True if known, false otherwise. * @note May be overridden by derived classes. */ virtual bool isKnown() const override; /** * @brief Get the value of this expression as a Value instance. * @return The Value instance. */ virtual Value toValue() const override; /** * @brief Retrieve the value of this object as a pointer to const. * @param ptr Reference to the pointer variable. * @return True if known, false if unknown. */ virtual bool getValuePointer(ArrayImpl<T> const *&) const override = 0; virtual bool getValuePointer(Array const *& ptr) const override; virtual void printValue(std::ostream &s) const override; }; } #endif // PLEXIL_GET_VALUE_IMPL_HH
30.766949
79
0.680072
[ "object" ]
410ec3c20acda1b46fbd2ffc6133eed35e7d2707
6,905
cpp
C++
source/examples/demo-stages-plugins/LightTestStage.cpp
rarejuliet/gloperate
580b2f6389aad05c5d656ce94583e1cde02624ef
[ "MIT" ]
1
2018-06-06T13:21:53.000Z
2018-06-06T13:21:53.000Z
source/examples/demo-stages-plugins/LightTestStage.cpp
rarejuliet/gloperate
580b2f6389aad05c5d656ce94583e1cde02624ef
[ "MIT" ]
null
null
null
source/examples/demo-stages-plugins/LightTestStage.cpp
rarejuliet/gloperate
580b2f6389aad05c5d656ce94583e1cde02624ef
[ "MIT" ]
null
null
null
#include "LightTestStage.h" #include <glm/gtx/transform.hpp> #include <glbinding/gl/enum.h> #include <glbinding/gl/bitfield.h> #include <globjects/base/File.h> #include <globjects/VertexArray.h> #include <globjects/VertexAttributeBinding.h> #include <globjects/Framebuffer.h> #include <globjects/NamedString.h> #include <globjects/globjects.h> #include <gloperate/gloperate.h> #include <gloperate/base/Environment.h> namespace { // Geometry describing the cube // position, surface normal static const std::array<std::array<glm::vec3, 2>, 14> s_cube { { {{ glm::vec3(-1.f, -1.f, -1.f), glm::vec3( 0.0f, -1.0f, 0.0) }}, {{ glm::vec3(-1.f, -1.f, +1.f), glm::vec3( 0.0f, -1.0f, 0.0) }}, {{ glm::vec3(+1.f, -1.f, -1.f), glm::vec3( 0.0f, -1.0f, 0.0) }}, {{ glm::vec3(+1.f, -1.f, +1.f), glm::vec3( 0.0f, -1.0f, 0.0) }}, {{ glm::vec3(+1.f, +1.f, +1.f), glm::vec3( 1.0f, 0.0f, 0.0) }}, {{ glm::vec3(-1.f, -1.f, +1.f), glm::vec3( 0.0f, 0.0f, 1.0) }}, {{ glm::vec3(-1.f, +1.f, +1.f), glm::vec3( 0.0f, 0.0f, 1.0) }}, {{ glm::vec3(-1.f, -1.f, -1.f), glm::vec3(-1.0f, 0.0f, 0.0) }}, {{ glm::vec3(-1.f, +1.f, -1.f), glm::vec3(-1.0f, 0.0f, 0.0) }}, {{ glm::vec3(+1.f, -1.f, -1.f), glm::vec3( 0.0f, 0.0f, -1.0) }}, {{ glm::vec3(+1.f, +1.f, -1.f), glm::vec3( 0.0f, 0.0f, -1.0) }}, {{ glm::vec3(+1.f, +1.f, +1.f), glm::vec3( 1.0f, 0.0f, 0.0) }}, {{ glm::vec3(-1.f, +1.f, -1.f), glm::vec3( 0.0f, 1.0f, 0.0) }}, {{ glm::vec3(-1.f, +1.f, +1.f), glm::vec3( 0.0f, 1.0f, 0.0) }} } }; static const glm::vec3 s_cameraEye(0.0f, -1.5f, -3.0f); } // namespace CPPEXPOSE_COMPONENT(LightTestStage, gloperate::Stage) LightTestStage::LightTestStage(gloperate::Environment * environment, const std::string & name) : Stage(environment, "LightTestStage", name) , canvasInterface(this) , glossiness("glossiness", this, 0.0f) , totalTime("totalTime", this, 0.0f) , lightColorTypeData("lightColorTypeData", this, nullptr) , lightPositionData("lightPositionData", this, nullptr) , lightAttenuationData("lightAttenuationData", this, nullptr) { } LightTestStage::~LightTestStage() { } void LightTestStage::onContextInit(gloperate::AbstractGLContext *) { canvasInterface.onContextInit(); // Setup Geometry m_vao = cppassist::make_unique<globjects::VertexArray>(); m_vertexBuffer = cppassist::make_unique<globjects::Buffer>(); m_vertexBuffer->setData(s_cube, gl::GL_STATIC_DRAW); auto positionBinding = m_vao->binding(0); positionBinding->setAttribute(0); positionBinding->setBuffer(m_vertexBuffer.get(), 0, sizeof(glm::vec3) * 2); positionBinding->setFormat(3, gl::GL_FLOAT, gl::GL_FALSE, 0); m_vao->enable(0); auto normalBinding = m_vao->binding(1); normalBinding->setAttribute(1); normalBinding->setBuffer(m_vertexBuffer.get(), 0, sizeof(glm::vec3) * 2); normalBinding->setFormat(3, gl::GL_FLOAT, gl::GL_FALSE, sizeof(glm::vec3)); m_vao->enable(1); // setup Program m_vertexShader = std::unique_ptr<globjects::Shader>(m_environment->resourceManager()->load<globjects::Shader>(gloperate::dataPath() + "/gloperate/shaders/demos/DemoLights.vert")); m_fragmentShader = std::unique_ptr<globjects::Shader>(m_environment->resourceManager()->load<globjects::Shader>(gloperate::dataPath() + "/gloperate/shaders/demos/DemoLights.frag")); m_program = cppassist::make_unique<globjects::Program>(); m_program->attach(m_vertexShader.get(), m_fragmentShader.get()); m_program->setUniform("colorTypeData", 0); m_program->setUniform("positionData", 1); m_program->setUniform("attenuationData", 2); m_program->setUniform("eye", s_cameraEye); // register NamedStrings for shader includes auto dataFolderPath = gloperate::dataPath(); m_lightProcessingString = globjects::NamedString::create("/gloperate/shaders/lighting/lightprocessing.glsl", new globjects::File(dataFolderPath + "/gloperate/shaders/lighting/lightprocessing.glsl")); m_lightProcessingDiffuseString = globjects::NamedString::create("/gloperate/shaders/lighting/lightprocessing_diffuse.glsl", new globjects::File(dataFolderPath + "/gloperate/shaders/lighting/lightprocessing_diffuse.glsl")); m_lightProcessingPhongString = globjects::NamedString::create("/gloperate/shaders/lighting/lightprocessing_phong.glsl", new globjects::File(dataFolderPath + "/gloperate/shaders/lighting/lightprocessing_phong.glsl")); } void LightTestStage::onContextDeinit(gloperate::AbstractGLContext *) { // deregister NamedStrings m_lightProcessingDiffuseString.reset(); m_lightProcessingPhongString.reset(); m_lightProcessingString.reset(); // deinitialize program m_program.reset(); m_fragmentShader.reset(); m_vertexShader.reset(); // deinitialize geometry m_vertexBuffer.reset(); m_vao.reset(); canvasInterface.onContextDeinit(); } void LightTestStage::onProcess() { // Get viewport const glm::vec4 & viewport = *canvasInterface.viewport; // Update viewport gl::glViewport( viewport.x, viewport.y, viewport.z, viewport.w ); // Bind FBO globjects::Framebuffer * fbo = canvasInterface.obtainFBO(); fbo->bind(gl::GL_FRAMEBUFFER); // Clear background auto & color = *canvasInterface.backgroundColor; gl::glClearColor(color.redf(), color.greenf(), color.bluef(), 1.0f); gl::glScissor(viewport.x, viewport.y, viewport.z, viewport.w); gl::glEnable(gl::GL_SCISSOR_TEST); gl::glClear(gl::GL_COLOR_BUFFER_BIT | gl::GL_DEPTH_BUFFER_BIT); gl::glDisable(gl::GL_SCISSOR_TEST); // Update transformation auto model = glm::rotate((*totalTime) / 3.0f, glm::vec3(0, 1, 0)); auto view = glm::lookAt(s_cameraEye, glm::vec3(0.0f), glm::vec3(0.0f, 1.0f, 0.0f)); auto projection = glm::perspective(30.0f, viewport.z / viewport.w, 0.1f, 10.0f); m_program->setUniform("modelMatrix", model); m_program->setUniform("modelViewProjection", projection * view * model); // Update other uniforms m_program->setUniform("glossiness", (*glossiness)); // Bind textures if (*lightColorTypeData) (*lightColorTypeData)->bindActive(0); if (*lightPositionData) (*lightPositionData)->bindActive(1); if (*lightAttenuationData) (*lightAttenuationData)->bindActive(2); // Draw geometry m_program->use(); m_vao->drawArrays(gl::GL_TRIANGLE_STRIP, 0, 14); m_program->release(); // Unbind textures if (*lightColorTypeData) (*lightColorTypeData)->unbindActive(0); if (*lightPositionData) (*lightPositionData)->unbindActive(1); if (*lightAttenuationData) (*lightAttenuationData)->unbindActive(2); // Unbind FBO globjects::Framebuffer::unbind(gl::GL_FRAMEBUFFER); // Signal that output is valid canvasInterface.updateRenderTargetOutputs(); }
36.534392
226
0.670529
[ "geometry", "model", "transform" ]
411d48f8a261e28d8ca7ee8c5949e1c6e961b589
18,087
cpp
C++
src/cmsmarketcalibration.cpp
quantlibnode/quantlibnode
b50348131af77a2b6c295f44ef3245daf05c4afc
[ "MIT" ]
27
2016-11-19T16:51:21.000Z
2021-09-08T16:44:15.000Z
src/cmsmarketcalibration.cpp
quantlibnode/quantlibnode
b50348131af77a2b6c295f44ef3245daf05c4afc
[ "MIT" ]
1
2016-12-28T16:38:38.000Z
2017-02-17T05:32:13.000Z
src/cmsmarketcalibration.cpp
quantlibnode/quantlibnode
b50348131af77a2b6c295f44ef3245daf05c4afc
[ "MIT" ]
10
2016-12-28T02:31:38.000Z
2021-06-15T09:02:07.000Z
/* Copyright (C) 2016 -2017 Jerry Jin */ #include <nan.h> #include <string.h> #include "cmsmarketcalibration.hpp" #include <qlo/qladdindefines.hpp> #include <qlo/cmsmarketcalibration.hpp> #include <qlo/cmsmarket.hpp> #include <qlo/termstructures.hpp> #include <qlo/optimization.hpp> #include <ql/termstructures/volatility/swaption/swaptionvolcube1.hpp> #include <oh/objecthandler.hpp> #include <oh/conversions/getobjectvector.hpp> #include <qlo/valueobjects/vo_all.hpp> #include <qlo/conversions/all.hpp> #include "../loop.hpp" void CmsMarketCalibrationWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_OBJECT(VolCubeCoerce, mVolCube, ObjectHandler::Object) QuantLib::Handle<QuantLib::SwaptionVolatilityStructure> VolCubeLibObj = QuantLibAddin::CoerceHandle< QuantLibAddin::SwaptionVolatilityStructure, QuantLib::SwaptionVolatilityStructure>()( VolCubeCoerce); // convert object IDs into library objects OH_GET_REFERENCE(CmsMarketLibObjPtr, mCmsMarket, QuantLibAddin::CmsMarket, QuantLib::CmsMarket) // convert input datatypes to QuantLib datatypes QuantLib::Matrix WeightsLib = QuantLibAddin::vvToQlMatrix(mWeights); // convert input datatypes to QuantLib enumerated datatypes QuantLib::CmsMarketCalibration::CalibrationType CalibrationTypeEnum = ObjectHandler::Create<QuantLib::CmsMarketCalibration::CalibrationType>()(mCalibrationType); // Construct the Value Object boost::shared_ptr<ObjectHandler::ValueObject> valueObject( new QuantLibAddin::ValueObjects::qlCmsMarketCalibration( mObjectID, mVolCube, mCmsMarket, mWeights, mCalibrationType, false )); // Construct the Object boost::shared_ptr<ObjectHandler::Object> object( new QuantLibAddin::CmsMarketCalibration( valueObject, VolCubeLibObj, CmsMarketLibObjPtr, WeightsLib, CalibrationTypeEnum, false )); // Store the Object in the Repository mReturnValue = ObjectHandler::Repository::instance().storeObject(mObjectID, object, false, valueObject); }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void CmsMarketCalibrationWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), Nan::New<String>(mReturnValue).ToLocalChecked() }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::CmsMarketCalibration) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } if (info.Length() == 2 || !info[2]->IsString()) { return Nan::ThrowError("CmsMarket is required."); } if (info.Length() == 3 || !info[3]->IsArray()) { return Nan::ThrowError("Weights is required."); } if (info.Length() == 4 || !info[4]->IsString()) { return Nan::ThrowError("CalibrationType is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // convert js argument to c++ type ObjectHandler::property_t VolCubeCpp = ObjectHandler::property_t(static_cast<double>(Nan::To<double>(info[1]).FromJust())); // convert js argument to c++ type String::Utf8Value strCmsMarket(info[2]->ToString()); string CmsMarketCpp(strdup(*strCmsMarket)); // convert js argument to c++ type std::vector< std::vector<double> >WeightsCpp; Local<Array> WeightsMatrix = info[3].As<Array>(); for (unsigned int i = 0; i < WeightsMatrix->Length(); i++){ Local<Array> WeightsArray = WeightsMatrix->Get(i).As<Array>(); std::vector<double> tmp; for (unsigned int j = 0; j < WeightsArray->Length(); j++){ tmp.push_back(Nan::To<double>(Nan::Get(WeightsArray, j).ToLocalChecked()).FromJust()); } WeightsCpp.push_back(tmp); } // convert js argument to c++ type String::Utf8Value strCalibrationType(info[4]->ToString()); string CalibrationTypeCpp(strdup(*strCalibrationType)); // declare callback Nan::Callback *callback = new Nan::Callback(info[5].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new CmsMarketCalibrationWorker( callback ,ObjectIDCpp ,VolCubeCpp ,CmsMarketCpp ,WeightsCpp ,CalibrationTypeCpp )); } //CmsMarketCalibrationWorker::~CmsMarketCalibrationWorker(){ // //} //void CmsMarketCalibrationWorker::Destroy(){ // //} void CmsMarketCalibrationComputeWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_REFERENCE(EndCriteriaLibObjPtr, mEndCriteria, QuantLibAddin::EndCriteria, QuantLib::EndCriteria) // convert object IDs into library objects OH_GET_REFERENCE(OptimizationMethodLibObjPtr, mOptimizationMethod, QuantLibAddin::OptimizationMethod, QuantLib::OptimizationMethod) // convert input datatypes to QuantLib datatypes QuantLib::Array GuessLib; // convert object IDs into library objects OH_GET_OBJECT(ObjectIDObjPtr, mObjectID, QuantLibAddin::CmsMarketCalibration) // loop on the input parameter and populate the return vector QuantLib::Array returnValue = ObjectIDObjPtr->compute( EndCriteriaLibObjPtr , OptimizationMethodLibObjPtr , GuessLib , mIsMeanRevFixed ); for(unsigned int i = 0; i < returnValue.size(); i++){ mReturnValue.push_back(returnValue[i]); } }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void CmsMarketCalibrationComputeWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<Array> tmpArray = Nan::New<Array>(mReturnValue.size()); for (unsigned int i = 0; i < mReturnValue.size(); i++) { Nan::Set(tmpArray,i,Nan::New<Number>(mReturnValue[i])); } Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), tmpArray }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::CmsMarketCalibrationCompute) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } if (info.Length() == 1 || !info[1]->IsString()) { return Nan::ThrowError("EndCriteria is required."); } if (info.Length() == 2 || !info[2]->IsString()) { return Nan::ThrowError("OptimizationMethod is required."); } if (info.Length() == 3 || !info[3]->IsArray()) { return Nan::ThrowError("Guess is required."); } if (info.Length() == 4 || !info[4]->IsBoolean()) { return Nan::ThrowError("IsMeanRevFixed is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // convert js argument to c++ type String::Utf8Value strEndCriteria(info[1]->ToString()); string EndCriteriaCpp(strdup(*strEndCriteria)); // convert js argument to c++ type String::Utf8Value strOptimizationMethod(info[2]->ToString()); string OptimizationMethodCpp(strdup(*strOptimizationMethod)); // convert js argument to c++ type std::vector<double>GuessCpp; Local<Array> GuessArray = info[3].As<Array>(); for (unsigned int i = 0; i < GuessArray->Length(); i++){ GuessCpp.push_back(Nan::To<double>(Nan::Get(GuessArray, i).ToLocalChecked()).FromJust()); } // convert js argument to c++ type bool IsMeanRevFixedCpp = Nan::To<bool>(info[4]).FromJust(); // declare callback Nan::Callback *callback = new Nan::Callback(info[5].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new CmsMarketCalibrationComputeWorker( callback ,ObjectIDCpp ,EndCriteriaCpp ,OptimizationMethodCpp ,GuessCpp ,IsMeanRevFixedCpp )); } //CmsMarketCalibrationComputeWorker::~CmsMarketCalibrationComputeWorker(){ // //} //void CmsMarketCalibrationComputeWorker::Destroy(){ // //} void CmsMarketCalibrationErrorWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_REFERENCE(ObjectIDLibObjPtr, mObjectID, QuantLibAddin::CmsMarketCalibration, QuantLib::CmsMarketCalibration) // invoke the member function mReturnValue = ObjectIDLibObjPtr->error( ); }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void CmsMarketCalibrationErrorWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), Nan::New<Number>(mReturnValue) }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::CmsMarketCalibrationError) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // declare callback Nan::Callback *callback = new Nan::Callback(info[1].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new CmsMarketCalibrationErrorWorker( callback ,ObjectIDCpp )); } //CmsMarketCalibrationErrorWorker::~CmsMarketCalibrationErrorWorker(){ // //} //void CmsMarketCalibrationErrorWorker::Destroy(){ // //} void CmsMarketCalibrationEndCriteriaWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_REFERENCE(ObjectIDLibObjPtr, mObjectID, QuantLibAddin::CmsMarketCalibration, QuantLib::CmsMarketCalibration) // invoke the member function QuantLib::EndCriteria::Type returnValue = ObjectIDLibObjPtr->endCriteria( ); std::ostringstream os; os << returnValue; mReturnValue = os.str(); }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void CmsMarketCalibrationEndCriteriaWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), Nan::New<String>(mReturnValue).ToLocalChecked() }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::CmsMarketCalibrationEndCriteria) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // declare callback Nan::Callback *callback = new Nan::Callback(info[1].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new CmsMarketCalibrationEndCriteriaWorker( callback ,ObjectIDCpp )); } //CmsMarketCalibrationEndCriteriaWorker::~CmsMarketCalibrationEndCriteriaWorker(){ // //} //void CmsMarketCalibrationEndCriteriaWorker::Destroy(){ // //} void CmsMarketCalibrationElapsedWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_OBJECT(ObjectIDObjPtr, mObjectID, QuantLibAddin::CmsMarketCalibration) // invoke the member function mReturnValue = ObjectIDObjPtr->elapsed( ); }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void CmsMarketCalibrationElapsedWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), Nan::New<Number>(mReturnValue) }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::CmsMarketCalibrationElapsed) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // declare callback Nan::Callback *callback = new Nan::Callback(info[1].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new CmsMarketCalibrationElapsedWorker( callback ,ObjectIDCpp )); } //CmsMarketCalibrationElapsedWorker::~CmsMarketCalibrationElapsedWorker(){ // //} //void CmsMarketCalibrationElapsedWorker::Destroy(){ // //} void CmsMarketCalibrationSparseSabrParametersWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_OBJECT(ObjectIDObjPtr, mObjectID, QuantLibAddin::CmsMarketCalibration) std::vector< std::vector<ObjectHandler::property_t> > returnValue; // invoke the member function returnValue = ObjectIDObjPtr->getSparseSabrParameters( ); mReturnValue = ObjectHandler::matrix::convert2<string>(returnValue,"returnValue"); }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void CmsMarketCalibrationSparseSabrParametersWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<Array> tmpMatrix = Nan::New<Array>(mReturnValue.size()); for (unsigned int i = 0; i < mReturnValue.size(); i++) { Local<Array> tmpArray = Nan::New<Array>(mReturnValue[i].size()); for (unsigned int j = 0; j < mReturnValue[i].size(); j++) { Nan::Set(tmpArray,j,Nan::New<String>(mReturnValue[i][j]).ToLocalChecked()); } Nan::Set(tmpMatrix,i,tmpArray); } Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), tmpMatrix }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::CmsMarketCalibrationSparseSabrParameters) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // declare callback Nan::Callback *callback = new Nan::Callback(info[1].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new CmsMarketCalibrationSparseSabrParametersWorker( callback ,ObjectIDCpp )); } //CmsMarketCalibrationSparseSabrParametersWorker::~CmsMarketCalibrationSparseSabrParametersWorker(){ // //} //void CmsMarketCalibrationSparseSabrParametersWorker::Destroy(){ // //} void CmsMarketCalibrationDenseSabrParametersWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_OBJECT(ObjectIDObjPtr, mObjectID, QuantLibAddin::CmsMarketCalibration) std::vector< std::vector<ObjectHandler::property_t> > returnValue; // invoke the member function returnValue = ObjectIDObjPtr->getDenseSabrParameters( ); mReturnValue = ObjectHandler::matrix::convert2<string>(returnValue,"returnValue"); }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void CmsMarketCalibrationDenseSabrParametersWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<Array> tmpMatrix = Nan::New<Array>(mReturnValue.size()); for (unsigned int i = 0; i < mReturnValue.size(); i++) { Local<Array> tmpArray = Nan::New<Array>(mReturnValue[i].size()); for (unsigned int j = 0; j < mReturnValue[i].size(); j++) { Nan::Set(tmpArray,j,Nan::New<String>(mReturnValue[i][j]).ToLocalChecked()); } Nan::Set(tmpMatrix,i,tmpArray); } Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), tmpMatrix }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::CmsMarketCalibrationDenseSabrParameters) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // declare callback Nan::Callback *callback = new Nan::Callback(info[1].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new CmsMarketCalibrationDenseSabrParametersWorker( callback ,ObjectIDCpp )); } //CmsMarketCalibrationDenseSabrParametersWorker::~CmsMarketCalibrationDenseSabrParametersWorker(){ // //} //void CmsMarketCalibrationDenseSabrParametersWorker::Destroy(){ // //} void SimultaneousCalibrationBrowseCmsMarketWorker::Execute(){ try{ // convert object IDs into library objects OH_GET_OBJECT(ObjectIDObjPtr, mObjectID, QuantLibAddin::CmsMarketCalibration) std::vector< std::vector<ObjectHandler::property_t> > returnValue; // invoke the member function returnValue = ObjectIDObjPtr->getCmsMarket( ); mReturnValue = ObjectHandler::matrix::convert2<string>(returnValue,"returnValue"); }catch(const std::exception &e){ mError = e.what(); }catch (...){ mError = "unkown error"; } } void SimultaneousCalibrationBrowseCmsMarketWorker::HandleOKCallback(){ Nan::HandleScope scope; Local<Array> tmpMatrix = Nan::New<Array>(mReturnValue.size()); for (unsigned int i = 0; i < mReturnValue.size(); i++) { Local<Array> tmpArray = Nan::New<Array>(mReturnValue[i].size()); for (unsigned int j = 0; j < mReturnValue[i].size(); j++) { Nan::Set(tmpArray,j,Nan::New<String>(mReturnValue[i][j]).ToLocalChecked()); } Nan::Set(tmpMatrix,i,tmpArray); } Local<v8::Value> argv[2] = { Nan::New<String>(mError).ToLocalChecked(), tmpMatrix }; callback->Call(2, argv); } NAN_METHOD(QuantLibNode::SimultaneousCalibrationBrowseCmsMarket) { // validate js arguments if (info.Length() == 0 || !info[0]->IsString()) { return Nan::ThrowError("ObjectID is required."); } // convert js argument to c++ type String::Utf8Value strObjectID(info[0]->ToString()); string ObjectIDCpp(strdup(*strObjectID)); // declare callback Nan::Callback *callback = new Nan::Callback(info[1].As<Function>()); // launch Async worker Nan::AsyncQueueWorker(new SimultaneousCalibrationBrowseCmsMarketWorker( callback ,ObjectIDCpp )); } //SimultaneousCalibrationBrowseCmsMarketWorker::~SimultaneousCalibrationBrowseCmsMarketWorker(){ // //} //void SimultaneousCalibrationBrowseCmsMarketWorker::Destroy(){ // //}
26.137283
108
0.690441
[ "object", "vector" ]
411feb29bcc28d8cfe60f2688ad3a114463aa28a
3,338
hpp
C++
src/algorithms/dp/knapsack_problem.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2020-07-31T14:13:56.000Z
2021-02-03T09:51:43.000Z
src/algorithms/dp/knapsack_problem.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
28
2015-09-22T07:38:21.000Z
2018-10-02T11:00:58.000Z
src/algorithms/dp/knapsack_problem.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2018-10-11T14:10:50.000Z
2021-02-27T08:53:50.000Z
#ifndef KNAPSACK_PROBLEM_HPP #define KNAPSACK_PROBLEM_HPP // Knapsack problem // Given a set of items, each with a weight and a value, determine the number // of each item to include in a collection so that the total weight is less // than or equal to a given limit and the total value is as large as possible. #include <map> #include <vector> #include <algorithm> namespace Algo::DP { class Knapsack { public: // Greedy algorithm for fractional Knapsack problem, that returns result // value of items in knapsack // items: vector of pairs of { value, weight } static double FillGreedy( const uint32_t& maxWeight, const std::vector<std::pair<uint32_t, uint32_t>>& items) { // Calc for each item its' value per weight param std::multimap<double, std::pair<uint32_t, uint32_t>> vpwItems; for (auto item : items) { const auto value = static_cast<double>(item.first); const auto weight = static_cast<double>(item.second); const auto valuePerWeight = value / weight; vpwItems.insert( {valuePerWeight, item} ); } double resultValue = 0; uint32_t currentWeight = 0; // Start iteration from item with highest value per weight param ( // in sorted map it is last element) for (auto item = vpwItems.rbegin(); item != vpwItems.rend(); ++item) { if (currentWeight >= maxWeight) { break; } double vpwOfItem = item->first; uint32_t itemWeight = item->second.second; uint32_t availableWeight = std::min(itemWeight, maxWeight - currentWeight); resultValue += vpwOfItem * availableWeight; currentWeight += availableWeight; } return resultValue; } // Dynamic Programming algorithm for a Knapsack problem without repetitions // Function return result weight of the items in the knapsack // items: vector of pairs of { value, weight } static uint32_t FillDP(const uint32_t& maxWeight, const std::vector<std::pair<uint32_t, uint32_t>>& items) { if (maxWeight == 0 || items.empty()) { return 0; } const auto rowsNum = items.size() + 1; const auto colsNum = maxWeight + 1; std::vector<uint32_t> rowsVec(colsNum, 0); std::vector<std::vector<uint32_t>> valueTable(rowsNum, rowsVec); for (size_t i = 1; i < rowsNum; ++i) { for (uint32_t w = 1; w < colsNum; ++w) { valueTable[i][w] = valueTable[i - 1][w]; const auto curItemIndex = i - 1; const auto& itemValue = items[curItemIndex].first; const auto& itemWeight = items[curItemIndex].second; if (itemWeight > w) { continue; } const auto value = valueTable[i - 1][w - itemWeight] + itemValue; if (value > valueTable[i][w]) { valueTable[i][w] = value; } } } return valueTable[rowsNum - 1][colsNum - 1]; } }; } #endif // KNAPSACK_PROBLEM_HPP
39.270588
85
0.562313
[ "vector" ]
4126e718a56fffe8d64d5bdc7b0f1d35ee25ebea
1,845
cpp
C++
Module 1/Lecture 7/Extra/Vector-class/Vector.cpp
bhattigurjot/cpp-exercises
9ae770fec1b2bcdc9811b2901e62f883d3e6ed2c
[ "MIT" ]
null
null
null
Module 1/Lecture 7/Extra/Vector-class/Vector.cpp
bhattigurjot/cpp-exercises
9ae770fec1b2bcdc9811b2901e62f883d3e6ed2c
[ "MIT" ]
null
null
null
Module 1/Lecture 7/Extra/Vector-class/Vector.cpp
bhattigurjot/cpp-exercises
9ae770fec1b2bcdc9811b2901e62f883d3e6ed2c
[ "MIT" ]
null
null
null
#include"Vector.h" Vector3::Vector3() { mX = 0.0f; mY = 0.0f; mZ = 0.0f; } Vector3::Vector3(float coords[3]) { mX = coords[0]; mY = coords[1]; mZ = coords[2]; } Vector3::Vector3(float x, float y, float z) { mX = x; mY = y; mZ = z; } bool Vector3::operator==(const Vector3& rhs) { //bool equals(const Vector3& rhs); return mX == rhs.mX && mY == rhs.mY && mZ == rhs.mZ; } bool Vector3::operator!=(const Vector3& rhs) { //bool notEquals(const Vector3& rhs); return mX != rhs.mX || mY != rhs.mY || mZ != rhs.mZ; } Vector3 Vector3::operator+(const Vector3& rhs) { //Vector3 add(const Vector3& rhs); Vector3 sum; sum.mX = mX + rhs.mX; sum.mY = mY + rhs.mY; sum.mZ = mZ + rhs.mZ; return sum; } Vector3 Vector3::operator-(const Vector3& rhs) { //Vector3 sub(const Vector3& rhs); Vector3 diff; diff.mX = mX - rhs.mX; diff.mY = mY - rhs.mY; diff.mZ = mZ - rhs.mZ; return diff; } Vector3 Vector3::operator*(float scaler) { //Vector3 mul(float scaler); Vector3 p; p.mX = mX * scaler; p.mY = mY * scaler; p.mZ = mZ * scaler; return p; } float Vector3::length() { return sqrtf(mX*mX + mY*mY + mZ*mZ); } void Vector3::normalize() { float len = length(); mX /= len; mY /= len; mZ /= len; } float Vector3::operator*(const Vector3& rhs) { //float dot(const Vector3& rhs); float dotP = mX*rhs.mX + mY*rhs.mY + mZ*rhs.mZ; return dotP; } Vector3::operator float*() { //float* toFloatArray(); return &mX; } std::ostream& operator<<(std::ostream& os, const Vector3& v) { //void print(); std::cout << "<" << v.mX << ", " << v.mY << ", " << v.mZ << ">" << std::endl; return os; } std::istream& operator>>(std::istream& is, Vector3& v) { //void input(); std::cout << "Enter x: "; std::cin >> v.mX; std::cout << "Enter y: "; std::cin >> v.mY; std::cout << "Enter z: "; std::cin >> v.mZ; return is; }
15.905172
78
0.590786
[ "vector" ]
412a768101c4698e0ba33e0e6879fa46bd05170a
724
hpp
C++
s3Reader/include/S3Stats.hpp
gregornickel/s3Reader
96b5892df86cdbe8a5144e017cd7f68621faa8a0
[ "MIT" ]
null
null
null
s3Reader/include/S3Stats.hpp
gregornickel/s3Reader
96b5892df86cdbe8a5144e017cd7f68621faa8a0
[ "MIT" ]
null
null
null
s3Reader/include/S3Stats.hpp
gregornickel/s3Reader
96b5892df86cdbe8a5144e017cd7f68621faa8a0
[ "MIT" ]
null
null
null
#ifndef S3READER_S3STATS_HPP_ #define S3READER_S3STATS_HPP_ #include <iostream> #include <iomanip> // std::setw #include <fstream> // std::ofstream #include <chrono> #include "nlohmann/json.hpp" #include "GameHandler.hpp" using json = nlohmann::json; class S3Stats { public: S3Stats(GameHandler& s3); bool record(); void save(); std::string overlayData(); private: void getTakenSpots(); int findRandomRace(int i); void readRace(int i); void readStats(int i); void readSpellCost(int i); GameHandler s3; std::string filename; std::chrono::high_resolution_clock::time_point t1; json j; json jCast; std::vector<int> takenSpots; }; #endif // S3READER_S3STATS_HPP_
20.111111
54
0.691989
[ "vector" ]
412d8741da773e6d952dfb10679e773746ae253b
2,807
cpp
C++
pbe-code/04-threads-for-the-rest-of-us/test_parallel_reduce.cpp
psteinb/performance-by-example
ea5391e2377ae08acbec581cba84bbd96ccd5536
[ "CC-BY-4.0" ]
null
null
null
pbe-code/04-threads-for-the-rest-of-us/test_parallel_reduce.cpp
psteinb/performance-by-example
ea5391e2377ae08acbec581cba84bbd96ccd5536
[ "CC-BY-4.0" ]
1
2016-04-18T09:27:18.000Z
2016-04-18T09:27:18.000Z
pbe-code/04-threads-for-the-rest-of-us/test_parallel_reduce.cpp
psteinb/performance-by-example
ea5391e2377ae08acbec581cba84bbd96ccd5536
[ "CC-BY-4.0" ]
null
null
null
#define test_parallel_reduce #include <cmath> #include <chrono> #include <thread> #include "gtest/gtest.h" #include "tbb/parallel_reduce.h" #include "tbb/blocked_range.h" #include "info.hpp" using fp_microseconds_t = std::chrono::duration<double, std::chrono::microseconds::period>; using fp_nanoseconds_t = std::chrono::duration<double, std::chrono::nanoseconds::period>; static int repeats = 10; using namespace iot; template <typename it> double sum_iterators(it _begin, it _end){ double result = 0; for(;_begin!=_end;++_begin) result += _begin->power_consumption; return result; } double serial_power_sum(const std::vector<device_t>& _data){ double result = 0; for(const device_t& item : _data) result += item.power_consumption; return result; } struct power_sum{ double result; power_sum(): result(0){} power_sum(power_sum& _rhs, tbb::split ): result(0) {} ~power_sum(){} void operator()(const tbb::blocked_range<iot::device_t*>& range) { double local = result; device_t* i = range.begin(); device_t* end = range.end(); for( ;i!=end; ++i ) local += i->power_consumption; result = local; } void join(power_sum& _rhs){ result += _rhs.result; } }; TEST(power_total,non_zero_device_infos_available) { EXPECT_GT(iot::device_info.size(),0); } TEST(power_total,serial) { double sum = 0; auto start_t = std::chrono::high_resolution_clock::now(); for(int i = 0;i<repeats;++i){ sum = serial_power_sum(iot::device_info); } auto end_t = std::chrono::high_resolution_clock::now(); double time_diff_mus = (fp_microseconds_t(end_t - start_t)).count(); EXPECT_GT(time_diff_mus,0.); } TEST(power_total,parallel) { std::vector<device_t> dinfo = iot::device_info; tbb::blocked_range<device_t*> brange(&dinfo[0], &dinfo[0] + size()); float parallel_result = 0; for(int i = 0;i<repeats;++i){ power_sum functor; tbb::parallel_reduce(brange,functor); parallel_result = functor.result; } EXPECT_GT(parallel_result,0.); } TEST(power_total,parallel_same_as_seq) { std::vector<device_t> dinfo = iot::device_info; size_t items_per_thread = (dinfo.size() + std::thread::hardware_concurrency() - 1)/std::thread::hardware_concurrency(); tbb::blocked_range<device_t*> brange(&dinfo[0], &dinfo[0] + size(), items_per_thread); float parallel_sum = 0; for(int i = 0;i<repeats;++i){ power_sum functor; tbb::parallel_reduce(brange,functor); parallel_sum = functor.result; } double serial_sum = sum_iterators(&dinfo[0], &dinfo[0] + size()); EXPECT_FLOAT_EQ(parallel_sum,serial_sum); } int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
20.792593
121
0.672248
[ "vector" ]
412ee546b4c99d5a1c7fbde3456c629a6d1d1df6
4,040
cxx
C++
src/sim/prim_ops.cxx
GaloisInc/BESSPIN-BSC
21a0a8cba9e643ef5afcb87eac164cc33ea83e94
[ "BSD-2-Clause", "BSD-3-Clause" ]
1
2022-02-11T01:52:42.000Z
2022-02-11T01:52:42.000Z
src/sim/prim_ops.cxx
GaloisInc/BESSPIN-BSC
21a0a8cba9e643ef5afcb87eac164cc33ea83e94
[ "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
src/sim/prim_ops.cxx
GaloisInc/BESSPIN-BSC
21a0a8cba9e643ef5afcb87eac164cc33ea83e94
[ "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
/* * Almost all primitive operations are defined * static inline in bs_prim_ops.h * * This file contains just the implementation of * functions which manage copies of arguments to * foreign functions. */ #include <vector> #include <string> #include <cstring> #include "bluesim_types.h" #include "bs_mem_defines.h" #include "mem_alloc.h" // Used internally to record argument copies which have been // allocated but not yet released. static std::vector<unsigned int*> argument_copies_uint; static std::vector<unsigned int> argument_sizes_uint; static std::vector<char*> argument_copies_char; static std::vector<unsigned int> argument_sizes_char; // Records the current return argument static unsigned int* current_return_data = NULL; // Copy a small argument (used with polymorphic arguments <= 8 bits) unsigned int* copy_arg(const tUInt8* data, unsigned int /* n */) { unsigned int* copy = (unsigned int*) alloc_mem(1); argument_copies_uint.push_back(copy); argument_sizes_uint.push_back(1); copy[0] = (unsigned int) (*data); return copy; } // Copy a word argument (used with polymorphic arguments <= 32 bits) unsigned int* copy_arg(const tUInt32* data) { unsigned int* copy = (unsigned int*) alloc_mem(1); argument_copies_uint.push_back(copy); argument_sizes_uint.push_back(1); copy[0] = (unsigned int) (*data); return copy; } // Copy a small argument (used with polymorphic arguments <= 64 bits) unsigned int* copy_arg(const tUInt64* data, unsigned int /* n */) { unsigned int* copy = (unsigned int*) alloc_mem(2); argument_copies_uint.push_back(copy); argument_sizes_uint.push_back(2); copy[0] = (unsigned int) (*data); copy[1] = (unsigned int) ((*data) >> 32); return copy; } // Copy an array of unsigned ints (used with wide data, polymorphic or not) unsigned int* copy_arg(const unsigned int* data, unsigned int n) { unsigned int* copy = (unsigned int*) alloc_mem(n); argument_copies_uint.push_back(copy); argument_sizes_uint.push_back(n); memcpy(copy, data, n * sizeof(unsigned int)); return copy; } // Copy a string argument char* copy_arg(const std::string& str) { unsigned int n = (str.length() / BYTES_PER_WORD) + 1; char* copy = (char*) alloc_mem(n); argument_copies_char.push_back(copy); argument_sizes_char.push_back(n); strcpy(copy, str.c_str()); return copy; } // Allocate an unitialized temporary array unsigned int* ignore_arg(unsigned int n) { unsigned int* arg = (unsigned int*) alloc_mem(n); argument_copies_uint.push_back(arg); argument_sizes_uint.push_back(n); current_return_data = NULL; return arg; } unsigned int* return_arg(unsigned int n) { unsigned int* arg = (unsigned int*) alloc_mem(n); argument_copies_uint.push_back(arg); argument_sizes_uint.push_back(n); current_return_data = arg; return arg; } // Copy data from current_return_data back to the result tUInt8 write_return(unsigned int unused, tUInt8* data) { *data = (tUInt8) (current_return_data[0] & 0xFF); return *data; } tUInt32 write_return(unsigned int unused, tUInt32* data) { *data = (tUInt32) (current_return_data[0]); return *data; } tUInt64 write_return(unsigned int unused, tUInt64* data) { *data = ((tUInt64) current_return_data[0]); *data |= ((tUInt64) current_return_data[1]) << 32; return *data; } // Delete all of the currently allocated argument copies void delete_arg_copies() { std::vector<unsigned int*>::iterator u = argument_copies_uint.begin(); std::vector<unsigned int>::iterator s = argument_sizes_uint.begin(); while (u != argument_copies_uint.end()) { unsigned int* ptr = *(u++); unsigned int n = *(s++); free_mem(ptr, n); } std::vector<char*>::iterator c = argument_copies_char.begin(); s = argument_sizes_char.begin(); while (c != argument_copies_char.end()) { char* ptr = *(c++); unsigned int n = *(s++); free_mem(ptr, n); } argument_copies_uint.clear(); argument_sizes_uint.clear(); argument_copies_char.clear(); argument_sizes_char.clear(); }
27.862069
75
0.714356
[ "vector" ]
4136e4bd8592292542202179a8071188f189e0a5
866,582
hpp
C++
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_rib_ipv6_oper.hpp
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/Cisco_IOS_XR_ip_rib_ipv6_oper.hpp
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/Cisco_IOS_XR_ip_rib_ipv6_oper.hpp
CiscoDevNet/ydk-cpp
ef7d75970f2ef1154100e0f7b0a2ee823609b481
[ "ECL-2.0", "Apache-2.0" ]
11
2016-12-02T05:45:52.000Z
2019-11-07T08:28:17.000Z
#ifndef _CISCO_IOS_XR_IP_RIB_IPV6_OPER_ #define _CISCO_IOS_XR_IP_RIB_IPV6_OPER_ #include <memory> #include <vector> #include <string> #include <ydk/types.hpp> #include <ydk/errors.hpp> namespace cisco_ios_xr { namespace Cisco_IOS_XR_ip_rib_ipv6_oper { class Ipv6Rib : public ydk::Entity { public: Ipv6Rib(); ~Ipv6Rib(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::shared_ptr<ydk::Entity> clone_ptr() const override; ydk::augment_capabilities_function get_augment_capabilities_function() const override; std::string get_bundle_yang_models_location() const override; std::string get_bundle_name() const override; std::map<std::pair<std::string, std::string>, std::string> get_namespace_identity_lookup() const override; class RibTableIds; //type: Ipv6Rib::RibTableIds class Vrfs; //type: Ipv6Rib::Vrfs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds> rib_table_ids; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs> vrfs; }; // Ipv6Rib class Ipv6Rib::RibTableIds : public ydk::Entity { public: RibTableIds(); ~RibTableIds(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class RibTableId; //type: Ipv6Rib::RibTableIds::RibTableId ydk::YList rib_table_id; }; // Ipv6Rib::RibTableIds class Ipv6Rib::RibTableIds::RibTableId : public ydk::Entity { public: RibTableId(); ~RibTableId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf tableid; //type: string class Information; //type: Ipv6Rib::RibTableIds::RibTableId::Information class SummaryProtos; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos class RibTableItfHndls; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos> summary_protos; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls> rib_table_itf_hndls; }; // Ipv6Rib::RibTableIds::RibTableId class Ipv6Rib::RibTableIds::RibTableId::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf tableid; //type: uint32 ydk::YLeaf afi; //type: uint32 ydk::YLeaf safi; //type: uint32 ydk::YLeaf vrf_name; //type: string ydk::YLeaf table_name; //type: string ydk::YLeaf version; //type: uint64 ydk::YLeaf conf_prefix_limit; //type: uint32 ydk::YLeaf current_prefix_count; //type: uint32 ydk::YLeaf num_svdlcl_prefix; //type: uint32 ydk::YLeaf num_svdrem_prefix; //type: uint32 ydk::YLeaf table_version; //type: uint64 ydk::YLeaf prefix_limit_notified; //type: boolean ydk::YLeaf fwd_referenced; //type: boolean ydk::YLeaf deleted; //type: boolean ydk::YLeaf initial_converge; //type: boolean }; // Ipv6Rib::RibTableIds::RibTableId::Information class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos : public ydk::Entity { public: SummaryProtos(); ~SummaryProtos(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class SummaryProto; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto ydk::YList summary_proto; }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto : public ydk::Entity { public: SummaryProto(); ~SummaryProto(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protoid; //type: uint32 ydk::YLeaf name; //type: string ydk::YLeaf instance; //type: string class ProtoRouteCount; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount class RtypeNone; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone class RtypeOther; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther class RtypeOspfIntra; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra class RtypeOspfInter; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter class RtypeOspfExtern1; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1 class RtypeOspfExtern2; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2 class RtypeIsisSum; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum class RtypeIsisL1; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1 class RtypeIsisL2; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2 class RtypeIsisL1Ia; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia class RtypeBgpInt; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt class RtypeBgpExt; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt class RtypeBgpLoc; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc class RtypeOspfNssa1; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1 class RtypeOspfNssa2; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2 class RtypeIgrp2Int; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int class RtypeIgrp2Ext; //type: Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount> proto_route_count; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone> rtype_none; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther> rtype_other; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra> rtype_ospf_intra; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter> rtype_ospf_inter; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1> rtype_ospf_extern1; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2> rtype_ospf_extern2; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum> rtype_isis_sum; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1> rtype_isis_l1; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2> rtype_isis_l2; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia> rtype_isis_l1_ia; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt> rtype_bgp_int; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt> rtype_bgp_ext; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc> rtype_bgp_loc; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1> rtype_ospf_nssa1; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2> rtype_ospf_nssa2; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int> rtype_igrp2_int; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext> rtype_igrp2_ext; }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount : public ydk::Entity { public: ProtoRouteCount(); ~ProtoRouteCount(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone : public ydk::Entity { public: RtypeNone(); ~RtypeNone(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther : public ydk::Entity { public: RtypeOther(); ~RtypeOther(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra : public ydk::Entity { public: RtypeOspfIntra(); ~RtypeOspfIntra(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter : public ydk::Entity { public: RtypeOspfInter(); ~RtypeOspfInter(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1 : public ydk::Entity { public: RtypeOspfExtern1(); ~RtypeOspfExtern1(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1 class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2 : public ydk::Entity { public: RtypeOspfExtern2(); ~RtypeOspfExtern2(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2 class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum : public ydk::Entity { public: RtypeIsisSum(); ~RtypeIsisSum(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1 : public ydk::Entity { public: RtypeIsisL1(); ~RtypeIsisL1(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1 class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2 : public ydk::Entity { public: RtypeIsisL2(); ~RtypeIsisL2(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2 class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia : public ydk::Entity { public: RtypeIsisL1Ia(); ~RtypeIsisL1Ia(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt : public ydk::Entity { public: RtypeBgpInt(); ~RtypeBgpInt(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt : public ydk::Entity { public: RtypeBgpExt(); ~RtypeBgpExt(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc : public ydk::Entity { public: RtypeBgpLoc(); ~RtypeBgpLoc(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1 : public ydk::Entity { public: RtypeOspfNssa1(); ~RtypeOspfNssa1(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1 class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2 : public ydk::Entity { public: RtypeOspfNssa2(); ~RtypeOspfNssa2(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2 class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int : public ydk::Entity { public: RtypeIgrp2Int(); ~RtypeIgrp2Int(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int class Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext : public ydk::Entity { public: RtypeIgrp2Ext(); ~RtypeIgrp2Ext(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls : public ydk::Entity { public: RibTableItfHndls(); ~RibTableItfHndls(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class RibTableItfHndl; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl ydk::YList rib_table_itf_hndl; }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl : public ydk::Entity { public: RibTableItfHndl(); ~RibTableItfHndl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf handle; //type: uint32 class ItfRoute; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute ydk::YList itf_route; }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute : public ydk::Entity { public: ItfRoute(); ~ItfRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath> route_path; }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs : public ydk::Entity { public: Vrfs(); ~Vrfs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class Vrf; //type: Ipv6Rib::Vrfs::Vrf ydk::YList vrf; }; // Ipv6Rib::Vrfs class Ipv6Rib::Vrfs::Vrf : public ydk::Entity { public: Vrf(); ~Vrf(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf vrf_name; //type: string class Afs; //type: Ipv6Rib::Vrfs::Vrf::Afs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs> afs; }; // Ipv6Rib::Vrfs::Vrf class Ipv6Rib::Vrfs::Vrf::Afs : public ydk::Entity { public: Afs(); ~Afs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Af; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af ydk::YList af; }; // Ipv6Rib::Vrfs::Vrf::Afs class Ipv6Rib::Vrfs::Vrf::Afs::Af : public ydk::Entity { public: Af(); ~Af(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf af_name; //type: string class Safs; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs> safs; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs : public ydk::Entity { public: Safs(); ~Safs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Saf; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf ydk::YList saf; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf : public ydk::Entity { public: Saf(); ~Saf(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf saf_name; //type: string class IpRibRouteTableNames; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames> ip_rib_route_table_names; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames : public ydk::Entity { public: IpRibRouteTableNames(); ~IpRibRouteTableNames(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class IpRibRouteTableName; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName ydk::YList ip_rib_route_table_name; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName : public ydk::Entity { public: IpRibRouteTableName(); ~IpRibRouteTableName(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf route_table_name; //type: string class DestinationKw; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw class Adverts; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts class DeletedRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes class Protocol; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol class Routes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes class QRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes class BackupRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw> destination_kw; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts> adverts; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes> deleted_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol> protocol; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes> routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes> q_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes> backup_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw : public ydk::Entity { public: DestinationKw(); ~DestinationKw(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestQRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes class DestBackupRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes class DestBestRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes class DestNextHopRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes> dest_q_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes> dest_backup_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes> dest_best_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes> dest_next_hop_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes : public ydk::Entity { public: DestQRoutes(); ~DestQRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestQRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute ydk::YList dest_q_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute : public ydk::Entity { public: DestQRoute(); ~DestQRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes : public ydk::Entity { public: DestBackupRoutes(); ~DestBackupRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestBackupRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute ydk::YList dest_backup_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute : public ydk::Entity { public: DestBackupRoute(); ~DestBackupRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes : public ydk::Entity { public: DestBestRoutes(); ~DestBestRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestBestRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute ydk::YList dest_best_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute : public ydk::Entity { public: DestBestRoute(); ~DestBestRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes : public ydk::Entity { public: DestNextHopRoutes(); ~DestNextHopRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestNextHopRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute ydk::YList dest_next_hop_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute : public ydk::Entity { public: DestNextHopRoute(); ~DestNextHopRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts : public ydk::Entity { public: Adverts(); ~Adverts(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Advert; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert ydk::YList advert; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert : public ydk::Entity { public: Advert(); ~Advert(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 class Ipv6RibEdmAdvert; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert::Ipv6RibEdmAdvert ydk::YList ipv6_rib_edm_advert; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert::Ipv6RibEdmAdvert : public ydk::Entity { public: Ipv6RibEdmAdvert(); ~Ipv6RibEdmAdvert(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf client_id; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf extended_communities; //type: string ydk::YLeaf protocol_opaque_flags; //type: uint8 ydk::YLeaf protocol_opaque; //type: uint32 ydk::YLeaf code; //type: int8 ydk::YLeaf instance_name; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert::Ipv6RibEdmAdvert class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes : public ydk::Entity { public: DeletedRoutes(); ~DeletedRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DeletedRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute ydk::YList deleted_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute : public ydk::Entity { public: DeletedRoute(); ~DeletedRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol : public ydk::Entity { public: Protocol(); ~Protocol(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Local; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local class Bgp; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp class Mobile; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile class Eigrp; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp class Rpl; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl class Static; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static class TeClient; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient class Subscriber; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber class Ospf; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf class Connected; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected class Isis; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local> local; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp> bgp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile> mobile; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp> eigrp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl> rpl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static> static_; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient> te_client; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber> subscriber; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf> ospf; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected> connected; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis> isis; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local : public ydk::Entity { public: Local(); ~Local(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Lspv; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv class NonAs; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv> lspv; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs> non_as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv : public ydk::Entity { public: Lspv(); ~Lspv(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp : public ydk::Entity { public: Bgp(); ~Bgp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As ydk::YList as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile : public ydk::Entity { public: Mobile(); ~Mobile(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs> non_as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp : public ydk::Entity { public: Eigrp(); ~Eigrp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As ydk::YList as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl : public ydk::Entity { public: Rpl(); ~Rpl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As ydk::YList as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static : public ydk::Entity { public: Static(); ~Static(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs> non_as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient : public ydk::Entity { public: TeClient(); ~TeClient(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs> non_as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber : public ydk::Entity { public: Subscriber(); ~Subscriber(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs> non_as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf : public ydk::Entity { public: Ospf(); ~Ospf(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As ydk::YList as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected : public ydk::Entity { public: Connected(); ~Connected(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class L2vpn; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn class NonAs; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn> l2vpn; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs> non_as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn : public ydk::Entity { public: L2vpn(); ~L2vpn(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis : public ydk::Entity { public: Isis(); ~Isis(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As ydk::YList as; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information class ProtocolRoutes; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes> protocol_routes; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes : public ydk::Entity { public: Routes(); ~Routes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Route; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route ydk::YList route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route : public ydk::Entity { public: Route(); ~Route(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes : public ydk::Entity { public: QRoutes(); ~QRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class QRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute ydk::YList q_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute : public ydk::Entity { public: QRoute(); ~QRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes : public ydk::Entity { public: BackupRoutes(); ~BackupRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class BackupRoute; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute ydk::YList backup_route; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute : public ydk::Entity { public: BackupRoute(); ~BackupRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf protoid; //type: uint32 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath> route_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6Rib::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby : public ydk::Entity { public: Ipv6RibStdby(); ~Ipv6RibStdby(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::shared_ptr<ydk::Entity> clone_ptr() const override; ydk::augment_capabilities_function get_augment_capabilities_function() const override; std::string get_bundle_yang_models_location() const override; std::string get_bundle_name() const override; std::map<std::pair<std::string, std::string>, std::string> get_namespace_identity_lookup() const override; class RibTableIds; //type: Ipv6RibStdby::RibTableIds class Vrfs; //type: Ipv6RibStdby::Vrfs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds> rib_table_ids; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs> vrfs; }; // Ipv6RibStdby class Ipv6RibStdby::RibTableIds : public ydk::Entity { public: RibTableIds(); ~RibTableIds(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class RibTableId; //type: Ipv6RibStdby::RibTableIds::RibTableId ydk::YList rib_table_id; }; // Ipv6RibStdby::RibTableIds class Ipv6RibStdby::RibTableIds::RibTableId : public ydk::Entity { public: RibTableId(); ~RibTableId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf tableid; //type: string class Information; //type: Ipv6RibStdby::RibTableIds::RibTableId::Information class SummaryProtos; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos class RibTableItfHndls; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos> summary_protos; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls> rib_table_itf_hndls; }; // Ipv6RibStdby::RibTableIds::RibTableId class Ipv6RibStdby::RibTableIds::RibTableId::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf tableid; //type: uint32 ydk::YLeaf afi; //type: uint32 ydk::YLeaf safi; //type: uint32 ydk::YLeaf vrf_name; //type: string ydk::YLeaf table_name; //type: string ydk::YLeaf version; //type: uint64 ydk::YLeaf conf_prefix_limit; //type: uint32 ydk::YLeaf current_prefix_count; //type: uint32 ydk::YLeaf num_svdlcl_prefix; //type: uint32 ydk::YLeaf num_svdrem_prefix; //type: uint32 ydk::YLeaf table_version; //type: uint64 ydk::YLeaf prefix_limit_notified; //type: boolean ydk::YLeaf fwd_referenced; //type: boolean ydk::YLeaf deleted; //type: boolean ydk::YLeaf initial_converge; //type: boolean }; // Ipv6RibStdby::RibTableIds::RibTableId::Information class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos : public ydk::Entity { public: SummaryProtos(); ~SummaryProtos(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class SummaryProto; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto ydk::YList summary_proto; }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto : public ydk::Entity { public: SummaryProto(); ~SummaryProto(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protoid; //type: uint32 ydk::YLeaf name; //type: string ydk::YLeaf instance; //type: string class ProtoRouteCount; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount class RtypeNone; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone class RtypeOther; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther class RtypeOspfIntra; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra class RtypeOspfInter; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter class RtypeOspfExtern1; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1 class RtypeOspfExtern2; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2 class RtypeIsisSum; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum class RtypeIsisL1; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1 class RtypeIsisL2; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2 class RtypeIsisL1Ia; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia class RtypeBgpInt; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt class RtypeBgpExt; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt class RtypeBgpLoc; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc class RtypeOspfNssa1; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1 class RtypeOspfNssa2; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2 class RtypeIgrp2Int; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int class RtypeIgrp2Ext; //type: Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount> proto_route_count; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone> rtype_none; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther> rtype_other; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra> rtype_ospf_intra; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter> rtype_ospf_inter; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1> rtype_ospf_extern1; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2> rtype_ospf_extern2; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum> rtype_isis_sum; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1> rtype_isis_l1; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2> rtype_isis_l2; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia> rtype_isis_l1_ia; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt> rtype_bgp_int; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt> rtype_bgp_ext; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc> rtype_bgp_loc; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1> rtype_ospf_nssa1; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2> rtype_ospf_nssa2; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int> rtype_igrp2_int; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext> rtype_igrp2_ext; }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount : public ydk::Entity { public: ProtoRouteCount(); ~ProtoRouteCount(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::ProtoRouteCount class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone : public ydk::Entity { public: RtypeNone(); ~RtypeNone(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeNone class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther : public ydk::Entity { public: RtypeOther(); ~RtypeOther(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOther class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra : public ydk::Entity { public: RtypeOspfIntra(); ~RtypeOspfIntra(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfIntra class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter : public ydk::Entity { public: RtypeOspfInter(); ~RtypeOspfInter(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfInter class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1 : public ydk::Entity { public: RtypeOspfExtern1(); ~RtypeOspfExtern1(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern1 class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2 : public ydk::Entity { public: RtypeOspfExtern2(); ~RtypeOspfExtern2(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfExtern2 class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum : public ydk::Entity { public: RtypeIsisSum(); ~RtypeIsisSum(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisSum class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1 : public ydk::Entity { public: RtypeIsisL1(); ~RtypeIsisL1(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1 class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2 : public ydk::Entity { public: RtypeIsisL2(); ~RtypeIsisL2(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL2 class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia : public ydk::Entity { public: RtypeIsisL1Ia(); ~RtypeIsisL1Ia(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIsisL1Ia class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt : public ydk::Entity { public: RtypeBgpInt(); ~RtypeBgpInt(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpInt class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt : public ydk::Entity { public: RtypeBgpExt(); ~RtypeBgpExt(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpExt class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc : public ydk::Entity { public: RtypeBgpLoc(); ~RtypeBgpLoc(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeBgpLoc class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1 : public ydk::Entity { public: RtypeOspfNssa1(); ~RtypeOspfNssa1(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa1 class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2 : public ydk::Entity { public: RtypeOspfNssa2(); ~RtypeOspfNssa2(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeOspfNssa2 class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int : public ydk::Entity { public: RtypeIgrp2Int(); ~RtypeIgrp2Int(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Int class Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext : public ydk::Entity { public: RtypeIgrp2Ext(); ~RtypeIgrp2Ext(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf num_backup_routes; //type: uint32 ydk::YLeaf num_active_paths; //type: uint32 ydk::YLeaf num_backup_paths; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::SummaryProtos::SummaryProto::RtypeIgrp2Ext class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls : public ydk::Entity { public: RibTableItfHndls(); ~RibTableItfHndls(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class RibTableItfHndl; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl ydk::YList rib_table_itf_hndl; }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl : public ydk::Entity { public: RibTableItfHndl(); ~RibTableItfHndl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf handle; //type: uint32 class ItfRoute; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute ydk::YList itf_route; }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute : public ydk::Entity { public: ItfRoute(); ~ItfRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath> route_path; }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::RibTableIds::RibTableId::RibTableItfHndls::RibTableItfHndl::ItfRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs : public ydk::Entity { public: Vrfs(); ~Vrfs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class Vrf; //type: Ipv6RibStdby::Vrfs::Vrf ydk::YList vrf; }; // Ipv6RibStdby::Vrfs class Ipv6RibStdby::Vrfs::Vrf : public ydk::Entity { public: Vrf(); ~Vrf(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf vrf_name; //type: string class Afs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs> afs; }; // Ipv6RibStdby::Vrfs::Vrf class Ipv6RibStdby::Vrfs::Vrf::Afs : public ydk::Entity { public: Afs(); ~Afs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Af; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af ydk::YList af; }; // Ipv6RibStdby::Vrfs::Vrf::Afs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af : public ydk::Entity { public: Af(); ~Af(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf af_name; //type: string class Safs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs> safs; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs : public ydk::Entity { public: Safs(); ~Safs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Saf; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf ydk::YList saf; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf : public ydk::Entity { public: Saf(); ~Saf(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf saf_name; //type: string class IpRibRouteTableNames; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames> ip_rib_route_table_names; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames : public ydk::Entity { public: IpRibRouteTableNames(); ~IpRibRouteTableNames(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class IpRibRouteTableName; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName ydk::YList ip_rib_route_table_name; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName : public ydk::Entity { public: IpRibRouteTableName(); ~IpRibRouteTableName(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf route_table_name; //type: string class DestinationKw; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw class Adverts; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts class DeletedRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes class Protocol; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol class Routes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes class QRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes class BackupRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw> destination_kw; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts> adverts; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes> deleted_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol> protocol; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes> routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes> q_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes> backup_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw : public ydk::Entity { public: DestinationKw(); ~DestinationKw(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestQRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes class DestBackupRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes class DestBestRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes class DestNextHopRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes> dest_q_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes> dest_backup_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes> dest_best_routes; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes> dest_next_hop_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes : public ydk::Entity { public: DestQRoutes(); ~DestQRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestQRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute ydk::YList dest_q_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute : public ydk::Entity { public: DestQRoute(); ~DestQRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestQRoutes::DestQRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes : public ydk::Entity { public: DestBackupRoutes(); ~DestBackupRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestBackupRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute ydk::YList dest_backup_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute : public ydk::Entity { public: DestBackupRoute(); ~DestBackupRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBackupRoutes::DestBackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes : public ydk::Entity { public: DestBestRoutes(); ~DestBestRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestBestRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute ydk::YList dest_best_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute : public ydk::Entity { public: DestBestRoute(); ~DestBestRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestBestRoutes::DestBestRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes : public ydk::Entity { public: DestNextHopRoutes(); ~DestNextHopRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DestNextHopRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute ydk::YList dest_next_hop_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute : public ydk::Entity { public: DestNextHopRoute(); ~DestNextHopRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DestinationKw::DestNextHopRoutes::DestNextHopRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts : public ydk::Entity { public: Adverts(); ~Adverts(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Advert; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert ydk::YList advert; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert : public ydk::Entity { public: Advert(); ~Advert(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 class Ipv6RibEdmAdvert; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert::Ipv6RibEdmAdvert ydk::YList ipv6_rib_edm_advert; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert::Ipv6RibEdmAdvert : public ydk::Entity { public: Ipv6RibEdmAdvert(); ~Ipv6RibEdmAdvert(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf client_id; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf extended_communities; //type: string ydk::YLeaf protocol_opaque_flags; //type: uint8 ydk::YLeaf protocol_opaque; //type: uint32 ydk::YLeaf code; //type: int8 ydk::YLeaf instance_name; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Adverts::Advert::Ipv6RibEdmAdvert class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes : public ydk::Entity { public: DeletedRoutes(); ~DeletedRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DeletedRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute ydk::YList deleted_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute : public ydk::Entity { public: DeletedRoute(); ~DeletedRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::DeletedRoutes::DeletedRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol : public ydk::Entity { public: Protocol(); ~Protocol(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Local; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local class Bgp; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp class Mobile; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile class Eigrp; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp class Rpl; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl class Static; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static class TeClient; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient class Subscriber; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber class Ospf; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf class Connected; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected class Isis; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local> local; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp> bgp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile> mobile; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp> eigrp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl> rpl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static> static_; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient> te_client; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber> subscriber; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf> ospf; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected> connected; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis> isis; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local : public ydk::Entity { public: Local(); ~Local(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Lspv; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv class NonAs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv> lspv; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs> non_as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv : public ydk::Entity { public: Lspv(); ~Lspv(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::Lspv::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Local::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp : public ydk::Entity { public: Bgp(); ~Bgp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As ydk::YList as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Bgp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile : public ydk::Entity { public: Mobile(); ~Mobile(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs> non_as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Mobile::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp : public ydk::Entity { public: Eigrp(); ~Eigrp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As ydk::YList as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Eigrp::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl : public ydk::Entity { public: Rpl(); ~Rpl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As ydk::YList as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Rpl::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static : public ydk::Entity { public: Static(); ~Static(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs> non_as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Static::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient : public ydk::Entity { public: TeClient(); ~TeClient(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs> non_as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::TeClient::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber : public ydk::Entity { public: Subscriber(); ~Subscriber(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NonAs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs> non_as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Subscriber::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf : public ydk::Entity { public: Ospf(); ~Ospf(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As ydk::YList as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Ospf::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected : public ydk::Entity { public: Connected(); ~Connected(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class L2vpn; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn class NonAs; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn> l2vpn; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs> non_as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn : public ydk::Entity { public: L2vpn(); ~L2vpn(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::L2vpn::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs : public ydk::Entity { public: NonAs(); ~NonAs(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Connected::NonAs::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis : public ydk::Entity { public: Isis(); ~Isis(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class As; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As ydk::YList as; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As : public ydk::Entity { public: As(); ~As(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf as; //type: string class Information; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information class ProtocolRoutes; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information> information; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes> protocol_routes; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information : public ydk::Entity { public: Information(); ~Information(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf protocol_names; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf version; //type: uint32 ydk::YLeaf redistribution_client_count; //type: uint32 ydk::YLeaf protocol_clients_count; //type: uint32 ydk::YLeaf routes_counts; //type: uint32 ydk::YLeaf active_routes_count; //type: uint32 ydk::YLeaf deleted_routes_count; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf protocol_route_memory; //type: uint32 ydk::YLeaf backup_routes_count; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::Information class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes : public ydk::Entity { public: ProtocolRoutes(); ~ProtocolRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ProtocolRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute ydk::YList protocol_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute : public ydk::Entity { public: ProtocolRoute(); ~ProtocolRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Protocol::Isis::As::ProtocolRoutes::ProtocolRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes : public ydk::Entity { public: Routes(); ~Routes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Route; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route ydk::YList route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route : public ydk::Entity { public: Route(); ~Route(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::Routes::Route::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes : public ydk::Entity { public: QRoutes(); ~QRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class QRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute ydk::YList q_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute : public ydk::Entity { public: QRoute(); ~QRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::QRoutes::QRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes : public ydk::Entity { public: BackupRoutes(); ~BackupRoutes(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class BackupRoute; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute ydk::YList backup_route; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute : public ydk::Entity { public: BackupRoute(); ~BackupRoute(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf prefix_length; //type: uint8 ydk::YLeaf protoid; //type: uint32 ydk::YLeaf prefix; //type: string ydk::YLeaf prefix_length_xr; //type: uint8 ydk::YLeaf route_version; //type: uint32 ydk::YLeaf protocol_id; //type: uint32 ydk::YLeaf protocol_name; //type: string ydk::YLeaf instance; //type: string ydk::YLeaf client_id; //type: uint32 ydk::YLeaf route_type; //type: uint16 ydk::YLeaf priority; //type: uint8 ydk::YLeaf svd_type; //type: uint8 ydk::YLeaf flags; //type: uint32 ydk::YLeaf extended_flags; //type: uint64 ydk::YLeaf tag; //type: uint32 ydk::YLeaf distance; //type: uint32 ydk::YLeaf diversion_distance; //type: uint32 ydk::YLeaf metric; //type: uint32 ydk::YLeaf paths_count; //type: uint32 ydk::YLeaf attribute_identity; //type: uint32 ydk::YLeaf traffic_index; //type: uint8 ydk::YLeaf route_precedence; //type: uint8 ydk::YLeaf qos_group; //type: uint8 ydk::YLeaf flow_tag; //type: uint8 ydk::YLeaf fwd_class; //type: uint8 ydk::YLeaf pic_count; //type: uint8 ydk::YLeaf active; //type: boolean ydk::YLeaf diversion; //type: boolean ydk::YLeaf diversion_proto_name; //type: string ydk::YLeaf route_age; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf version; //type: uint32 ydk::YLeaf tbl_version; //type: uint64 ydk::YLeaf route_modify_time; //type: uint64 class RoutePath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_ip_rib_ipv6_oper::Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath> route_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath : public ydk::Entity { public: RoutePath(); ~RoutePath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6RibEdmPath; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath ydk::YList ipv6_rib_edm_path; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath : public ydk::Entity { public: Ipv6RibEdmPath(); ~Ipv6RibEdmPath(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf address; //type: string ydk::YLeaf information_source; //type: string ydk::YLeaf v6_nexthop; //type: string ydk::YLeaf v6_information_source; //type: string ydk::YLeaf interface_name; //type: string ydk::YLeaf metric; //type: uint32 ydk::YLeaf load_metric; //type: uint32 ydk::YLeaf flags64; //type: uint64 ydk::YLeaf flags; //type: uint16 ydk::YLeaf private_flags; //type: uint16 ydk::YLeaf looped; //type: boolean ydk::YLeaf next_hop_table_id; //type: uint32 ydk::YLeaf next_hop_vrf_name; //type: string ydk::YLeaf next_hop_table_name; //type: string ydk::YLeaf next_hop_afi; //type: uint32 ydk::YLeaf next_hop_safi; //type: uint32 ydk::YLeaf route_label; //type: uint32 ydk::YLeaf tunnel_id; //type: uint32 ydk::YLeaf pathid; //type: uint32 ydk::YLeaf backup_pathid; //type: uint32 ydk::YLeaf ref_cnt_of_backup; //type: uint32 ydk::YLeaf number_of_extended_communities; //type: uint32 ydk::YLeaf mvpn_present; //type: boolean ydk::YLeaf path_rt_present; //type: boolean ydk::YLeaf vrf_import_rt_present; //type: boolean ydk::YLeaf source_asrt_present; //type: boolean ydk::YLeaf source_rd_present; //type: boolean ydk::YLeaf segmented_nexthop_present; //type: boolean ydk::YLeaf number_of_nnh; //type: uint32 ydk::YLeaf next_hop_id; //type: uint32 ydk::YLeaf next_hop_id_refcount; //type: uint32 ydk::YLeaf ospf_area_id; //type: string ydk::YLeaf has_labelstk; //type: boolean ydk::YLeaf num_labels; //type: uint8 ydk::YLeaf binding_label; //type: uint32 ydk::YLeaf nhid_feid; //type: uint64 ydk::YLeaf mpls_feid; //type: uint64 ydk::YLeaf has_vxlan_network_id; //type: boolean ydk::YLeaf vxlan_network_id; //type: uint32 ydk::YLeaf has_xcid; //type: boolean ydk::YLeaf xcid; //type: uint32 ydk::YLeaf has_span_diag_interface; //type: boolean ydk::YLeaf span_diag_interface; //type: string ydk::YLeaf has_subscriber_parent_interface; //type: boolean ydk::YLeaf subscriber_parent_interface; //type: string ydk::YLeaf interface_index_present; //type: boolean ydk::YLeaf interface_index_attribute; //type: uint32 class RemoteBackupAddr; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Labelstk; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class NextNextHop; //type: Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop ydk::YList remote_backup_addr; ydk::YList labelstk; ydk::YList next_next_hop; }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr : public ydk::Entity { public: RemoteBackupAddr(); ~RemoteBackupAddr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: string }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::RemoteBackupAddr class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk : public ydk::Entity { public: Labelstk(); ~Labelstk(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf entry; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::Labelstk class Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop : public ydk::Entity { public: NextNextHop(); ~NextNextHop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: RibEdmNnh ydk::YLeaf unknownval; //type: uint32 ydk::YLeaf address; //type: string ydk::YLeaf interface_index; //type: uint32 }; // Ipv6RibStdby::Vrfs::Vrf::Afs::Af::Safs::Saf::IpRibRouteTableNames::IpRibRouteTableName::BackupRoutes::BackupRoute::RoutePath::Ipv6RibEdmPath::NextNextHop class RibEdmNnh : public ydk::Enum { public: static const ydk::Enum::YLeaf unknown; static const ydk::Enum::YLeaf ipv4_address; static const ydk::Enum::YLeaf if_index; static int get_enum_value(const std::string & name) { if (name == "unknown") return 0; if (name == "ipv4-address") return 1; if (name == "if-index") return 2; return -1; } }; } } #endif /* _CISCO_IOS_XR_IP_RIB_IPV6_OPER_ */
58.895066
239
0.699043
[ "vector" ]
4137b385d7d82f754591b1deaae638abe99b8bfa
6,293
hpp
C++
src/tree/tree.hpp
Zoxc/mirb
14c2fe2d2a026fb3bb62c883e8839e1078ebc3b6
[ "BSD-3-Clause" ]
10
2016-10-06T06:22:20.000Z
2022-02-28T05:33:09.000Z
src/tree/tree.hpp
Zoxc/mirb
14c2fe2d2a026fb3bb62c883e8839e1078ebc3b6
[ "BSD-3-Clause" ]
null
null
null
src/tree/tree.hpp
Zoxc/mirb
14c2fe2d2a026fb3bb62c883e8839e1078ebc3b6
[ "BSD-3-Clause" ]
3
2018-01-08T03:34:34.000Z
2021-09-12T12:12:22.000Z
#pragma once #include "../common.hpp" #include <Prelude/HashTable.hpp> #include <Prelude/Vector.hpp> #include <Prelude/FastList.hpp> #include "../collector.hpp" #include "nodes.hpp" namespace Mirb { class Block; class Parser; namespace Tree { class Chunk { public: static const size_t main_size = 512; static const size_t block_size = 256; static const size_t allocation_limit = 128; static Chunk *create(size_t bytes); uint8_t *current; uint8_t *end; ListEntry<Chunk> entry; void *allocate(size_t bytes); }; class FragmentBase { public: static const bool can_free = false; static const bool null_references = false; FragmentBase(size_t chunk_size); ~FragmentBase() { Chunk *c = chunks.first; while(c) { Chunk *next = c->entry.next; std::free(c); c = next; } } void *allocate(size_t bytes); void *reallocate(void *memory, size_t old_size, size_t new_size); void free(void *) { } private: const size_t chunk_size; Chunk *current; FastList<Chunk> chunks; }; typedef Prelude::Allocator::ReferenceTemplate<FragmentBase> Fragment; struct Node; struct SuperNode; class Variable { public: bool heap : 1; bool has_default_value : 1; bool parameter_group : 1; bool discard : 1; Scope *owner; // Only valid for heap variables Variable() : heap(false), has_default_value(false), parameter_group(false), discard(false) { } size_t loc; }; class NamedVariable: public Variable { public: NamedVariable() : name(nullptr) {} Symbol *name; NamedVariable *next; }; class Parameter: public NamedVariable { public: Parameter() : NamedVariable(), reported(false), node(nullptr) {} bool reported; Node *node; SourceLoc range; ListEntry<Parameter> parameter_entry; }; class VariableMapFunctions: public HashTableFunctions<Symbol *, NamedVariable *, Fragment> { public: static bool compare_key_value(Symbol *key, size_t, NamedVariable *value) { return key == value->name; } static Symbol *get_key(NamedVariable *value) { return value->name; } static NamedVariable *get_value_next(NamedVariable *value) { return value->next; } static void set_value_next(NamedVariable *value, NamedVariable *next) { value->next = next; } static size_t hash_key(Symbol *key) { return (size_t)key; } static bool valid_key(Symbol *) { return true; } }; typedef HashTable<Symbol *, NamedVariable *, VariableMapFunctions, Fragment> VariableMap; class Scope: public PinnedHeader { public: enum Type { Top, Method, Class, Module, Closure }; Scope(Document *document, Fragment fragment, Scope *parent, Type type); static const bool finalizer = true; ~Scope() { if(type == Tree::Scope::Closure || type == Tree::Scope::Method || type == Tree::Scope::Top) delete fragment; } bool defered() { return type == Tree::Scope::Closure || type == Tree::Scope::Method; } void parse_done(Parser &parser); VoidTrapper trapper; List<VoidTrapper> trapper_list; Document *document; Block *final; FragmentBase *fragment; Type type; Scope *parent; // The scope enclosing this one Scope *owner; // The first parent that isn't a closure. This field can point to itself. Node *group; SourceLoc *range; /* * Break related fields */ size_t break_id; // Which of the parent's break targets this block belongs to. size_t break_targets; // Number of child blocks that can raise a break exception. var_t break_dst; // The variable in the parent that the break will override. static const size_t no_break_id = (size_t)-1; /* * Variable related fields */ VariableMap variables; // A hash of the variables in this scope. size_t heap_vars; // The number of the variables that must be stored on a heap scope. Vector<Scope *, Fragment> referenced_scopes; // A list of all the scopes this scope requires. Vector<Scope *, Fragment> children; // A list of all the immediate children. To keep them alive... Vector<Variable *, Fragment> variable_list; // A list of all variables in this scope. Parameter *block_parameter; // Pointer to a named or unnamed block variable. Parameter *array_parameter; // Pointer to a named or unnamed array variable. Vector<Parameter *, Fragment> parameters; Vector<Scope *, Fragment> zsupers; template<typename F> void mark(F mark) { if(final) mark(final); mark(document); referenced_scopes.mark_content(mark); children.mark_content(mark); zsupers.mark_content(mark); if(parent) mark(parent); mark(owner); } template<class T> T *alloc_var() { T *result = new (Fragment(*fragment)) T; result->loc = variable_list.size(); variable_list.push(result); return result; } template<class T> T *define(Symbol *name) { T *result = (T *)variables.get(name); if(result) return result; result = alloc_var<T>(); result->name = name; variables.set(name, result); return result; } template<class T> T *get_var(Symbol *name) { Scope *defined_scope = defined(name, true); if(defined_scope == this) { return variables.get(name); } else if(defined_scope) { auto result = defined_scope->variables.get(name); require_var(defined_scope, result); return result; } else return define<T>(name); } void require_args(Scope *owner); void require_scope(Scope *scope); void require_var(Scope *owner, Variable *var); Scope *defined(Symbol *name, bool recursive); }; }; }; void *operator new(size_t bytes, Mirb::Tree::Fragment fragment) throw(); void operator delete(void *, Mirb::Tree::Fragment fragment) throw();
21.404762
102
0.621484
[ "vector" ]
413a4dc5b18827e19552f3647fb43a54fce40b93
9,743
cc
C++
bridge/test/kraken_test_env.cc
devjiangzhou/kraken
d7b48100f8a017a9ccb9ea1628e319d8f1159c91
[ "Apache-2.0" ]
null
null
null
bridge/test/kraken_test_env.cc
devjiangzhou/kraken
d7b48100f8a017a9ccb9ea1628e319d8f1159c91
[ "Apache-2.0" ]
null
null
null
bridge/test/kraken_test_env.cc
devjiangzhou/kraken
d7b48100f8a017a9ccb9ea1628e319d8f1159c91
[ "Apache-2.0" ]
null
null
null
/* * Copyright (C) 2021 Alibaba Inc. All rights reserved. * Author: Kraken Team. */ #include "kraken_test_env.h" #include <sys/time.h> #include <vector> #include "bindings/qjs/dom/event_target.h" #include "dart_methods.h" #include "include/kraken_bridge.h" #include "kraken_bridge_test.h" #include "page.h" #if defined(__linux__) || defined(__APPLE__) static int64_t get_time_ms(void) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return (uint64_t)ts.tv_sec * 1000 + (ts.tv_nsec / 1000000); } #else /* more portable, but does not work if the date is updated */ static int64_t get_time_ms(void) { struct timeval tv; gettimeofday(&tv, NULL); return (int64_t)tv.tv_sec * 1000 + (tv.tv_usec / 1000); } #endif typedef struct { struct list_head link; int64_t timeout; DOMTimer* timer; int32_t contextId; bool isInterval; AsyncCallback func; } JSOSTimer; typedef struct { struct list_head link; FrameCallback* callback; int32_t contextId; AsyncRAFCallback handler; int32_t callbackId; } JSFrameCallback; typedef struct JSThreadState { std::unordered_map<int32_t, JSOSTimer*> os_timers; /* list of timer.link */ std::unordered_map<int32_t, JSFrameCallback*> os_frameCallbacks; } JSThreadState; static void unlink_timer(JSThreadState* ts, JSOSTimer* th) { ts->os_timers.erase(th->timer->timerId()); } static void unlink_callback(JSThreadState* ts, JSFrameCallback* th) { ts->os_frameCallbacks.erase(th->callbackId); } NativeString* TEST_invokeModule(void* callbackContext, int32_t contextId, NativeString* moduleName, NativeString* method, NativeString* params, AsyncModuleCallback callback) { return nullptr; }; void TEST_requestBatchUpdate(int32_t contextId){}; void TEST_reloadApp(int32_t contextId) {} int32_t timerId = 0; int32_t TEST_setTimeout(DOMTimer* timer, int32_t contextId, AsyncCallback callback, int32_t timeout) { JSRuntime* rt = JS_GetRuntime(timer->ctx()); auto* context = static_cast<ExecutionContext*>(JS_GetContextOpaque(timer->ctx())); JSThreadState* ts = static_cast<JSThreadState*>(JS_GetRuntimeOpaque(rt)); JSOSTimer* th = static_cast<JSOSTimer*>(js_mallocz(context->ctx(), sizeof(*th))); th->timeout = get_time_ms() + timeout; th->func = callback; th->timer = timer; th->contextId = contextId; th->isInterval = false; int32_t id = timerId++; ts->os_timers[id] = th; return id; } int32_t TEST_setInterval(DOMTimer* timer, int32_t contextId, AsyncCallback callback, int32_t timeout) { JSRuntime* rt = JS_GetRuntime(timer->ctx()); auto* context = static_cast<ExecutionContext*>(JS_GetContextOpaque(timer->ctx())); JSThreadState* ts = static_cast<JSThreadState*>(JS_GetRuntimeOpaque(rt)); JSOSTimer* th = static_cast<JSOSTimer*>(js_mallocz(context->ctx(), sizeof(*th))); th->timeout = get_time_ms() + timeout; th->func = callback; th->timer = timer; th->contextId = contextId; th->isInterval = true; int32_t id = timerId++; ts->os_timers[id] = th; return id; } int32_t callbackId = 0; uint32_t TEST_requestAnimationFrame(FrameCallback* frameCallback, int32_t contextId, AsyncRAFCallback handler) { JSRuntime* rt = JS_GetRuntime(frameCallback->ctx()); auto* context = static_cast<ExecutionContext*>(JS_GetContextOpaque(frameCallback->ctx())); JSThreadState* ts = static_cast<JSThreadState*>(JS_GetRuntimeOpaque(rt)); JSFrameCallback* th = static_cast<JSFrameCallback*>(js_mallocz(context->ctx(), sizeof(*th))); th->handler = handler; th->callback = frameCallback; th->contextId = context->getContextId(); int32_t id = callbackId++; th->callbackId = id; ts->os_frameCallbacks[id] = th; return id; } void TEST_cancelAnimationFrame(int32_t contextId, int32_t id) { auto* page = static_cast<kraken::KrakenPage*>(getPage(contextId)); auto* context = page->getContext(); JSThreadState* ts = static_cast<JSThreadState*>(JS_GetRuntimeOpaque(context->runtime())); ts->os_frameCallbacks.erase(id); } void TEST_clearTimeout(int32_t contextId, int32_t timerId) { auto* page = static_cast<kraken::KrakenPage*>(getPage(contextId)); auto* context = page->getContext(); JSThreadState* ts = static_cast<JSThreadState*>(JS_GetRuntimeOpaque(context->runtime())); ts->os_timers.erase(timerId); } NativeScreen* TEST_getScreen(int32_t contextId) { return nullptr; }; double TEST_devicePixelRatio(int32_t contextId) { return 1.0; } NativeString* TEST_platformBrightness(int32_t contextId) { return nullptr; } void TEST_toBlob(void* callbackContext, int32_t contextId, AsyncBlobCallback blobCallback, int32_t elementId, double devicePixelRatio) {} void TEST_flushUICommand() {} void TEST_initWindow(int32_t contextId, void* nativePtr) {} void TEST_initDocument(int32_t contextId, void* nativePtr) {} #if ENABLE_PROFILE struct NativePerformanceEntryList { uint64_t* entries; int32_t length; }; NativePerformanceEntryList* TEST_getPerformanceEntries(int32_t) {} #endif std::once_flag testInitOnceFlag; static int32_t inited{false}; std::unique_ptr<kraken::KrakenPage> TEST_init(OnJSError onJsError) { uint32_t contextId; if (inited) { contextId = allocateNewPage(-1); } else { contextId = 0; } std::call_once(testInitOnceFlag, []() { initJSPagePool(1024 * 1024); inited = true; }); initTestFramework(contextId); auto* page = static_cast<kraken::KrakenPage*>(getPage(contextId)); auto* context = page->getContext(); JSThreadState* th = new JSThreadState(); JS_SetRuntimeOpaque(context->runtime(), th); TEST_mockDartMethods(onJsError); return std::unique_ptr<kraken::KrakenPage>(page); } std::unique_ptr<kraken::KrakenPage> TEST_init() { return TEST_init(nullptr); } std::unique_ptr<kraken::KrakenPage> TEST_allocateNewPage() { uint32_t newContextId = allocateNewPage(-1); initTestFramework(newContextId); return std::unique_ptr<kraken::KrakenPage>(static_cast<kraken::KrakenPage*>(getPage(newContextId))); } static bool jsPool(ExecutionContext* context) { JSRuntime* rt = context->runtime(); JSThreadState* ts = static_cast<JSThreadState*>(JS_GetRuntimeOpaque(rt)); int64_t cur_time, delay; struct list_head* el; if (ts->os_timers.empty() && ts->os_frameCallbacks.empty()) return true; /* no more events */ if (!ts->os_timers.empty()) { cur_time = get_time_ms(); for (auto& entry : ts->os_timers) { JSOSTimer* th = entry.second; delay = th->timeout - cur_time; if (delay <= 0) { AsyncCallback func; /* the timer expired */ func = th->func; if (th->isInterval) { func(th->timer, th->contextId, nullptr); } else { th->func = nullptr; func(th->timer, th->contextId, nullptr); unlink_timer(ts, th); } return false; } } } if (!ts->os_frameCallbacks.empty()) { for (auto& entry : ts->os_frameCallbacks) { JSFrameCallback* th = entry.second; AsyncRAFCallback handler = th->handler; th->handler = nullptr; handler(th->callback, th->contextId, 0, nullptr); unlink_callback(ts, th); return false; } } return false; } void TEST_runLoop(ExecutionContext* context) { for (;;) { context->drainPendingPromiseJobs(); if (jsPool(context)) break; } } void TEST_dispatchEvent(int32_t contextId, EventTargetInstance* eventTarget, const std::string type) { NativeEventTarget* nativeEventTarget = new NativeEventTarget(eventTarget); auto nativeEventType = stringToNativeString(type); NativeString* rawEventType = nativeEventType.release(); NativeEvent* nativeEvent = new NativeEvent{rawEventType}; RawEvent* rawEvent = new RawEvent{reinterpret_cast<uint64_t*>(nativeEvent)}; NativeEventTarget::dispatchEventImpl(contextId, nativeEventTarget, rawEventType, rawEvent, false); } void TEST_callNativeMethod(void* nativePtr, void* returnValue, void* method, int32_t argc, void* argv) {} std::unordered_map<int32_t, std::shared_ptr<UnitTestEnv>> unitTestEnvMap; std::shared_ptr<UnitTestEnv> TEST_getEnv(int32_t contextUniqueId) { if (unitTestEnvMap.count(contextUniqueId) == 0) { unitTestEnvMap[contextUniqueId] = std::make_shared<UnitTestEnv>(); } return unitTestEnvMap[contextUniqueId]; } void TEST_registerEventTargetDisposedCallback(int32_t contextUniqueId, TEST_OnEventTargetDisposed callback) { if (unitTestEnvMap.count(contextUniqueId) == 0) { unitTestEnvMap[contextUniqueId] = std::make_shared<UnitTestEnv>(); } unitTestEnvMap[contextUniqueId]->onEventTargetDisposed = callback; } void TEST_mockDartMethods(OnJSError onJSError) { std::vector<uint64_t> mockMethods{ reinterpret_cast<uint64_t>(TEST_invokeModule), reinterpret_cast<uint64_t>(TEST_requestBatchUpdate), reinterpret_cast<uint64_t>(TEST_reloadApp), reinterpret_cast<uint64_t>(TEST_setTimeout), reinterpret_cast<uint64_t>(TEST_setInterval), reinterpret_cast<uint64_t>(TEST_clearTimeout), reinterpret_cast<uint64_t>(TEST_requestAnimationFrame), reinterpret_cast<uint64_t>(TEST_cancelAnimationFrame), reinterpret_cast<uint64_t>(TEST_getScreen), reinterpret_cast<uint64_t>(TEST_devicePixelRatio), reinterpret_cast<uint64_t>(TEST_platformBrightness), reinterpret_cast<uint64_t>(TEST_toBlob), reinterpret_cast<uint64_t>(TEST_flushUICommand), reinterpret_cast<uint64_t>(TEST_initWindow), reinterpret_cast<uint64_t>(TEST_initDocument), }; #if ENABLE_PROFILE mockMethods.emplace_pack(reinterpret_cast<uint64_t>(TEST_getPerformanceEntries)); #else mockMethods.emplace_back(0); #endif mockMethods.emplace_back(reinterpret_cast<uint64_t>(onJSError)); registerDartMethods(mockMethods.data(), mockMethods.size()); }
31.127796
175
0.734681
[ "vector" ]
41435113e728f037b31e645b4eeeb8b17b541c9a
17,802
cc
C++
crates/neon-sys/src/neon.cc
Acidburn0zzz/neon
e27e5651cc9a8151f58c9a6dafda2ce251456034
[ "Apache-2.0", "MIT" ]
1
2016-07-20T06:53:24.000Z
2016-07-20T06:53:24.000Z
crates/neon-sys/src/neon.cc
Acidburn0zzz/neon
e27e5651cc9a8151f58c9a6dafda2ce251456034
[ "Apache-2.0", "MIT" ]
null
null
null
crates/neon-sys/src/neon.cc
Acidburn0zzz/neon
e27e5651cc9a8151f58c9a6dafda2ce251456034
[ "Apache-2.0", "MIT" ]
null
null
null
#include <new> #include <nan.h> #include <stdint.h> #include <stdio.h> #include "node.h" #include "neon.h" #include "neon_string.h" #include "neon_class_metadata.h" extern "C" void NeonSys_Call_SetReturn(v8::FunctionCallbackInfo<v8::Value> *info, v8::Local<v8::Value> value) { info->GetReturnValue().Set(value); } extern "C" void *NeonSys_Call_GetIsolate(v8::FunctionCallbackInfo<v8::Value> *info) { return (void *)info->GetIsolate(); } extern "C" void *NeonSys_Call_CurrentIsolate() { return (void *)v8::Isolate::GetCurrent(); } extern "C" bool NeonSys_Call_IsConstruct(v8::FunctionCallbackInfo<v8::Value> *info) { return info->IsConstructCall(); } extern "C" void NeonSys_Call_This(v8::FunctionCallbackInfo<v8::Value> *info, v8::Local<v8::Object> *out) { *out = info->This(); } extern "C" void NeonSys_Call_Callee(v8::FunctionCallbackInfo<v8::Value> *info, v8::Local<v8::Function> *out) { *out = info->Callee(); } extern "C" void NeonSys_Call_Data(v8::FunctionCallbackInfo<v8::Value> *info, v8::Local<v8::Value> *out) { /* printf("Call_Data: v8 info = %p\n", *(void **)info); dump((void *)info, 3); printf("Call_Data: v8 info implicit:\n"); dump_implicit((void *)info); */ *out = info->Data(); } extern "C" int32_t NeonSys_Call_Length(v8::FunctionCallbackInfo<v8::Value> *info) { return info->Length(); } extern "C" void NeonSys_Call_Get(v8::FunctionCallbackInfo<v8::Value> *info, int32_t i, v8::Local<v8::Value> *out) { *out = (*info)[i]; } extern "C" void NeonSys_Object_New(v8::Local<v8::Object> *out) { *out = Nan::New<v8::Object>(); } extern "C" bool NeonSys_Object_GetOwnPropertyNames(v8::Local<v8::Array> *out, v8::Local<v8::Object> obj) { Nan::MaybeLocal<v8::Array> maybe = Nan::GetOwnPropertyNames(obj); return maybe.ToLocal(out); } extern "C" void *NeonSys_Object_GetIsolate(v8::Local<v8::Object> obj) { return obj->GetIsolate(); } extern "C" void NeonSys_Primitive_Undefined(v8::Local<v8::Primitive> *out) { *out = Nan::Undefined(); } extern "C" void NeonSys_Primitive_Null(v8::Local<v8::Primitive> *out) { *out = Nan::Null(); } extern "C" void NeonSys_Primitive_Boolean(v8::Local<v8::Boolean> *out, bool b) { *out = b ? Nan::True() : Nan::False(); } extern "C" bool NeonSys_Primitive_BooleanValue(v8::Local<v8::Boolean> p) { return p->Value(); } extern "C" void NeonSys_Primitive_Integer(v8::Local<v8::Integer> *out, v8::Isolate *isolate, int32_t x) { *out = v8::Integer::New(isolate, x); } extern "C" void NeonSys_Primitive_Number(v8::Local<v8::Number> *out, v8::Isolate *isolate, double value) { *out = v8::Number::New(isolate, value); } extern "C" double NeonSys_Primitive_NumberValue(v8::Local<v8::Number> n) { return n->Value(); } extern "C" bool NeonSys_Primitive_IsUint32(v8::Local<v8::Primitive> p) { return p->IsUint32(); } extern "C" bool NeonSys_Primitive_IsInt32(v8::Local<v8::Primitive> p) { return p->IsInt32(); } extern "C" int64_t NeonSys_Primitive_IntegerValue(v8::Local<v8::Integer> i) { return i->Value(); } extern "C" bool NeonSys_Object_Get_Index(v8::Local<v8::Value> *out, v8::Local<v8::Object> obj, uint32_t index) { Nan::MaybeLocal<v8::Value> maybe = Nan::Get(obj, index); return maybe.ToLocal(out); } extern "C" bool NeonSys_Object_Set_Index(bool *out, v8::Local<v8::Object> object, uint32_t index, v8::Local<v8::Value> val) { Nan::Maybe<bool> maybe = Nan::Set(object, index, val); return maybe.IsJust() && (*out = maybe.FromJust(), true); } bool NeonSys_ASCII_Key(v8::Local<v8::String> *key, const uint8_t *data, int32_t len) { Nan::MaybeLocal<v8::String> maybe_key = v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), (const char*)data, v8::NewStringType::kNormal, len); return maybe_key.ToLocal(key); } extern "C" bool NeonSys_Object_Get_String(v8::Local<v8::Value> *out, v8::Local<v8::Object> obj, const uint8_t *data, int32_t len) { Nan::EscapableHandleScope scope; v8::Local<v8::String> key; if (!NeonSys_ASCII_Key(&key, data, len)) { return false; } Nan::MaybeLocal<v8::Value> maybe = Nan::Get(obj, key); v8::Local<v8::Value> result; if (!maybe.ToLocal(&result)) { return false; } *out = scope.Escape(result); return true; } extern "C" bool NeonSys_Object_Set_String(bool *out, v8::Local<v8::Object> obj, const uint8_t *data, int32_t len, v8::Local<v8::Value> val) { Nan::HandleScope scope; v8::Local<v8::String> key; if (!NeonSys_ASCII_Key(&key, data, len)) { return false; } Nan::Maybe<bool> maybe = Nan::Set(obj, key, val); return maybe.IsJust() && (*out = maybe.FromJust(), true); } extern "C" bool NeonSys_Object_Get(v8::Local<v8::Value> *out, v8::Local<v8::Object> obj, v8::Local<v8::Value> key) { Nan::MaybeLocal<v8::Value> maybe = Nan::Get(obj, key); return maybe.ToLocal(out); } extern "C" bool NeonSys_Object_Set(bool *out, v8::Local<v8::Object> obj, v8::Local<v8::Value> key, v8::Local<v8::Value> val) { Nan::Maybe<bool> maybe = Nan::Set(obj, key, val); if (maybe.IsJust()) { *out = maybe.FromJust(); return true; } return false; } extern "C" void NeonSys_Array_New(v8::Local<v8::Array> *out, v8::Isolate *isolate, uint32_t length) { *out = v8::Array::New(isolate, length); } extern "C" uint32_t NeonSys_Array_Length(v8::Local<v8::Array> array) { return array->Length(); } extern "C" bool NeonSys_String_New(v8::Local<v8::String> *out, v8::Isolate *isolate, const uint8_t *data, int32_t len) { Nan::MaybeLocal<v8::String> maybe = v8::String::NewFromUtf8(isolate, (const char*)data, v8::NewStringType::kNormal, len); return maybe.ToLocal(out); } extern "C" int32_t NeonSys_String_Utf8Length(v8::Local<v8::String> str) { return str->Utf8Length(); } extern "C" size_t NeonSys_String_Data(char *out, size_t len, v8::Local<v8::Value> str) { return Nan::DecodeWrite(out, len, str, Nan::UTF8); } extern "C" bool NeonSys_Convert_ToString(v8::Local<v8::String> *out, v8::Local<v8::Value> value) { Nan::MaybeLocal<v8::String> maybe = Nan::To<v8::String>(value); return maybe.ToLocal(out); } extern "C" bool NeonSys_Convert_ToObject(v8::Local<v8::Object> *out, v8::Local<v8::Value> *value) { Nan::MaybeLocal<v8::Object> maybe = Nan::To<v8::Object>(*value); return maybe.ToLocal(out); } extern "C" bool NeonSys_Buffer_New(v8::Local<v8::Object> *out, uint32_t size) { Nan::MaybeLocal<v8::Object> maybe = Nan::NewBuffer(size); return maybe.ToLocal(out); } extern "C" void NeonSys_Buffer_Data(buf_t *out, v8::Local<v8::Object> obj) { out->data = node::Buffer::Data(obj); out->len = node::Buffer::Length(obj); } extern "C" bool NeonSys_Tag_IsBuffer(v8::Local<v8::Value> obj) { return node::Buffer::HasInstance(obj); } extern "C" void NeonSys_Scope_Escape(v8::Local<v8::Value> *out, Nan::EscapableHandleScope *scope, v8::Local<v8::Value> value) { *out = scope->Escape(value); } extern "C" void NeonSys_Scope_Chained(void *out, void *closure, NeonSys_ChainedScopeCallback callback, void *parent_scope) { Nan::EscapableHandleScope v8_scope; callback(out, parent_scope, &v8_scope, closure); } extern "C" void NeonSys_Scope_Nested(void *out, void *closure, NeonSys_NestedScopeCallback callback, void *realm) { Nan::HandleScope v8_scope; callback(out, realm, closure); } extern "C" void NeonSys_Fun_ExecKernel(void *kernel, NeonSys_RootScopeCallback callback, v8::FunctionCallbackInfo<v8::Value> *info, void *scope) { Nan::HandleScope v8_scope; callback(info, kernel, scope); } extern "C" void NeonSys_Module_ExecKernel(void *kernel, NeonSys_ModuleScopeCallback callback, v8::Local<v8::Object> exports, void *scope) { Nan::HandleScope v8_scope; callback(kernel, exports, scope); } extern "C" void NeonSys_Class_ConstructBaseCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { Nan::HandleScope scope; v8::Local<v8::External> wrapper = v8::Local<v8::External>::Cast(info.Data()); neon::BaseClassMetadata *metadata = static_cast<neon::BaseClassMetadata *>(wrapper->Value()); if (info.IsConstructCall()) { metadata->construct(info); } else { metadata->call(info); } } extern "C" void *NeonSys_Class_CreateBase(v8::Isolate *isolate, NeonSys_AllocateCallback allocate_callback, void *allocate_kernel, NeonSys_ConstructCallback construct_callback, void *construct_kernel, v8::FunctionCallback call_callback, void *call_kernel, NeonSys_DropCallback drop) { neon::BaseClassMetadata *metadata = new neon::BaseClassMetadata(construct_callback, construct_kernel, call_callback, call_kernel, allocate_callback, allocate_kernel, drop); v8::Local<v8::External> data = v8::External::New(isolate, metadata); v8::Local<v8::FunctionTemplate> constructor_template = v8::FunctionTemplate::New(isolate, NeonSys_Class_ConstructBaseCallback, data); metadata->SetTemplate(isolate, constructor_template); v8::Local<v8::ObjectTemplate> instance_template = constructor_template->InstanceTemplate(); instance_template->SetInternalFieldCount(1); // index 0: an aligned, owned pointer to the internals (a user-defined Rust data structure) return metadata; } extern "C" void *NeonSys_Class_GetClassMap(v8::Isolate *isolate) { neon::ClassMapHolder *holder = static_cast<neon::ClassMapHolder *>(isolate->GetData(NEON_ISOLATE_SLOT)); return (holder == nullptr) ? nullptr : holder->GetMap(); } void cleanup_class_map(void *arg) { neon::ClassMapHolder *holder = static_cast<neon::ClassMapHolder *>(arg); delete holder; } extern "C" void NeonSys_Class_SetClassMap(v8::Isolate *isolate, void *map, NeonSys_DropCallback drop_map) { neon::ClassMapHolder *holder = new neon::ClassMapHolder(map, drop_map); isolate->SetData(NEON_ISOLATE_SLOT, holder); // ISSUE(#77): When workers land in node, this will need to be generalized to a per-worker version. node::AtExit(cleanup_class_map, holder); } extern "C" void *NeonSys_Class_GetCallKernel(v8::Local<v8::External> wrapper) { neon::ClassMetadata *metadata = static_cast<neon::ClassMetadata *>(wrapper->Value()); return metadata->GetCallKernel(); } extern "C" void *NeonSys_Class_GetConstructKernel(v8::Local<v8::External> wrapper) { neon::ClassMetadata *metadata = static_cast<neon::ClassMetadata *>(wrapper->Value()); return metadata->GetConstructKernel(); } extern "C" void *NeonSys_Class_GetAllocateKernel(v8::Local<v8::External> wrapper) { neon::BaseClassMetadata *metadata = static_cast<neon::BaseClassMetadata *>(wrapper->Value()); return metadata->GetAllocateKernel(); } extern "C" bool NeonSys_Class_Constructor(v8::Local<v8::Function> *out, v8::Local<v8::FunctionTemplate> ft) { v8::MaybeLocal<v8::Function> maybe = ft->GetFunction(); return maybe.ToLocal(out); } extern "C" bool NeonSys_Class_Check(v8::Local<v8::FunctionTemplate> ft, v8::Local<v8::Value> v) { return ft->HasInstance(v); } extern "C" bool NeonSys_Class_HasInstance(void *metadata_pointer, v8::Local<v8::Value> v) { neon::ClassMetadata *metadata = static_cast<neon::ClassMetadata *>(metadata_pointer); return metadata->GetTemplate(v8::Isolate::GetCurrent())->HasInstance(v); } extern "C" bool NeonSys_Class_SetName(v8::Isolate *isolate, void *metadata_pointer, const char *name, uint32_t byte_length) { neon::ClassMetadata *metadata = static_cast<neon::ClassMetadata *>(metadata_pointer); v8::Local<v8::FunctionTemplate> ft = metadata->GetTemplate(isolate); v8::MaybeLocal<v8::String> maybe_class_name = v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kNormal, byte_length); v8::Local<v8::String> class_name; if (!maybe_class_name.ToLocal(&class_name)) { return false; } ft->SetClassName(class_name); metadata->SetName(neon::Slice(name, byte_length)); return true; } extern "C" void NeonSys_Class_ThrowCallError(v8::Isolate *isolate, void *metadata_pointer) { neon::ClassMetadata *metadata = static_cast<neon::ClassMetadata *>(metadata_pointer); Nan::ThrowTypeError(metadata->GetCallError().ToJsString(isolate, "constructor called without new.")); } extern "C" void NeonSys_Class_ThrowThisError(v8::Isolate *isolate, void *metadata_pointer) { neon::ClassMetadata *metadata = static_cast<neon::ClassMetadata *>(metadata_pointer); Nan::ThrowTypeError(metadata->GetThisError().ToJsString(isolate, "this is not an object of the expected type.")); } extern "C" bool NeonSys_Class_AddMethod(v8::Isolate *isolate, void *metadata_pointer, const char *name, uint32_t byte_length, v8::Local<v8::Function> method) { neon::ClassMetadata *metadata = static_cast<neon::ClassMetadata *>(metadata_pointer); v8::Local<v8::FunctionTemplate> ft = metadata->GetTemplate(isolate); v8::Local<v8::ObjectTemplate> pt = ft->PrototypeTemplate(); Nan::HandleScope scope; v8::MaybeLocal<v8::String> maybe_key = v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kNormal, byte_length); v8::Local<v8::String> key; if (!maybe_key.ToLocal(&key)) { return false; } pt->Set(key, method); return true; } extern "C" void NeonSys_Class_MetadataToClass(v8::Local<v8::FunctionTemplate> *out, v8::Isolate *isolate, void *metadata) { *out = static_cast<neon::ClassMetadata *>(metadata)->GetTemplate(isolate); } extern "C" void *NeonSys_Class_GetInstanceInternals(v8::Local<v8::Object> obj) { return static_cast<neon::BaseClassInstanceMetadata *>(obj->GetAlignedPointerFromInternalField(0))->GetInternals(); } extern "C" bool NeonSys_Fun_New(v8::Local<v8::Function> *out, v8::Isolate *isolate, v8::FunctionCallback callback, void *kernel) { v8::Local<v8::External> wrapper = v8::External::New(isolate, kernel); if (wrapper.IsEmpty()) { return false; } v8::MaybeLocal<v8::Function> maybe_result = v8::Function::New(isolate->GetCurrentContext(), callback, wrapper); return maybe_result.ToLocal(out); } extern "C" void *NeonSys_Fun_GetKernel(v8::Local<v8::External> data) { return data->Value(); } extern "C" bool NeonSys_Fun_Call(v8::Local<v8::Value> *out, v8::Isolate *isolate, v8::Local<v8::Function> fun, v8::Local<v8::Value> self, int32_t argc, v8::Local<v8::Value> argv[]) { v8::MaybeLocal<v8::Value> maybe_result = fun->Call(isolate->GetCurrentContext(), self, argc, argv); return maybe_result.ToLocal(out); } extern "C" bool NeonSys_Fun_Construct(v8::Local<v8::Object> *out, v8::Isolate *isolate, v8::Local<v8::Function> fun, int32_t argc, v8::Local<v8::Value> argv[]) { v8::MaybeLocal<v8::Object> maybe_result = fun->NewInstance(isolate->GetCurrentContext(), argc, argv); return maybe_result.ToLocal(out); } extern "C" tag_t NeonSys_Tag_Of(v8::Local<v8::Value> val) { return val->IsNull() ? tag_null : val->IsUndefined() ? tag_undefined : (val->IsTrue() || val->IsFalse()) ? tag_boolean // ISSUE(#78): kill this : (val->IsInt32() || val->IsUint32()) ? tag_integer : val->IsNumber() ? tag_number : val->IsString() ? tag_string : val->IsArray() ? tag_array : val->IsFunction() ? tag_function : val->IsObject() ? tag_object : tag_other; } extern "C" bool NeonSys_Tag_IsUndefined(v8::Local<v8::Value> val) { return val->IsUndefined(); } extern "C" bool NeonSys_Tag_IsNull(v8::Local<v8::Value> val) { return val->IsNull(); } extern "C" bool NeonSys_Tag_IsInteger(v8::Local<v8::Value> val) { return val->IsInt32() || val->IsUint32(); } extern "C" bool NeonSys_Tag_IsNumber(v8::Local<v8::Value> val) { return val->IsNumber(); } extern "C" bool NeonSys_Tag_IsBoolean(v8::Local<v8::Value> val) { return val->IsBoolean(); } extern "C" bool NeonSys_Tag_IsString(v8::Local<v8::Value> val) { return val->IsString(); } extern "C" bool NeonSys_Tag_IsObject(v8::Local<v8::Value> val) { return val->IsObject(); } extern "C" bool NeonSys_Tag_IsArray(v8::Local<v8::Value> val) { return val->IsArray(); } extern "C" bool NeonSys_Tag_IsFunction(v8::Local<v8::Value> val) { return val->IsFunction(); } extern "C" bool NeonSys_Tag_IsError(v8::Local<v8::Value> val) { return val->IsNativeError(); } extern "C" void NeonSys_Error_Throw(v8::Local<v8::Value> val) { Nan::ThrowError(val); } extern "C" void NeonSys_Error_NewError(v8::Local<v8::Value> *out, v8::Local<v8::String> msg) { *out = v8::Exception::Error(msg); } extern "C" void NeonSys_Error_NewTypeError(v8::Local<v8::Value> *out, v8::Local<v8::String> msg) { *out = v8::Exception::TypeError(msg); } extern "C" void NeonSys_Error_NewReferenceError(v8::Local<v8::Value> *out, v8::Local<v8::String> msg) { *out = v8::Exception::ReferenceError(msg); } extern "C" void NeonSys_Error_NewRangeError(v8::Local<v8::Value> *out, v8::Local<v8::String> msg) { *out = v8::Exception::RangeError(msg); } extern "C" void NeonSys_Error_NewSyntaxError(v8::Local<v8::Value> *out, v8::Local<v8::String> msg) { *out = v8::Exception::SyntaxError(msg); } extern "C" void NeonSys_Error_ThrowErrorFromCString(const char *msg) { Nan::ThrowError(msg); } extern "C" void NeonSys_Error_ThrowTypeErrorFromCString(const char *msg) { Nan::ThrowTypeError(msg); } extern "C" void NeonSys_Error_ThrowReferenceErrorFromCString(const char *msg) { Nan::ThrowReferenceError(msg); } extern "C" void NeonSys_Error_ThrowRangeErrorFromCString(const char *msg) { Nan::ThrowRangeError(msg); } extern "C" void NeonSys_Error_ThrowSyntaxErrorFromCString(const char *msg) { Nan::ThrowSyntaxError(msg); } extern "C" bool NeonSys_Mem_SameHandle(v8::Local<v8::Value> v1, v8::Local<v8::Value> v2) { return v1 == v2; }
37.320755
182
0.697899
[ "object" ]
4146dc82160dccb1fd4f2b492c244538884485a9
5,051
cpp
C++
db/sqlite.cpp
p-shubham/resilientdb
8e69c28e73ddebdfca8359479be4499c1cb5de41
[ "MIT" ]
1
2022-03-04T20:34:29.000Z
2022-03-04T20:34:29.000Z
db/sqlite.cpp
p-shubham/resilientdb
8e69c28e73ddebdfca8359479be4499c1cb5de41
[ "MIT" ]
null
null
null
db/sqlite.cpp
p-shubham/resilientdb
8e69c28e73ddebdfca8359479be4499c1cb5de41
[ "MIT" ]
1
2020-12-11T22:24:35.000Z
2020-12-11T22:24:35.000Z
#include "config.h" #include "database.h" #include "assert.h" #include <iostream> // Private methods int SQLite::callback(void *x, int nCol, char **colValue, char **colNames) { res_data *data = (res_data *)x; //std::cout << "DATA returned from " << data->op << " operation" << std::endl; if (data->results.size() == 0) { // Store column names for debugging data->results.push_back(std::vector<std::string>()); for (int i = 0; i < nCol; i++) { data->results.back().push_back(colNames[i]); } } data->results.push_back(std::vector<std::string>()); for (int i = 0; i < nCol; i++) { data->results.back().push_back(colValue[i] ? colValue[i] : "NULL"); } return 0; } int SQLite::createTable(const std::string tableName) { std::string query = "CREATE TABLE IF NOT EXISTS " + tableName + "(" "KEY CHAR(64) PRIMARY KEY NOT NULL," "VALUE TEXT NOT NULL);"; int rc = sqlite3_exec(*db, query.c_str(), this->callback, 0, nullptr); if (rc != SQLITE_OK) { std::cerr << "query: " << query << std::endl; std::cerr << "[createTable]: SQL error " << rc << ": " << sqlite3_errmsg(*db) << std::endl; assert(0); return 1; } else { return 0; } } // Public methods SQLite::SQLite() { _dbInstance = "SQLite"; } int SQLite::Open(const std::string dbName) { //std::string sqliteName = dbName + "_SQLite"; std::string sqliteName = dbName; #if EXT_DB == SQL_PERSISTENT int rc = sqlite3_open(sqliteName.c_str(), db); std::cout << std::endl << "SQlite Persistent."; #else int rc = sqlite3_open(":memory:", db); std::cout << std::endl << "SQlite In-Memory."; #endif if (rc != SQLITE_OK) { std::cerr << "Error opening SQLite3 database: " << sqlite3_errmsg(*db) << std::endl; sqlite3_close(*db); assert(0); } if (SelectTable("KV") != 0) { return rc; } std::cout << std::endl << "SQLite configuration OK" << std::endl; return rc; } std::string SQLite::Get(const std::string key) { std::string value; res_data res("GET"); std::string query = "SELECT KEY, VALUE FROM " + this->table + " WHERE KEY = '" + key + "';"; int rc = sqlite3_exec(*db, query.c_str(), this->callback, (void *)&res, nullptr); if (rc != SQLITE_OK) { std::cerr << "query: " << query << std::endl; std::cerr << "[GET]: SQL error " << rc << ": " << sqlite3_errmsg(*db) << std::endl; assert(0); } // Print all returned ROWS // First row contains the name of each returned columns // The next rows contain the actual values return //for(auto &row: res.res) { // for(auto &col: row) { // std::cout << col << " "; // } // std::cout << std::endl; //} if (res.results.size()) { // skip first row that contains the COLUMN name // skip first row that contains the KEY and return VALUE value = res.results[1][1]; } return value; } std::string SQLite::Put(const std::string key, const std::string value) { std::string query; res_data res("PUT"); std::string prev = Get(key); // If the value to be inserted is the same, just return if (value == prev) { return prev; } if (prev.size()) { //std::cout << "Updating the value" << std::endl; query = "UPDATE " + this->table + " set VALUE = '" + value + "' where KEY = '" + key + "';"; } else { //std::cout << "Inserting the value" << std::endl; query = "INSERT INTO " + table + " (KEY, VALUE) VALUES('" + key + "', '" + value + "');"; } int rc = sqlite3_exec(*db, query.c_str(), this->callback, (void *)&res, nullptr); if (rc != SQLITE_OK) { std::cerr << "query: " << query << std::endl; std::cerr << "[PUT]: Error executing SQLite query: " << sqlite3_errmsg(*db) << std::endl; assert(0); } return prev; } int SQLite::SelectTable(const std::string tableName) { std::string query = "SELECT name FROM sqlite_master WHERE type='table' AND name='" + tableName + "';"; res_data res("SelectTable"); int rc = sqlite3_exec(*db, query.c_str(), this->callback, (void *)&res, nullptr); if (rc != SQLITE_OK) { std::cerr << "query: " << query << std::endl; std::cerr << "[SelectTable]: Error " << rc << " executing SQLite query: " << sqlite3_errmsg(*db) << std::endl; assert(0); return 1; } this->table = tableName; if (res.results.size() == 0) { return this->createTable(tableName); } return 0; } int SQLite::Close(const std::string dbName) { if (*db != nullptr) { delete db; return 0; } return 1; }
26.307292
118
0.523461
[ "vector" ]
4148ab4402b889c6688fe7754dbfe40848a62ea0
10,195
cpp
C++
src/WireWrapper.cpp
SMFSW/WireWrapper
c82783afe576e547f48999f37192cee99e80fb15
[ "MIT" ]
4
2018-01-06T11:32:10.000Z
2021-04-12T08:01:13.000Z
src/WireWrapper.cpp
SMFSW/WireWrapper
c82783afe576e547f48999f37192cee99e80fb15
[ "MIT" ]
3
2017-01-31T12:13:55.000Z
2018-07-04T19:54:37.000Z
src/WireWrapper.cpp
SMFSW/WireWrapper
c82783afe576e547f48999f37192cee99e80fb15
[ "MIT" ]
1
2017-04-19T18:24:27.000Z
2017-04-19T18:24:27.000Z
/*!\file WireWrapper.cpp ** \author SMFSW ** \copyright MIT SMFSW (2017-2018) ** \brief Arduino Wrapper for Wire library (for SAM, ESP8266...) code ** \warning Don't access (r/w) last 16b internal address byte alone right after init, this would lead to hazardous result (in such case, make a dummy read of addr 0 before) **/ // TODO: add interrupt vector / callback for it operations (if not too messy) // TODO: consider interrupts at least for RX when slave (and TX when master) #include "WireWrapper.h" /*!\struct i2c ** \brief static ci2c bus config and control parameters **/ static struct { /*!\struct cfg ** \brief ci2c bus parameters **/ struct { I2C_SPEED speed; //!< i2c bus speed uint8_t retries; //!< i2c message retries when fail uint16_t timeout; //!< i2c timeout (ms) } cfg; uint16_t start_wait; //!< time start waiting for acknowledge bool busy; //!< true if already busy (in case of interrupts implementation) } i2c = { { (I2C_SPEED) 0, DEF_CI2C_NB_RETRIES, DEF_CI2C_TIMEOUT }, 0, false }; // Needed prototypes static bool I2C_wr(I2C_SLAVE * slave, const uint16_t reg_addr, uint8_t * data, const uint16_t bytes); static bool I2C_rd(I2C_SLAVE * slave, const uint16_t reg_addr, uint8_t * data, const uint16_t bytes); /*!\brief Init an I2C slave structure for cMI2C communication ** \param [in] slave - pointer to the I2C slave structure to init ** \param [in] sl_addr - I2C slave address ** \param [in] reg_sz - internal register map size ** \return nothing **/ void I2C_slave_init(I2C_SLAVE * slave, const uint8_t sl_addr, const I2C_INT_SIZE reg_sz) { (void) I2C_slave_set_addr(slave, sl_addr); (void) I2C_slave_set_reg_size(slave, reg_sz); I2C_slave_set_rw_func(slave, (ci2c_fct_ptr) I2C_wr, I2C_WRITE); I2C_slave_set_rw_func(slave, (ci2c_fct_ptr) I2C_rd, I2C_READ); slave->reg_addr = (uint16_t) -1; // To be sure to send address on first access (warning: unless last 16b byte address is accessed alone) slave->status = I2C_OK; } /*!\brief Redirect slave I2C read/write function (if needed for advanced use) ** \param [in] slave - pointer to the I2C slave structure to init ** \param [in] func - pointer to read/write function to affect ** \param [in] rw - 0 = write function, 1 = read function ** \return nothing **/ void I2C_slave_set_rw_func(I2C_SLAVE * slave, const ci2c_fct_ptr func, const I2C_RW rw) { ci2c_fct_ptr * pfc = (ci2c_fct_ptr*) (rw ? &slave->cfg.rd : &slave->cfg.wr); *pfc = func; } /*!\brief Change I2C slave address ** \param [in, out] slave - pointer to the I2C slave structure to init ** \param [in] sl_addr - I2C slave address ** \return true if new address set (false if address is >7Fh) **/ bool I2C_slave_set_addr(I2C_SLAVE * slave, const uint8_t sl_addr) { if (sl_addr > 0x7F) { return false; } slave->cfg.addr = sl_addr; return true; } /*!\brief Change I2C registers map size (for access) ** \param [in, out] slave - pointer to the I2C slave structure ** \param [in] reg_sz - internal register map size ** \return true if new size is correct (false otherwise and set to 16bit by default) **/ bool I2C_slave_set_reg_size(I2C_SLAVE * slave, const I2C_INT_SIZE reg_sz) { slave->cfg.reg_size = reg_sz > I2C_16B_REG ? I2C_16B_REG : reg_sz; return !(reg_sz > I2C_16B_REG); } /*!\brief Set I2C current register address ** \attribute inline ** \param [in, out] slave - pointer to the I2C slave structure ** \param [in] reg_addr - register address ** \return nothing **/ static inline void __attribute__((__always_inline__)) I2C_slave_set_reg_addr(I2C_SLAVE * slave, const uint16_t reg_addr) { slave->reg_addr = reg_addr; } /*!\brief Enable I2c module on arduino board (including pull-ups, * enabling of ACK, and setting clock frequency) ** \attribute inline ** \param [in] speed - I2C bus speed in KHz ** \return nothing **/ void I2C_init(const uint16_t speed) { Wire.begin(); I2C_set_speed(speed); } /*!\brief Change I2C frequency ** \param [in] speed - I2C speed in kHz (max 3.4MHz) ** \return Configured bus speed **/ uint16_t I2C_set_speed(const uint16_t speed) { #if defined(__TINY__) i2c.cfg.speed = I2C_STD; // Can't change I2C speed through Wire.setClock on TINY platforms #else #if defined(__AVR__) i2c.cfg.speed = (I2C_SPEED) ((speed == 0) ? (uint16_t) I2C_STD : ((speed > (uint16_t) I2C_FM) ? (uint16_t) I2C_FM : speed)); // Up to 400KHz on AVR #else i2c.cfg.speed = (I2C_SPEED) ((speed == 0) ? (uint16_t) I2C_STD : ((speed > (uint16_t) I2C_HS) ? (uint16_t) I2C_FMP : speed)); #endif Wire.setClock(speed * 1000); #endif return i2c.cfg.speed; } /*!\brief Change I2C ack timeout ** \param [in] timeout - I2C ack timeout (500 ms max) ** \return Configured timeout **/ uint16_t I2C_set_timeout(const uint16_t timeout) { static const uint16_t max_timeout = 500; i2c.cfg.timeout = (timeout > max_timeout) ? max_timeout : timeout; return i2c.cfg.timeout; } /*!\brief Change I2C message retries (in case of failure) ** \param [in] retries - I2C number of retries (max of 8) ** \return Configured number of retries **/ uint8_t I2C_set_retries(const uint8_t retries) { static const uint16_t max_retries = 8; i2c.cfg.retries = (retries > max_retries) ? max_retries : retries; return i2c.cfg.retries; } /*!\brief Get I2C busy status ** \return true if busy **/ bool I2C_is_busy(void) { return i2c.busy; } /*!\brief This function reads or writes the provided data to/from the address specified. * If anything in the write process is not successful, then it will be repeated * up till 3 more times (default). If still not successful, returns NACK ** \param [in, out] slave - pointer to the I2C slave structure to init ** \param [in] reg_addr - register address in register map ** \param [in] data - pointer to the first byte of a block of data to write ** \param [in] bytes - indicates how many bytes of data to write ** \param [in] rw - 0 = write, 1 = read operation ** \return I2C_STATUS status of write attempt **/ static I2C_STATUS I2C_comm(I2C_SLAVE * slave, const uint16_t reg_addr, uint8_t * data, const uint16_t bytes, const I2C_RW rw) { uint8_t retry = i2c.cfg.retries; bool ack = false; ci2c_fct_ptr fc = (ci2c_fct_ptr) (rw ? slave->cfg.rd : slave->cfg.wr); if (I2C_is_busy()) { return slave->status = I2C_BUSY; } i2c.busy = true; ack = fc(slave, reg_addr, data, bytes); while ((!ack) && (retry != 0)) // If com not successful, retry some more times { delay(1); ack = fc(slave, reg_addr, data, bytes); retry--; } i2c.busy = false; return slave->status = ack ? I2C_OK : I2C_NACK; } /*!\brief This function writes the provided data to the address specified. ** \param [in, out] slave - pointer to the I2C slave structure ** \param [in] reg_addr - register address in register map ** \param [in] data - pointer to the first byte of a block of data to write ** \param [in] bytes - indicates how many bytes of data to write ** \return I2C_STATUS status of write attempt **/ I2C_STATUS I2C_write(I2C_SLAVE * slave, const uint16_t reg_addr, uint8_t * data, const uint16_t bytes) { return I2C_comm(slave, reg_addr, data, bytes, I2C_WRITE); } /*!\brief This function reads data from the address specified and stores this * data in the area provided by the pointer. ** \param [in, out] slave - pointer to the I2C slave structure ** \param [in] reg_addr - register address in register map ** \param [in, out] data - pointer to the first byte of a block of data to read ** \param [in] bytes - indicates how many bytes of data to read ** \return I2C_STATUS status of read attempt **/ I2C_STATUS I2C_read(I2C_SLAVE * slave, const uint16_t reg_addr, uint8_t * data, const uint16_t bytes) { return I2C_comm(slave, reg_addr, data, bytes, I2C_READ); } /*!\brief This procedure calls appropriate functions to perform a proper send transaction on I2C bus. ** \param [in, out] slave - pointer to the I2C slave structure ** \param [in] reg_addr - register address in register map ** \param [in] data - pointer to the first byte of a block of data to write ** \param [in] bytes - indicates how many bytes of data to write ** \return Boolean indicating success/fail of write attempt **/ static bool I2C_wr(I2C_SLAVE * slave, const uint16_t reg_addr, uint8_t * data, const uint16_t bytes) { if (bytes == 0) { return false; } Wire.beginTransmission(slave->cfg.addr); if ((slave->cfg.reg_size) && (reg_addr != slave->reg_addr)) // Don't send address if writing next { (void) I2C_slave_set_reg_addr(slave, reg_addr); if (slave->cfg.reg_size >= I2C_16B_REG) // if size >2, 16bit address is used { if (Wire.write((uint8_t) (reg_addr >> 8)) == 0) { return false; } } if (Wire.write((uint8_t) reg_addr) == 0) { return false; } } for (uint16_t cnt = 0; cnt < bytes; cnt++) { if (Wire.write(*data++) == 0) { return false; } slave->reg_addr++; } if (Wire.endTransmission() != 0) { return false; } return true; } /*!\brief This procedure calls appropriate functions to perform a proper receive transaction on I2C bus. ** \param [in, out] slave - pointer to the I2C slave structure ** \param [in] reg_addr - register address in register map ** \param [in, out] data - pointer to the first byte of a block of data to read ** \param [in] bytes - indicates how many bytes of data to read ** \return Boolean indicating success/fail of read attempt **/ static bool I2C_rd(I2C_SLAVE * slave, const uint16_t reg_addr, uint8_t * data, const uint16_t bytes) { if (bytes == 0) { return false; } if ((slave->cfg.reg_size) && (reg_addr != slave->reg_addr)) // Don't send address if reading next { (void) I2C_slave_set_reg_addr(slave, reg_addr); Wire.beginTransmission(slave->cfg.addr); if (slave->cfg.reg_size >= I2C_16B_REG) // if size >2, 16bit address is used { if (Wire.write((uint8_t) (reg_addr >> 8)) == 0) { return false; } } if (Wire.write((uint8_t) reg_addr) == 0) { return false; } if (Wire.endTransmission(false) != 0) { return false; } } if (Wire.requestFrom((int) slave->cfg.addr, (int) bytes) == 0) { return false; } for (uint16_t cnt = 0; cnt < bytes; cnt++) { *data++ = Wire.read(); slave->reg_addr++; } return true; }
36.541219
172
0.699559
[ "vector" ]
414a4f2afa17f347fa31062956975554d60b9ce5
1,022
cc
C++
src/poc/rgbbg.cc
grendello/notcursespp
bc04b1445c7e50fc3cb7b3c7f0fc15b8781d2f31
[ "BSD-3-Clause" ]
null
null
null
src/poc/rgbbg.cc
grendello/notcursespp
bc04b1445c7e50fc3cb7b3c7f0fc15b8781d2f31
[ "BSD-3-Clause" ]
null
null
null
src/poc/rgbbg.cc
grendello/notcursespp
bc04b1445c7e50fc3cb7b3c7f0fc15b8781d2f31
[ "BSD-3-Clause" ]
1
2020-02-13T02:00:06.000Z
2020-02-13T02:00:06.000Z
#include <config.hh> #include <cstdio> #include <cstdlib> #include <clocale> #include <iostream> #include <ncpp/NotCurses.hh> using namespace ncpp; int main (void) { if (!setlocale (LC_ALL, "")) { std::cerr << "Couldn't set locale" << std::endl; return EXIT_FAILURE; } NotCurses::default_notcurses_options.inhibit_alternate_screen = true; NotCurses &nc = NotCurses::get_instance (); nc.init (); if (!nc) { return EXIT_FAILURE; } int y, x, dimy, dimx; Plane *n = nc.get_stdplane (); n->get_dim (&dimy, &dimx); int r , g, b; r = 0; g = 0x80; b = 0; n->set_fg_rgb (0x40, 0x20, 0x40); for (y = 0 ; y < dimy ; ++y) { for (x = 0 ; x < dimx ; ++x) { if (!n->set_bg_rgb (r, g, b)) { goto err; } if (n->putc ('x') <= 0) { goto err; } if (g % 2) { if (--b <= 0) { ++g; b = 0; } } else { if (++b >= 256) { ++g; b = 255; } } } } if (!nc.render ()) { return EXIT_FAILURE; } return EXIT_SUCCESS; err: return EXIT_FAILURE; }
15.029412
70
0.53816
[ "render" ]
414cf77574c30629f3714d6080f718a96a209581
14,433
cpp
C++
dsp_rubberband.cpp
ptytb/foo_dsp_effect
54ef8067b3e04b27af5f34df7f7657679a5d9dde
[ "MIT" ]
null
null
null
dsp_rubberband.cpp
ptytb/foo_dsp_effect
54ef8067b3e04b27af5f34df7f7657679a5d9dde
[ "MIT" ]
null
null
null
dsp_rubberband.cpp
ptytb/foo_dsp_effect
54ef8067b3e04b27af5f34df7f7657679a5d9dde
[ "MIT" ]
1
2020-12-21T03:36:24.000Z
2020-12-21T03:36:24.000Z
#define _WIN32_WINNT 0x0501 #include "../SDK/foobar2000.h" #include "../ATLHelpers/ATLHelpers.h" #include "resource.h" #include "rubberband/rubberband/RubberBandStretcher.h" #include "circular_buffer.h" using namespace RubberBand; static void RunDSPConfigPopup( const dsp_preset & p_data, HWND p_parent, dsp_preset_edit_callback & p_callback ); #define BUFFER_SIZE 2048 class dsp_pitch : public dsp_impl_base { unsigned buffered; bool st_enabled; int m_rate, m_ch, m_ch_mask; float pitch_amount; circular_buffer<float>sample_buffer; pfc::array_t<float>samplebuf; RubberBandStretcher * rubber; float **plugbuf; float **m_scratch; private: void insert_chunks() { while(1) { t_size samples = rubber->available(); if (samples <= 0)break; samples = rubber->retrieve(m_scratch,samples); if (samples > 0) { float *data = samplebuf.get_ptr(); for (int c = 0; c < m_ch; ++c) { int j = 0; while (j < samples) { data[j * m_ch + c] = m_scratch[c][j]; ++j; } } audio_chunk * chunk = insert_chunk(samples*m_ch); chunk->set_data(data,samples,m_ch,m_rate); } } } public: dsp_pitch( dsp_preset const & in ) : pitch_amount(0.00), m_rate( 0 ), m_ch( 0 ), m_ch_mask( 0 ) { buffered=0; rubber = 0; plugbuf = NULL; parse_preset( pitch_amount, in ); st_enabled = true; } ~dsp_pitch(){ if (rubber) { insert_chunks(); } if (rubber) delete rubber; if (plugbuf) { for (int c = 0; c < m_ch; ++c) delete[] plugbuf[c]; delete[] plugbuf; } if (m_scratch) { for (int c = 0; c < m_ch; ++c) delete[] m_scratch[c]; delete[] m_scratch; } rubber = 0; } // Every DSP type is identified by a GUID. static GUID g_get_guid() { // Create these with guidgen.exe. // {A7FBA855-56D4-46AC-8116-8B2A8DF2FB34} static const GUID guid = { 0xabc792be, 0x276, 0x47bf, { 0xb2, 0x41, 0x7a, 0xcf, 0xc5, 0x21, 0xcb, 0x50 } }; return guid; } static void g_get_name(pfc::string_base & p_out) { p_out = "Pitch Shift (Rubber band)"; } virtual void on_endoftrack(abort_callback & p_abort) { if (rubber) { insert_chunks(); } } virtual void on_endofplayback(abort_callback & p_abort) { if (rubber) { insert_chunks(); } } // The framework feeds input to our DSP using this method. // Each chunk contains a number of samples with the same // stream characteristics, i.e. same sample rate, channel count // and channel configuration. virtual bool on_chunk(audio_chunk * chunk, abort_callback & p_abort) { t_size sample_count = chunk->get_sample_count(); audio_sample * src = chunk->get_data(); if (chunk->get_srate() != m_rate || chunk->get_channels() != m_ch || chunk->get_channel_config() != m_ch_mask) { m_rate = chunk->get_srate(); m_ch = chunk->get_channels(); m_ch_mask = chunk->get_channel_config(); RubberBandStretcher::Options options = RubberBandStretcher::DefaultOptions; options |= RubberBandStretcher::OptionProcessRealTime | RubberBandStretcher::OptionPitchHighQuality; if (rubber) delete rubber; if (plugbuf) { for (int c = 0; c < m_ch; ++c) delete[] plugbuf[c]; delete[] plugbuf; } if (m_scratch) { for (int c = 0; c < m_ch; ++c) delete[] m_scratch[c]; delete[] m_scratch; } rubber = new RubberBandStretcher(m_rate,m_ch,options,1.0, pow(2.0, pitch_amount / 12.0)); if (!rubber) return 0; sample_buffer.set_size(BUFFER_SIZE*m_ch); samplebuf.grow_size(BUFFER_SIZE*m_ch); if(plugbuf)delete plugbuf; plugbuf = new float*[m_ch]; m_scratch = new float*[m_ch]; for (int c = 0; c < m_ch; ++c) plugbuf[c] = new float[BUFFER_SIZE]; for (int c = 0; c < m_ch; ++c) m_scratch[c] = new float[BUFFER_SIZE]; st_enabled = true; } if (!st_enabled) return true; while (sample_count > 0) { int toCauseProcessing = rubber->getSamplesRequired(); int todo = min(toCauseProcessing - buffered, sample_count); sample_buffer.write(src,todo*m_ch); src += todo * m_ch; buffered += todo; sample_count -= todo; if (buffered ==toCauseProcessing) { float*data = samplebuf.get_ptr(); sample_buffer.read((float*)data, toCauseProcessing*m_ch); for (int c = 0; c < m_ch; ++c) { int j = 0; while (j < toCauseProcessing) { plugbuf[c][j] = data[j * m_ch + c]; ++j; } } rubber->process(plugbuf, toCauseProcessing,false); insert_chunks(); buffered = 0; } } return false; } virtual void flush() { { if (rubber) { insert_chunks(); } } m_rate = 0; m_ch = 0; buffered = 0; m_ch_mask = 0; } virtual double get_latency() { return (rubber && m_rate && st_enabled) ? ((double)(rubber->getLatency()) / (double)m_rate) : 0; } virtual bool need_track_change_mark() { return false; } static bool g_get_default_preset( dsp_preset & p_out ) { make_preset( 0.0, p_out ); return true; } static void g_show_config_popup( const dsp_preset & p_data, HWND p_parent, dsp_preset_edit_callback & p_callback ) { ::RunDSPConfigPopup( p_data, p_parent, p_callback ); } static bool g_have_config_popup() { return true; } static void make_preset( float pitch, dsp_preset & out ) { dsp_preset_builder builder; builder << pitch; builder.finish( g_get_guid(), out ); } static void parse_preset(float & pitch, const dsp_preset & in) { try { dsp_preset_parser parser(in); parser >> pitch; } catch(exception_io_data) {pitch = 0.0;} } }; class CMyDSPPopupPitch : public CDialogImpl<CMyDSPPopupPitch> { public: CMyDSPPopupPitch( const dsp_preset & initData, dsp_preset_edit_callback & callback ) : m_initData( initData ), m_callback( callback ) { } enum { IDD = IDD_PITCH }; enum { pitchmin = 0, pitchmax = 4800 }; BEGIN_MSG_MAP( CMyDSPPopup ) MSG_WM_INITDIALOG( OnInitDialog ) COMMAND_HANDLER_EX( IDOK, BN_CLICKED, OnButton ) COMMAND_HANDLER_EX( IDCANCEL, BN_CLICKED, OnButton ) MSG_WM_HSCROLL( OnHScroll ) END_MSG_MAP() private: BOOL OnInitDialog(CWindow, LPARAM) { slider_drytime = GetDlgItem(IDC_PITCH); slider_drytime.SetRange(0, pitchmax); { float pitch = 0.0; dsp_pitch::parse_preset(pitch, m_initData); pitch *= 100.00; slider_drytime.SetPos( (double)(pitch+2400)); RefreshLabel( pitch/100.00); } return TRUE; } void OnButton( UINT, int id, CWindow ) { EndDialog( id ); } void OnHScroll( UINT nSBCode, UINT nPos, CScrollBar pScrollBar ) { float pitch; pitch = slider_drytime.GetPos()-2400; pitch /= 100.00; { dsp_preset_impl preset; dsp_pitch::make_preset(pitch, preset ); m_callback.on_preset_changed( preset ); } RefreshLabel( pitch); } void RefreshLabel(float pitch ) { pfc::string_formatter msg; msg << "Pitch: "; msg << (pitch < 0 ? "" : "+"); msg << pfc::format_float(pitch,0,2) << " semitones"; ::uSetDlgItemText( *this, IDC_PITCHINFO, msg ); msg.reset(); } const dsp_preset & m_initData; // modal dialog so we can reference this caller-owned object. dsp_preset_edit_callback & m_callback; CTrackBarCtrl slider_drytime,slider_wettime,slider_dampness,slider_roomwidth,slider_roomsize; }; static void RunDSPConfigPopup( const dsp_preset & p_data, HWND p_parent, dsp_preset_edit_callback & p_callback ) { CMyDSPPopupPitch popup( p_data, p_callback ); if ( popup.DoModal(p_parent) != IDOK ) p_callback.on_preset_changed( p_data ); } static void RunDSPConfigPopupTempo(const dsp_preset & p_data, HWND p_parent, dsp_preset_edit_callback & p_callback); class dsp_tempo : public dsp_impl_base { RubberBandStretcher * rubber; int m_rate, m_ch, m_ch_mask; float pitch_amount; circular_buffer<float>sample_buffer; pfc::array_t<float>samplebuf; float **plugbuf; float **m_scratch; unsigned buffered; bool st_enabled; private: void insert_chunks() { while (1) { t_size samples = rubber->available(); if (samples <= 0)break; samples = rubber->retrieve(m_scratch, samples); if (samples > 0) { float *data = samplebuf.get_ptr(); for (int c = 0; c < m_ch; ++c) { int j = 0; while (j < samples) { data[j * m_ch + c] = m_scratch[c][j]; ++j; } } audio_chunk * chunk = insert_chunk(samples*m_ch); chunk->set_data(data, samples, m_ch, m_rate); } } } public: dsp_tempo(dsp_preset const & in) : pitch_amount(0.00), m_rate(0), m_ch(0), m_ch_mask(0) { buffered = 0; rubber = 0; plugbuf = NULL; m_scratch = NULL; parse_preset(pitch_amount, in); st_enabled = true; } ~dsp_tempo() { if (rubber) delete rubber; rubber = 0; } // Every DSP type is identified by a GUID. static GUID g_get_guid() { // Create these with guidgen.exe. // {AA3815D8-AAF8-4BE7-97E5-554452DA5776} static const GUID guid = { 0xaa3815d8, 0xaaf8, 0x4be7,{ 0x97, 0xe5, 0x55, 0x44, 0x52, 0xda, 0x57, 0x76 } }; return guid; } static void g_get_name(pfc::string_base & p_out) { p_out = "Tempo Shift (Rubber band)"; } virtual void on_endoftrack(abort_callback & p_abort) { if (rubber) { insert_chunks(); } } virtual void on_endofplayback(abort_callback & p_abort) { if (rubber) { insert_chunks(); } } // The framework feeds input to our DSP using this method. // Each chunk contains a number of samples with the same // stream characteristics, i.e. same sample rate, channel count // and channel configuration. virtual bool on_chunk(audio_chunk * chunk, abort_callback & p_abort) { t_size sample_count = chunk->get_sample_count(); audio_sample * src = chunk->get_data(); if (chunk->get_srate() != m_rate || chunk->get_channels() != m_ch || chunk->get_channel_config() != m_ch_mask) { m_rate = chunk->get_srate(); m_ch = chunk->get_channels(); m_ch_mask = chunk->get_channel_config(); RubberBandStretcher::Options options = RubberBandStretcher::DefaultOptions; options |= RubberBandStretcher::OptionProcessRealTime | RubberBandStretcher::OptionPitchHighQuality; if (rubber) delete rubber; if (plugbuf) { for (int c = 0; c < m_ch; ++c) delete[] plugbuf[c]; delete[] plugbuf; } if (m_scratch) { for (int c = 0; c < m_ch; ++c) delete[] m_scratch[c]; delete[] m_scratch; } rubber = new RubberBandStretcher(m_rate, m_ch, options, 1.0 + 0.01 *-pitch_amount, 1.0); if (!rubber) return 0; sample_buffer.set_size(BUFFER_SIZE*m_ch); samplebuf.grow_size(BUFFER_SIZE*m_ch); if (plugbuf)delete plugbuf; plugbuf = new float*[m_ch]; m_scratch = new float*[m_ch]; for (int c = 0; c < m_ch; ++c) plugbuf[c] = new float[BUFFER_SIZE]; for (int c = 0; c < m_ch; ++c) m_scratch[c] = new float[BUFFER_SIZE]; st_enabled = true; // if (pitch_amount== 0)st_enabled = false; bool usequickseek = false; bool useaafilter = false; //seems clearer without it } if (!st_enabled) return true; while (sample_count > 0) { int toCauseProcessing = rubber->getSamplesRequired(); int todo = min(toCauseProcessing - buffered, sample_count); sample_buffer.write(src, todo*m_ch); src += todo * m_ch; buffered += todo; sample_count -= todo; if (buffered >= toCauseProcessing) { float*data = samplebuf.get_ptr(); sample_buffer.read((float*)data, toCauseProcessing*m_ch); for (int c = 0; c < m_ch; ++c) { int j = 0; while (j < toCauseProcessing) { plugbuf[c][j] = data[j * m_ch + c]; ++j; } } rubber->process(plugbuf, toCauseProcessing, false); insert_chunks(); buffered = 0; } } return false; } virtual void flush() { m_rate = 0; m_ch = 0; buffered = 0; m_ch_mask = 0; } virtual double get_latency() { return (rubber && m_rate && st_enabled) ? ((double)(rubber->getLatency()) / (double)m_rate) : 0; } virtual bool need_track_change_mark() { return false; } static bool g_get_default_preset(dsp_preset & p_out) { make_preset(0.0, p_out); return true; } static void g_show_config_popup(const dsp_preset & p_data, HWND p_parent, dsp_preset_edit_callback & p_callback) { ::RunDSPConfigPopupTempo(p_data, p_parent, p_callback); } static bool g_have_config_popup() { return true; } static void make_preset(float pitch, dsp_preset & out) { dsp_preset_builder builder; builder << pitch; builder.finish(g_get_guid(), out); } static void parse_preset(float & pitch, const dsp_preset & in) { try { dsp_preset_parser parser(in); parser >> pitch; } catch (exception_io_data) { pitch = 0.0; } } }; class CMyDSPPopupTempo : public CDialogImpl<CMyDSPPopupTempo> { public: CMyDSPPopupTempo(const dsp_preset & initData, dsp_preset_edit_callback & callback) : m_initData(initData), m_callback(callback) { } enum { IDD = IDD_TEMPO }; enum { pitchmin = 0, pitchmax = 150 }; BEGIN_MSG_MAP(CMyDSPPopup) MSG_WM_INITDIALOG(OnInitDialog) COMMAND_HANDLER_EX(IDOK, BN_CLICKED, OnButton) COMMAND_HANDLER_EX(IDCANCEL, BN_CLICKED, OnButton) MSG_WM_HSCROLL(OnHScroll) END_MSG_MAP() private: BOOL OnInitDialog(CWindow, LPARAM) { slider_drytime = GetDlgItem(IDC_TEMPO); slider_drytime.SetRange(0, pitchmax); { float pitch; dsp_tempo::parse_preset(pitch, m_initData); slider_drytime.SetPos((double)(pitch + 50)); RefreshLabel(pitch); } return TRUE; } void OnButton(UINT, int id, CWindow) { EndDialog(id); } void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar) { float pitch; pitch = slider_drytime.GetPos() - 50; { dsp_preset_impl preset; dsp_tempo::make_preset(pitch, preset); m_callback.on_preset_changed(preset); } RefreshLabel(pitch); } void RefreshLabel(float pitch) { pfc::string_formatter msg; msg << "Tempo: "; msg << (pitch < 0 ? "" : "+"); msg << pfc::format_int(pitch) << "%"; ::uSetDlgItemText(*this, IDC_TEMPOINFO, msg); msg.reset(); } const dsp_preset & m_initData; // modal dialog so we can reference this caller-owned object. dsp_preset_edit_callback & m_callback; CTrackBarCtrl slider_drytime, slider_wettime, slider_dampness, slider_roomwidth, slider_roomsize; }; static void RunDSPConfigPopupTempo(const dsp_preset & p_data, HWND p_parent, dsp_preset_edit_callback & p_callback) { CMyDSPPopupTempo popup(p_data, p_callback); if (popup.DoModal(p_parent) != IDOK) p_callback.on_preset_changed(p_data); } static dsp_factory_t<dsp_pitch> g_dsp_pitch_factory; static dsp_factory_t<dsp_tempo> g_dsp_tempo_factory;
25.188482
138
0.675882
[ "object" ]
4150e8e06c1aba30f38bb30545f1e5fff0f3857e
40,905
cxx
C++
main/vcl/source/gdi/bitmapex.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
679
2015-01-06T06:34:58.000Z
2022-03-30T01:06:03.000Z
main/vcl/source/gdi/bitmapex.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
102
2017-11-07T08:51:31.000Z
2022-03-17T12:13:49.000Z
main/vcl/source/gdi/bitmapex.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
331
2015-01-06T11:40:55.000Z
2022-03-14T04:07:51.000Z
/************************************************************** * * 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. * *************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" #include <ctype.h> #include <rtl/crc.h> #include <tools/stream.hxx> #include <tools/debug.hxx> #include <tools/rc.h> #include <vcl/salbtype.hxx> #include <vcl/outdev.hxx> #include <vcl/alpha.hxx> #include <vcl/bitmapex.hxx> #include <vcl/pngread.hxx> #include <vcl/svapp.hxx> #include <vcl/bmpacc.hxx> #include <vcl/dibtools.hxx> #include <image.h> #include <impimagetree.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> // ------------ // - BitmapEx - // ------------ BitmapEx::BitmapEx() : eTransparent( TRANSPARENT_NONE ), bAlpha ( sal_False ) { } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx ) : aBitmap ( rBitmapEx.aBitmap ), aMask ( rBitmapEx.aMask ), aBitmapSize ( rBitmapEx.aBitmapSize ), aTransparentColor ( rBitmapEx.aTransparentColor ), eTransparent ( rBitmapEx.eTransparent ), bAlpha ( rBitmapEx.bAlpha ) { } BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) : eTransparent( TRANSPARENT_NONE ), bAlpha ( sal_False ) { if( rBitmapEx.IsEmpty() ) return; aBitmap = Bitmap( aSize, rBitmapEx.aBitmap.GetBitCount() ); aBitmapSize = aSize; if( rBitmapEx.IsAlpha() ) { bAlpha = sal_True; aMask = AlphaMask( aSize ).ImplGetBitmap(); } else if( rBitmapEx.IsTransparent() ) aMask = Bitmap( aSize, rBitmapEx.aMask.GetBitCount() ); Rectangle aDestRect( Point( 0, 0 ), aSize ); Rectangle aSrcRect( aSrc, aSize ); CopyPixel( aDestRect, aSrcRect, &rBitmapEx ); } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const ResId& rResId ) : eTransparent( TRANSPARENT_NONE ), bAlpha ( sal_False ) { static ImplImageTreeSingletonRef aImageTree; ResMgr* pResMgr = NULL; ResMgr::GetResourceSkipHeader( rResId.SetRT( RSC_BITMAP ), &pResMgr ); pResMgr->ReadLong(); pResMgr->ReadLong(); const String aFileName( pResMgr->ReadString() ); ::rtl::OUString aCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName(); if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this ) ) { #ifdef DBG_UTIL ByteString aErrorStr( "BitmapEx::BitmapEx( const ResId& rResId ): could not load image <" ); DBG_ERROR( ( ( aErrorStr += ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ) ) += '>' ).GetBuffer() ); #endif } } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp ) : aBitmap ( rBmp ), aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent( TRANSPARENT_NONE ), bAlpha ( sal_False ) { } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : aBitmap ( rBmp ), aMask ( rMask ), aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), bAlpha ( sal_False ) { if(!!aBitmap && !!aMask && aBitmap.GetSizePixel() != aMask.GetSizePixel()) { OSL_ENSURE(false, "Mask size differs from Bitmap size, corrected Mask (!)"); aMask.Scale(aBitmap.GetSizePixel()); } // #105489# Ensure a mask is exactly one bit deep if( !!aMask && aMask.GetBitCount() != 1 ) { OSL_TRACE("BitmapEx: forced mask to monochrome"); aMask.ImplMakeMono( 255 ); } } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : aBitmap ( rBmp ), aMask ( rAlphaMask.ImplGetBitmap() ), aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), bAlpha ( !rAlphaMask ? sal_False : sal_True ) { if(!!aBitmap && !!aMask && aBitmap.GetSizePixel() != aMask.GetSizePixel()) { OSL_ENSURE(false, "Alpha size differs from Bitmap size, corrected Mask (!)"); aMask.Scale(rBmp.GetSizePixel()); } // #i75531# the workaround below can go when // X11SalGraphics::drawAlphaBitmap()'s render acceleration // can handle the bitmap depth mismatch directly if( aBitmap.GetBitCount() < aMask.GetBitCount() ) aBitmap.Convert( BMP_CONVERSION_24BIT ); } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) : aBitmap ( rBmp ), aBitmapSize ( aBitmap.GetSizePixel() ), aTransparentColor ( rTransparentColor ), eTransparent ( TRANSPARENT_BITMAP ), bAlpha ( sal_False ) { aMask = aBitmap.CreateMask( aTransparentColor ); DBG_ASSERT( rBmp.GetSizePixel() == aMask.GetSizePixel(), "BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask." ); } // ------------------------------------------------------------------ BitmapEx::~BitmapEx() { } // ------------------------------------------------------------------ // ------------------------------------------------------------------ BitmapEx& BitmapEx::operator=( const BitmapEx& rBitmapEx ) { if( &rBitmapEx != this ) { aBitmap = rBitmapEx.aBitmap; aMask = rBitmapEx.aMask; aBitmapSize = rBitmapEx.aBitmapSize; aTransparentColor = rBitmapEx.aTransparentColor; eTransparent = rBitmapEx.eTransparent; bAlpha = rBitmapEx.bAlpha; } return *this; } // ------------------------------------------------------------------ sal_Bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const { if( eTransparent != rBitmapEx.eTransparent ) return sal_False; if( aBitmap != rBitmapEx.aBitmap ) return sal_False; if( aBitmapSize != rBitmapEx.aBitmapSize ) return sal_False; if( eTransparent == TRANSPARENT_NONE ) return sal_True; if( eTransparent == TRANSPARENT_COLOR ) return aTransparentColor == rBitmapEx.aTransparentColor; return( ( aMask == rBitmapEx.aMask ) && ( bAlpha == rBitmapEx.bAlpha ) ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const { return( rBmpEx.eTransparent == eTransparent && rBmpEx.bAlpha == bAlpha && rBmpEx.aBitmap.IsEqual( aBitmap ) && rBmpEx.aMask.IsEqual( aMask ) ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::IsEmpty() const { return( aBitmap.IsEmpty() && aMask.IsEmpty() ); } // ------------------------------------------------------------------ void BitmapEx::SetEmpty() { aBitmap.SetEmpty(); aMask.SetEmpty(); eTransparent = TRANSPARENT_NONE; bAlpha = sal_False; } // ------------------------------------------------------------------ void BitmapEx::Clear() { SetEmpty(); } // ------------------------------------------------------------------ sal_Bool BitmapEx::IsTransparent() const { return( eTransparent != TRANSPARENT_NONE ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::IsAlpha() const { return( IsTransparent() && bAlpha ); } // ------------------------------------------------------------------ Bitmap BitmapEx::GetBitmap( const Color* pTransReplaceColor ) const { Bitmap aRetBmp( aBitmap ); if( pTransReplaceColor && ( eTransparent != TRANSPARENT_NONE ) ) { Bitmap aTempMask; if( eTransparent == TRANSPARENT_COLOR ) aTempMask = aBitmap.CreateMask( aTransparentColor ); else aTempMask = aMask; if( !IsAlpha() ) aRetBmp.Replace( aTempMask, *pTransReplaceColor ); else aRetBmp.Replace( GetAlpha(), *pTransReplaceColor ); } return aRetBmp; } // ------------------------------------------------------------------ BitmapEx BitmapEx::GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const { BitmapEx aRet; if( BMP_COLOR_HIGHCONTRAST == eColorMode ) { aRet = *this; aRet.aBitmap = aBitmap.GetColorTransformedBitmap( eColorMode ); } else if( BMP_COLOR_MONOCHROME_BLACK == eColorMode || BMP_COLOR_MONOCHROME_WHITE == eColorMode ) { aRet = *this; aRet.aBitmap = aRet.aBitmap.GetColorTransformedBitmap( eColorMode ); if( !aRet.aMask.IsEmpty() ) { aRet.aMask.CombineSimple( aRet.aBitmap, BMP_COMBINE_OR ); aRet.aBitmap.Erase( ( BMP_COLOR_MONOCHROME_BLACK == eColorMode ) ? COL_BLACK : COL_WHITE ); DBG_ASSERT( aRet.aBitmap.GetSizePixel() == aRet.aMask.GetSizePixel(), "BitmapEx::GetColorTransformedBitmapEx(): size mismatch for bitmap and alpha mask." ); } } return aRet; } // ------------------------------------------------------------------ Bitmap BitmapEx::GetMask() const { Bitmap aRet( aMask ); if( IsAlpha() ) aRet.ImplMakeMono( 255 ); return aRet; } // ------------------------------------------------------------------ AlphaMask BitmapEx::GetAlpha() const { AlphaMask aAlpha; if( IsAlpha() ) aAlpha.ImplSetBitmap( aMask ); else aAlpha = aMask; return aAlpha; } // ------------------------------------------------------------------ sal_uLong BitmapEx::GetSizeBytes() const { sal_uLong nSizeBytes = aBitmap.GetSizeBytes(); if( eTransparent == TRANSPARENT_BITMAP ) nSizeBytes += aMask.GetSizeBytes(); return nSizeBytes; } // ------------------------------------------------------------------ sal_uLong BitmapEx::GetChecksum() const { sal_uInt32 nCrc = aBitmap.GetChecksum(); SVBT32 aBT32; UInt32ToSVBT32( (long) eTransparent, aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); UInt32ToSVBT32( (long) bAlpha, aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); if( ( TRANSPARENT_BITMAP == eTransparent ) && !aMask.IsEmpty() ) { UInt32ToSVBT32( aMask.GetChecksum(), aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); } return nCrc; } // ------------------------------------------------------------------ void BitmapEx::SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag ) { if(GetSizePixel() != rNewSize) { Scale( rNewSize, nScaleFlag ); } } // ------------------------------------------------------------------ sal_Bool BitmapEx::Invert() { sal_Bool bRet = sal_False; if( !!aBitmap ) { bRet = aBitmap.Invert(); if( bRet && ( eTransparent == TRANSPARENT_COLOR ) ) aTransparentColor = BitmapColor( aTransparentColor ).Invert(); } return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::Mirror( sal_uLong nMirrorFlags ) { sal_Bool bRet = sal_False; if( !!aBitmap ) { bRet = aBitmap.Mirror( nMirrorFlags ); if( bRet && ( eTransparent == TRANSPARENT_BITMAP ) && !!aMask ) aMask.Mirror( nMirrorFlags ); } return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) { sal_Bool bRet = sal_False; if( !!aBitmap ) { bRet = aBitmap.Scale( rScaleX, rScaleY, nScaleFlag ); if( bRet && ( eTransparent == TRANSPARENT_BITMAP ) && !!aMask ) { aMask.Scale( rScaleX, rScaleY, nScaleFlag ); } aBitmapSize = aBitmap.GetSizePixel(); DBG_ASSERT( !aMask || aBitmap.GetSizePixel() == aMask.GetSizePixel(), "BitmapEx::Scale(): size mismatch for bitmap and alpha mask." ); } return bRet; } // ------------------------------------------------------------------------ sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag ) { sal_Bool bRet; if( aBitmapSize.Width() && aBitmapSize.Height() ) { bRet = Scale( (double) rNewSize.Width() / aBitmapSize.Width(), (double) rNewSize.Height() / aBitmapSize.Height(), nScaleFlag ); } else bRet = sal_True; return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor ) { sal_Bool bRet = sal_False; if( !!aBitmap ) { const sal_Bool bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor ); if( bTransRotate ) { if( eTransparent == TRANSPARENT_COLOR ) bRet = aBitmap.Rotate( nAngle10, aTransparentColor ); else { bRet = aBitmap.Rotate( nAngle10, COL_BLACK ); if( eTransparent == TRANSPARENT_NONE ) { aMask = Bitmap( aBitmapSize, 1 ); aMask.Erase( COL_BLACK ); eTransparent = TRANSPARENT_BITMAP; } if( bRet && !!aMask ) aMask.Rotate( nAngle10, COL_WHITE ); } } else { bRet = aBitmap.Rotate( nAngle10, rFillColor ); if( bRet && ( eTransparent == TRANSPARENT_BITMAP ) && !!aMask ) aMask.Rotate( nAngle10, COL_WHITE ); } aBitmapSize = aBitmap.GetSizePixel(); DBG_ASSERT( !aMask || aBitmap.GetSizePixel() == aMask.GetSizePixel(), "BitmapEx::Rotate(): size mismatch for bitmap and alpha mask." ); } return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::Crop( const Rectangle& rRectPixel ) { sal_Bool bRet = sal_False; if( !!aBitmap ) { bRet = aBitmap.Crop( rRectPixel ); if( bRet && ( eTransparent == TRANSPARENT_BITMAP ) && !!aMask ) aMask.Crop( rRectPixel ); aBitmapSize = aBitmap.GetSizePixel(); DBG_ASSERT( !aMask || aBitmap.GetSizePixel() == aMask.GetSizePixel(), "BitmapEx::Crop(): size mismatch for bitmap and alpha mask." ); } return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::Convert( BmpConversion eConversion ) { return( !!aBitmap ? aBitmap.Convert( eConversion ) : sal_False ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce ) { return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : sal_False ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor, sal_Bool bExpandTransparent ) { sal_Bool bRet = sal_False; if( !!aBitmap ) { bRet = aBitmap.Expand( nDX, nDY, pInitColor ); if( bRet && ( eTransparent == TRANSPARENT_BITMAP ) && !!aMask ) { Color aColor( bExpandTransparent ? COL_WHITE : COL_BLACK ); aMask.Expand( nDX, nDY, &aColor ); } aBitmapSize = aBitmap.GetSizePixel(); DBG_ASSERT( !aMask || aBitmap.GetSizePixel() == aMask.GetSizePixel(), "BitmapEx::Expand(): size mismatch for bitmap and alpha mask." ); } return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, const BitmapEx* pBmpExSrc ) { sal_Bool bRet = sal_False; if( !pBmpExSrc || pBmpExSrc->IsEmpty() ) { if( !aBitmap.IsEmpty() ) { bRet = aBitmap.CopyPixel( rRectDst, rRectSrc ); if( bRet && ( eTransparent == TRANSPARENT_BITMAP ) && !!aMask ) aMask.CopyPixel( rRectDst, rRectSrc ); } } else { if( !aBitmap.IsEmpty() ) { bRet = aBitmap.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aBitmap ); if( bRet ) { if( pBmpExSrc->IsAlpha() ) { if( IsAlpha() ) // cast to use the optimized AlphaMask::CopyPixel ((AlphaMask*) &aMask)->CopyPixel( rRectDst, rRectSrc, (AlphaMask*)&pBmpExSrc->aMask ); else if( IsTransparent() ) { AlphaMask* pAlpha = new AlphaMask( aMask ); aMask = pAlpha->ImplGetBitmap(); delete pAlpha; bAlpha = sal_True; aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask ); } else { sal_uInt8 cBlack = 0; AlphaMask* pAlpha = new AlphaMask( GetSizePixel(), &cBlack ); aMask = pAlpha->ImplGetBitmap(); delete pAlpha; eTransparent = TRANSPARENT_BITMAP; bAlpha = sal_True; aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask ); } } else if( pBmpExSrc->IsTransparent() ) { if( IsAlpha() ) { AlphaMask aAlpha( pBmpExSrc->aMask ); aMask.CopyPixel( rRectDst, rRectSrc, &aAlpha.ImplGetBitmap() ); } else if( IsTransparent() ) aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask ); else { aMask = Bitmap( GetSizePixel(), 1 ); aMask.Erase( Color( COL_BLACK ) ); eTransparent = TRANSPARENT_BITMAP; aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask ); } } else if( IsAlpha() ) { sal_uInt8 cBlack = 0; const AlphaMask aAlphaSrc( pBmpExSrc->GetSizePixel(), &cBlack ); aMask.CopyPixel( rRectDst, rRectSrc, &aAlphaSrc.ImplGetBitmap() ); } else if( IsTransparent() ) { Bitmap aMaskSrc( pBmpExSrc->GetSizePixel(), 1 ); aMaskSrc.Erase( Color( COL_BLACK ) ); aMask.CopyPixel( rRectDst, rRectSrc, &aMaskSrc ); } } } } return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::Erase( const Color& rFillColor ) { sal_Bool bRet = sal_False; if( !!aBitmap ) { bRet = aBitmap.Erase( rFillColor ); if( bRet && ( eTransparent == TRANSPARENT_BITMAP ) && !!aMask ) { // #104416# Respect transparency on fill color if( rFillColor.GetTransparency() ) { const Color aFill( rFillColor.GetTransparency(), rFillColor.GetTransparency(), rFillColor.GetTransparency() ); aMask.Erase( aFill ); } else { const Color aBlack( COL_BLACK ); aMask.Erase( aBlack ); } } } return bRet; } // ------------------------------------------------------------------ sal_Bool BitmapEx::Dither( sal_uLong nDitherFlags ) { return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : sal_False ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) { return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : sal_False ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols ) { return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (sal_uLong*) pTols ) : sal_False ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma, sal_Bool bInvert ) { return( !!aBitmap ? aBitmap.Adjust( nLuminancePercent, nContrastPercent, nChannelRPercent, nChannelGPercent, nChannelBPercent, fGamma, bInvert ) : sal_False ); } // ------------------------------------------------------------------ sal_Bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress ) { return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : sal_False ); } // ------------------------------------------------------------------ void BitmapEx::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const { pOutDev->DrawBitmapEx( rDestPt, *this ); } // ------------------------------------------------------------------ void BitmapEx::Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSize ) const { pOutDev->DrawBitmapEx( rDestPt, rDestSize, *this ); } // ------------------------------------------------------------------ void BitmapEx::Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel ) const { pOutDev->DrawBitmapEx( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, *this ); } // ------------------------------------------------------------------ sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const { sal_uInt8 nTransparency(0xff); if(!aBitmap.IsEmpty()) { if(nX >= 0 && nX < aBitmapSize.Width() && nY >= 0 && nY < aBitmapSize.Height()) { switch(eTransparent) { case TRANSPARENT_NONE: { // not transparent, ergo all covered nTransparency = 0x00; break; } case TRANSPARENT_COLOR: { Bitmap aTestBitmap(aBitmap); BitmapReadAccess* pRead = aTestBitmap.AcquireReadAccess(); if(pRead) { const Color aColor = pRead->GetColor(nY, nX); // if color is not equal to TransparentColor, we are not transparent if(aColor != aTransparentColor) { nTransparency = 0x00; } aTestBitmap.ReleaseAccess(pRead); } break; } case TRANSPARENT_BITMAP: { if(!aMask.IsEmpty()) { Bitmap aTestBitmap(aMask); BitmapReadAccess* pRead = aTestBitmap.AcquireReadAccess(); if(pRead) { const BitmapColor aBitmapColor(pRead->GetPixel(nY, nX)); if(bAlpha) { nTransparency = aBitmapColor.GetIndex(); } else { if(0x00 == aBitmapColor.GetIndex()) { nTransparency = 0x00; } } aTestBitmap.ReleaseAccess(pRead); } } break; } } } } return nTransparency; } // ------------------------------------------------------------------ namespace { Bitmap impTransformBitmap( const Bitmap& rSource, const Size aDestinationSize, const basegfx::B2DHomMatrix& rTransform, bool bSmooth) { Bitmap aDestination(aDestinationSize, 24); BitmapWriteAccess* pWrite = aDestination.AcquireWriteAccess(); if(pWrite) { //const Size aContentSizePixel(rSource.GetSizePixel()); BitmapReadAccess* pRead = (const_cast< Bitmap& >(rSource)).AcquireReadAccess(); if(pRead) { const Size aDestinationSizePixel(aDestination.GetSizePixel()); const BitmapColor aOutside(BitmapColor(0xff, 0xff, 0xff)); for(sal_Int32 y(0L); y < aDestinationSizePixel.getHeight(); y++) { for(sal_Int32 x(0L); x < aDestinationSizePixel.getWidth(); x++) { const basegfx::B2DPoint aSourceCoor(rTransform * basegfx::B2DPoint(x, y)); if(bSmooth) { pWrite->SetPixel( y, x, pRead->GetInterpolatedColorWithFallback( aSourceCoor.getY(), aSourceCoor.getX(), aOutside)); } else { // this version does the correct <= 0.0 checks, so no need // to do the static_cast< sal_Int32 > self and make an error pWrite->SetPixel( y, x, pRead->GetColorWithFallback( aSourceCoor.getY(), aSourceCoor.getX(), aOutside)); } } } delete pRead; } delete pWrite; } rSource.AdaptBitCount(aDestination); return aDestination; } } // end of anonymous namespace BitmapEx BitmapEx::TransformBitmapEx( double fWidth, double fHeight, const basegfx::B2DHomMatrix& rTransformation, bool bSmooth) const { if(fWidth <= 1 || fHeight <= 1) return BitmapEx(); // force destination to 24 bit, we want to smooth output const Size aDestinationSize(basegfx::fround(fWidth), basegfx::fround(fHeight)); const Bitmap aDestination(impTransformBitmap(GetBitmap(), aDestinationSize, rTransformation, bSmooth)); // create mask if(IsTransparent()) { if(IsAlpha()) { const Bitmap aAlpha(impTransformBitmap(GetAlpha().GetBitmap(), aDestinationSize, rTransformation, bSmooth)); return BitmapEx(aDestination, AlphaMask(aAlpha)); } else { const Bitmap aMask(impTransformBitmap(GetMask(), aDestinationSize, rTransformation, false)); return BitmapEx(aDestination, aMask); } } return BitmapEx(aDestination); } // ------------------------------------------------------------------ BitmapEx BitmapEx::getTransformed( const basegfx::B2DHomMatrix& rTransformation, const basegfx::B2DRange& rVisibleRange, double fMaximumArea, bool bSmooth) const { BitmapEx aRetval; if(IsEmpty()) return aRetval; const sal_uInt32 nSourceWidth(GetSizePixel().Width()); const sal_uInt32 nSourceHeight(GetSizePixel().Height()); if(!nSourceWidth || !nSourceHeight) return aRetval; // Get aOutlineRange basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0); aOutlineRange.transform(rTransformation); // create visible range from it by moving from relative to absolute basegfx::B2DRange aVisibleRange(rVisibleRange); aVisibleRange.transform( basegfx::tools::createScaleTranslateB2DHomMatrix( aOutlineRange.getRange(), aOutlineRange.getMinimum())); // get target size (which is visible range's size) double fWidth(aVisibleRange.getWidth()); double fHeight(aVisibleRange.getHeight()); if(fWidth < 1.0 || fHeight < 1.0) { return aRetval; } // test if discrete size (pixel) maybe too big and limit it const double fArea(fWidth * fHeight); const bool bNeedToReduce(basegfx::fTools::more(fArea, fMaximumArea)); double fReduceFactor(1.0); if(bNeedToReduce) { fReduceFactor = sqrt(fMaximumArea / fArea); fWidth *= fReduceFactor; fHeight *= fReduceFactor; } // Build complete transform from source pixels to target pixels. // Start by scaling from source pixel size to unit coordinates basegfx::B2DHomMatrix aTransform( basegfx::tools::createScaleB2DHomMatrix( 1.0 / nSourceWidth, 1.0 / nSourceHeight)); // multiply with given transform which leads from unit coordinates inside // aOutlineRange aTransform = rTransformation * aTransform; // subtract top-left of absolute VisibleRange aTransform.translate( -aVisibleRange.getMinX(), -aVisibleRange.getMinY()); // scale to target pixels (if needed) if(bNeedToReduce) { aTransform.scale(fReduceFactor, fReduceFactor); } // invert to get transformation from target pixel coordiates to source pixels aTransform.invert(); // create bitmap using source, destination and linear back-transformation aRetval = TransformBitmapEx(fWidth, fHeight, aTransform, bSmooth); return aRetval; } // ------------------------------------------------------------------ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorModifierStack) const { Bitmap aChangedBitmap(GetBitmap()); bool bDone(false); for(sal_uInt32 a(rBColorModifierStack.count()); a && !bDone; ) { const basegfx::BColorModifierSharedPtr& rModifier = rBColorModifierStack.getBColorModifier(--a); const basegfx::BColorModifier_replace* pReplace = dynamic_cast< const basegfx::BColorModifier_replace* >(rModifier.get()); if(pReplace) { // complete replace if(IsTransparent()) { // clear bitmap with dest color if(aChangedBitmap.GetBitCount() <= 8) { // do NOT use erase; for e.g. 8bit Bitmaps, the nearest color to the given // erase color is determined and used -> this may be different from what is // wanted here. Better create a new bitmap with the needed color explicitly BitmapReadAccess* pReadAccess = aChangedBitmap.AcquireReadAccess(); OSL_ENSURE(pReadAccess, "Got no Bitmap ReadAccess ?!?"); if(pReadAccess) { BitmapPalette aNewPalette(pReadAccess->GetPalette()); aNewPalette[0] = BitmapColor(Color(pReplace->getBColor())); aChangedBitmap = Bitmap( aChangedBitmap.GetSizePixel(), aChangedBitmap.GetBitCount(), &aNewPalette); delete pReadAccess; } } else { aChangedBitmap.Erase(Color(pReplace->getBColor())); } } else { // erase bitmap, caller will know to paint direct aChangedBitmap.SetEmpty(); } bDone = true; } else { BitmapWriteAccess* pContent = aChangedBitmap.AcquireWriteAccess(); if(pContent) { const double fConvertColor(1.0 / 255.0); if(pContent->HasPalette()) { const sal_uInt16 nCount(pContent->GetPaletteEntryCount()); for(sal_uInt16 a(0); a < nCount; a++) { const BitmapColor& rCol = pContent->GetPaletteColor(a); const basegfx::BColor aBSource( rCol.GetRed() * fConvertColor, rCol.GetGreen() * fConvertColor, rCol.GetBlue() * fConvertColor); const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource)); pContent->SetPaletteColor(a, BitmapColor(Color(aBDest))); } } else if(BMP_FORMAT_24BIT_TC_BGR == pContent->GetScanlineFormat()) { for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++) { Scanline pScan = pContent->GetScanline(y); for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++) { const basegfx::BColor aBSource( *(pScan + 2)* fConvertColor, *(pScan + 1) * fConvertColor, *pScan * fConvertColor); const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource)); *pScan++ = static_cast< sal_uInt8 >(aBDest.getBlue() * 255.0); *pScan++ = static_cast< sal_uInt8 >(aBDest.getGreen() * 255.0); *pScan++ = static_cast< sal_uInt8 >(aBDest.getRed() * 255.0); } } } else if(BMP_FORMAT_24BIT_TC_RGB == pContent->GetScanlineFormat()) { for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++) { Scanline pScan = pContent->GetScanline(y); for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++) { const basegfx::BColor aBSource( *pScan * fConvertColor, *(pScan + 1) * fConvertColor, *(pScan + 2) * fConvertColor); const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource)); *pScan++ = static_cast< sal_uInt8 >(aBDest.getRed() * 255.0); *pScan++ = static_cast< sal_uInt8 >(aBDest.getGreen() * 255.0); *pScan++ = static_cast< sal_uInt8 >(aBDest.getBlue() * 255.0); } } } else { for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++) { for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++) { const BitmapColor aBMCol(pContent->GetColor(y, x)); const basegfx::BColor aBSource( (double)aBMCol.GetRed() * fConvertColor, (double)aBMCol.GetGreen() * fConvertColor, (double)aBMCol.GetBlue() * fConvertColor); const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource)); pContent->SetPixel(y, x, BitmapColor(Color(aBDest))); } } } delete pContent; } } } if(aChangedBitmap.IsEmpty()) { return BitmapEx(); } else { if(IsTransparent()) { if(IsAlpha()) { return BitmapEx(aChangedBitmap, GetAlpha()); } else { return BitmapEx(aChangedBitmap, GetMask()); } } else { return BitmapEx(aChangedBitmap); } } } // ----------------------------------------------------------------------------- BitmapEx VCL_DLLPUBLIC createBlendFrame( const Size& rSize, sal_uInt8 nAlpha, Color aColorTopLeft, Color aColorBottomRight) { const sal_uInt32 nW(rSize.Width()); const sal_uInt32 nH(rSize.Height()); if(nW || nH) { Color aColTopRight(aColorTopLeft); Color aColBottomLeft(aColorTopLeft); const sal_uInt32 nDE(nW + nH); aColTopRight.Merge(aColorBottomRight, 255 - sal_uInt8((nW * 255) / nDE)); aColBottomLeft.Merge(aColorBottomRight, 255 - sal_uInt8((nH * 255) / nDE)); return createBlendFrame(rSize, nAlpha, aColorTopLeft, aColTopRight, aColorBottomRight, aColBottomLeft); } return BitmapEx(); } BitmapEx VCL_DLLPUBLIC createBlendFrame( const Size& rSize, sal_uInt8 nAlpha, Color aColorTopLeft, Color aColorTopRight, Color aColorBottomRight, Color aColorBottomLeft) { static Size aLastSize(0, 0); static sal_uInt8 nLastAlpha(0); static Color aLastColorTopLeft(COL_BLACK); static Color aLastColorTopRight(COL_BLACK); static Color aLastColorBottomRight(COL_BLACK); static Color aLastColorBottomLeft(COL_BLACK); static BitmapEx aLastResult; if(aLastSize == rSize && nLastAlpha == nAlpha && aLastColorTopLeft == aColorTopLeft && aLastColorTopRight == aColorTopRight && aLastColorBottomRight == aColorBottomRight && aLastColorBottomLeft == aColorBottomLeft) { return aLastResult; } aLastSize = rSize; nLastAlpha = nAlpha; aLastColorTopLeft = aColorTopLeft; aLastColorTopRight = aColorTopRight; aLastColorBottomRight = aColorBottomRight; aLastColorBottomLeft = aColorBottomLeft; aLastResult.Clear(); const long nW(rSize.Width()); const long nH(rSize.Height()); if(nW && nH) { sal_uInt8 aEraseTrans(0xff); Bitmap aContent(rSize, 24); AlphaMask aAlpha(rSize, &aEraseTrans); aContent.Erase(COL_BLACK); BitmapWriteAccess* pContent = aContent.AcquireWriteAccess(); BitmapWriteAccess* pAlpha = aAlpha.AcquireWriteAccess(); if(pContent && pAlpha) { long x(0); long y(0); // x == 0, y == 0, top-left corner pContent->SetPixel(0, 0, aColorTopLeft); pAlpha->SetPixelIndex(0, 0, nAlpha); // y == 0, top line left to right for(x = 1; x < nW - 1; x++) { Color aMix(aColorTopLeft); aMix.Merge(aColorTopRight, 255 - sal_uInt8((x * 255) / nW)); pContent->SetPixel(0, x, aMix); pAlpha->SetPixelIndex(0, x, nAlpha); } // x == nW - 1, y == 0, top-right corner // #123690# Caution! When nW is 1, x == nW is possible (!) if(x < nW) { pContent->SetPixel(0, x, aColorTopRight); pAlpha->SetPixelIndex(0, x, nAlpha); } // x == 0 and nW - 1, left and right line top-down for(y = 1; y < nH - 1; y++) { Color aMixA(aColorTopLeft); aMixA.Merge(aColorBottomLeft, 255 - sal_uInt8((y * 255) / nH)); pContent->SetPixel(y, 0, aMixA); pAlpha->SetPixelIndex(y, 0, nAlpha); // #123690# Caution! When nW is 1, x == nW is possible (!) if(x < nW) { Color aMixB(aColorTopRight); aMixB.Merge(aColorBottomRight, 255 - sal_uInt8((y * 255) / nH)); pContent->SetPixel(y, x, aMixB); pAlpha->SetPixelIndex(y, x, nAlpha); } } // #123690# Caution! When nH is 1, y == nH is possible (!) if(y < nH) { // x == 0, y == nH - 1, bottom-left corner pContent->SetPixel(y, 0, aColorBottomLeft); pAlpha->SetPixelIndex(y, 0, nAlpha); // y == nH - 1, bottom line left to right for(x = 1; x < nW - 1; x++) { Color aMix(aColorBottomLeft); aMix.Merge(aColorBottomRight, 255 - sal_uInt8(((x - 0)* 255) / nW)); pContent->SetPixel(y, x, aMix); pAlpha->SetPixelIndex(y, x, nAlpha); } // x == nW - 1, y == nH - 1, bottom-right corner // #123690# Caution! When nW is 1, x == nW is possible (!) if(x < nW) { pContent->SetPixel(y, x, aColorBottomRight); pAlpha->SetPixelIndex(y, x, nAlpha); } } aContent.ReleaseAccess(pContent); aAlpha.ReleaseAccess(pAlpha); aLastResult = BitmapEx(aContent, aAlpha); } else { if(pContent) { aContent.ReleaseAccess(pContent); } if(pAlpha) { aAlpha.ReleaseAccess(pAlpha); } } } return aLastResult; } // ------------------------------------------------------------------ // eof
30.390045
132
0.524924
[ "render", "transform" ]
a99117e9f4a0d52105c3bb8cac289c0eded7f185
2,809
cpp
C++
src/lambert.cpp
orbitalVelocity/orbitutils
06ad5ca39c091542a017494e8c6cbbde039d4ac0
[ "MIT" ]
null
null
null
src/lambert.cpp
orbitalVelocity/orbitutils
06ad5ca39c091542a017494e8c6cbbde039d4ac0
[ "MIT" ]
null
null
null
src/lambert.cpp
orbitalVelocity/orbitutils
06ad5ca39c091542a017494e8c6cbbde039d4ac0
[ "MIT" ]
null
null
null
#include <cmath> #include <vector> #include "lambert.h" std::vector<double> boundingVelocities(double grav_param, std::vector<double> r0, std::vector<double> rf, double dt, bool long_way) { // algorithm constants const int MAXITER = 1000; const double TOLERANCE = 1E-10; // switch to canonical units double scale = 1.0/pow(grav_param,1.0/3.0); r0[0] = r0[0]*scale; r0[1] = r0[1]*scale; r0[2] = r0[2]*scale; rf[0] = rf[0]*scale; rf[1] = rf[1]*scale; rf[2] = rf[2]*scale; // problem constants double r0_norm = sqrt(r0[0]*r0[0] + r0[1]*r0[1] + r0[2]*r0[2]); double rf_norm = sqrt(rf[0]*rf[0] + rf[1]*rf[1] + rf[2]*rf[2]); double df = acos((r0[0]*rf[0] + r0[1]*rf[1] + r0[2]*rf[2])/(r0_norm*rf_norm)); if(long_way) df = 2.0*M_PI - df; double k = r0_norm*rf_norm*(1.0-cos(df)); double l = r0_norm + rf_norm; double m = r0_norm*rf_norm*(1.0+cos(df)); double p_i = k/(l+sqrt(2.0*m)); double p_ii = k/(l-sqrt(2.0*m)); // initial estimate double p = (p_i + p_ii)/2.0; // f and g functions double f,g,fdot,gdot; // Newton-Raphson iteration for(int i = 0; i < MAXITER; ++i) { double t, dtdp; // deal with negative values of p if(p < 0.0) p = ((MAXITER-i-1)*p_i+(i+1)*p_ii)/(MAXITER+2); // deal with out-of-bounds p if(!long_way && p < p_i) p = ((i+1)*p_i+(MAXITER-i-1)*p_ii)/(MAXITER+2); if(long_way && p > p_ii) p = ((i+1)*p_i+(MAXITER-i-1)*p_ii)/(MAXITER+2); // compute the semi-major axis using the new p double a = m*k*p/((2*m-l*l)*p*p + 2*k*l*p-k*k); // compute the values of the f and g functions f = 1-rf_norm/p*(1-cos(df)); g = r0_norm*rf_norm*sin(df)/sqrt(p); fdot = sqrt(1.0/p)*tan(df/2.0)*((1.0-cos(df))/p-1/r0_norm-1/rf_norm); gdot = (1.0+fdot*g)/f; // compute the time-of-flight and its derivative with respect to p if(a > 0.0) { double cosE = 1.0-r0_norm/a*(1.0-f); double sinE = -r0_norm*rf_norm*fdot/sqrt(a); double E = atan2(sinE,cosE); if(E < 0.0) E += 2.0*M_PI; t = g + sqrt(a*a*a)*(E-sin(E)); dtdp = g/(2*p)-3/2*a*(t-g)*((k*k+(2*m-l*l)*p*p)/(m*k*p*p))+sqrt(a*a*a)*(2*k*sinE)/(p*(k-l*p)); } else { double coshF = 1.0-r0_norm/a*(1-f); double F = acosh(coshF); t = g + sqrt(-a*a*a)*(sinh(F)-F); dtdp = -g/(2*p)-3/2*a*(t-g)*((k*k+(2*m-l*l)*p*p)/(m*k*p*p))-sqrt(-a*a*a)*(2*k*sinh(F))/(p*(k-l*p)); } // iterate p = p - (dt-t)/dtdp; if(std::abs(dt-t) < TOLERANCE) break; } // compute and return the initial and final velocities std::vector<double> v(6); v[0] = (rf[0]-f*r0[0])/g; v[1] = (rf[1]-f*r0[1])/g; v[2] = (rf[2]-f*r0[2])/g; v[3] = fdot*r0[0]+gdot*v[0]; v[4] = fdot*r0[1]+gdot*v[1]; v[5] = fdot*r0[2]+gdot*v[2]; // return from canonical units v[0] = v[0]/scale; v[1] = v[1]/scale; v[2] = v[2]/scale; v[3] = v[3]/scale; v[4] = v[4]/scale; v[5] = v[5]/scale; return v; }
29.568421
102
0.57209
[ "vector" ]
a9930ee6b05bb9148321868a1b9ee956cd4a6d58
16,547
cpp
C++
src/libtsduck/dtv/descriptors/tsATSCEAC3AudioDescriptor.cpp
ASTRO-Strobel/tsduck
f1da3d49df35b3d9740fb2c8031c92d0f261829a
[ "BSD-2-Clause" ]
2
2020-02-27T04:34:41.000Z
2020-04-29T10:43:23.000Z
src/libtsduck/dtv/descriptors/tsATSCEAC3AudioDescriptor.cpp
mirakc/tsduck-arib
c400025b7d31e26c0c15471e81adf2ad50632281
[ "BSD-2-Clause" ]
null
null
null
src/libtsduck/dtv/descriptors/tsATSCEAC3AudioDescriptor.cpp
mirakc/tsduck-arib
c400025b7d31e26c0c15471e81adf2ad50632281
[ "BSD-2-Clause" ]
1
2019-05-08T15:00:43.000Z
2019-05-08T15:00:43.000Z
//---------------------------------------------------------------------------- // // TSDuck - The MPEG Transport Stream Toolkit // Copyright (c) 2005-2020, Thierry Lelegard // 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 "tsATSCEAC3AudioDescriptor.h" #include "tsDescriptor.h" #include "tsTablesDisplay.h" #include "tsTablesFactory.h" #include "tsxmlElement.h" #include "tsNames.h" TSDUCK_SOURCE; #define MY_XML_NAME u"ATSC_EAC3_audio_descriptor" #define MY_DID ts::DID_ATSC_ENHANCED_AC3 #define MY_PDS ts::PDS_ATSC #define MY_STD ts::STD_ATSC TS_XML_DESCRIPTOR_FACTORY(ts::ATSCEAC3AudioDescriptor, MY_XML_NAME); TS_ID_DESCRIPTOR_FACTORY(ts::ATSCEAC3AudioDescriptor, ts::EDID::Private(MY_DID, MY_PDS)); TS_FACTORY_REGISTER(ts::ATSCEAC3AudioDescriptor::DisplayDescriptor, ts::EDID::Private(MY_DID, MY_PDS)); //---------------------------------------------------------------------------- // Constructors //---------------------------------------------------------------------------- ts::ATSCEAC3AudioDescriptor::ATSCEAC3AudioDescriptor() : AbstractDescriptor(MY_DID, MY_XML_NAME, MY_STD, 0), mixinfoexists(false), full_service(false), audio_service_type(0), number_of_channels(0), bsid(), priority(), mainid(), asvc(), substream1(), substream2(), substream3(), language(), language_2(), substream1_lang(), substream2_lang(), substream3_lang(), additional_info() { _is_valid = true; } ts::ATSCEAC3AudioDescriptor::ATSCEAC3AudioDescriptor(DuckContext& duck, const Descriptor& desc) : ATSCEAC3AudioDescriptor() { deserialize(duck, desc); } //---------------------------------------------------------------------------- // Clear the content of this object. //---------------------------------------------------------------------------- void ts::ATSCEAC3AudioDescriptor::clear() { mixinfoexists = false; full_service = false; audio_service_type = 0; number_of_channels = 0; bsid.reset(); priority.reset(); mainid.reset(); asvc.reset(); substream1.reset(); substream2.reset(); substream3.reset(); language.clear(); language_2.clear(); substream1_lang.clear(); substream2_lang.clear(); substream3_lang.clear(); additional_info.clear(); } //---------------------------------------------------------------------------- // Serialization //---------------------------------------------------------------------------- void ts::ATSCEAC3AudioDescriptor::serialize(DuckContext& duck, Descriptor& desc) const { ByteBlockPtr bbp(serializeStart()); bbp->appendUInt8(0x80 | (bsid.set() ? 0x40 : 0x00) | (mainid.set() && priority.set() ? 0x20 : 0x00) | (asvc.set() ? 0x10 : 0x00) | (mixinfoexists ? 0x08 : 0x00) | (substream1.set() ? 0x04 : 0x00) | (substream2.set() ? 0x02 : 0x00) | (substream3.set() ? 0x01 : 0x00)); bbp->appendUInt8(0x80 | (full_service ? 0x40 : 0x00) | uint8_t((audio_service_type & 0x07) << 3) | (number_of_channels & 0x07)); bbp->appendUInt8((language.empty() ? 0x00 : 0x80) | (language_2.empty() ? 0x00 : 0x40) | 0x20 | (bsid.value(0x00) & 0x1F)); if (mainid.set() && priority.set()) { bbp->appendUInt8(0xE0 | uint8_t((priority.value() & 0x03) << 3) | (mainid.value() & 0x07)); } if (asvc.set()) { bbp->appendUInt8(asvc.value()); } if (substream1.set()) { bbp->appendUInt8(substream1.value()); } if (substream2.set()) { bbp->appendUInt8(substream2.value()); } if (substream3.set()) { bbp->appendUInt8(substream3.value()); } if (!language.empty() && !SerializeLanguageCode(*bbp, language)) { return; // invalid language code size } if (!language_2.empty() && !SerializeLanguageCode(*bbp, language_2)) { return; // invalid language code size } if (substream1.set() && !SerializeLanguageCode(*bbp, substream1_lang)) { return; // invalid language code size } if (substream2.set() && !SerializeLanguageCode(*bbp, substream2_lang)) { return; // invalid language code size } if (substream3.set() && !SerializeLanguageCode(*bbp, substream3_lang)) { return; // invalid language code size } bbp->append(additional_info); serializeEnd(desc, bbp); } //---------------------------------------------------------------------------- // Deserialization //---------------------------------------------------------------------------- void ts::ATSCEAC3AudioDescriptor::deserialize(DuckContext& duck, const Descriptor& desc) { clear(); _is_valid = desc.isValid() && desc.tag() == _tag && desc.payloadSize() >= 2; if (!_is_valid) { return; } const uint8_t* data = desc.payload(); size_t size = desc.payloadSize(); // Fixed initial size: 2 bytes. const bool bsid_flag = (data[0] & 0x40) != 0; const bool mainid_flag = (data[0] & 0x20) != 0; const bool asvc_flag = (data[0] & 0x10) != 0; mixinfoexists = (data[0] & 0x08) != 0; const bool substream1_flag = (data[0] & 0x04) != 0; const bool substream2_flag = (data[0] & 0x02) != 0; const bool substream3_flag = (data[0] & 0x01) != 0; full_service = (data[1] & 0x40) != 0; audio_service_type = (data[1] >> 3) & 0x07; number_of_channels = data[1] & 0x07; data += 2; size -= 2; // End of descriptor allowed here if (size == 0) { return; } // Decode one byte depending on bsid. const bool language_flag = (data[0] & 0x80) != 0; const bool language_2_flag = (data[0] & 0x40) != 0; if (bsid_flag) { bsid = data[0] & 0x1F; } data++; size--; if (mainid_flag && size > 0) { priority = (data[0] >> 3) & 0x03; mainid = data[0] & 0x07; data++; size--; } if (asvc_flag && size > 0) { asvc = data[0]; data++; size--; } if (substream1_flag && size > 0) { substream1 = data[0]; data++; size--; } if (substream2_flag && size > 0) { substream2 = data[0]; data++; size--; } if (substream3_flag && size > 0) { substream3 = data[0]; data++; size--; } if (language_flag) { if (size < 3) { _is_valid = false; } else { language = DeserializeLanguageCode(data); data += 3; size -= 3; } } if (_is_valid && language_2_flag) { if (size < 3) { _is_valid = false; } else { language_2 = DeserializeLanguageCode(data); data += 3; size -= 3; } } if (_is_valid && substream1_flag) { if (size < 3) { _is_valid = false; } else { substream1_lang = DeserializeLanguageCode(data); data += 3; size -= 3; } } if (_is_valid && substream2_flag) { if (size < 3) { _is_valid = false; } else { substream2_lang = DeserializeLanguageCode(data); data += 3; size -= 3; } } if (_is_valid && substream3_flag) { if (size < 3) { _is_valid = false; } else { substream3_lang = DeserializeLanguageCode(data); data += 3; size -= 3; } } if (_is_valid) { additional_info.copy(data, size); } } //---------------------------------------------------------------------------- // Static method to display a descriptor. //---------------------------------------------------------------------------- void ts::ATSCEAC3AudioDescriptor::DisplayDescriptor(TablesDisplay& display, DID did, const uint8_t* data, size_t size, int indent, TID tid, PDS pds) { if (size >= 2) { std::ostream& strm(display.duck().out()); const std::string margin(indent, ' '); // Fixed initial size: 2 bytes. const bool bsid_flag = (data[0] & 0x40) != 0; const bool mainid_flag = (data[0] & 0x20) != 0; const bool asvc_flag = (data[0] & 0x10) != 0; const bool mixinfo = (data[0] & 0x08) != 0; const bool sub1_flag = (data[0] & 0x04) != 0; const bool sub2_flag = (data[0] & 0x02) != 0; const bool sub3_flag = (data[0] & 0x01) != 0; const bool full = (data[1] & 0x40) != 0; const uint8_t svc_type = (data[1] >> 3) & 0x07; const uint8_t channels = data[1] & 0x07; const bool lang_flag = size > 2 && (data[2] & 0x80) != 0; // in next byte const bool lang2_flag = size > 2 && (data[2] & 0x40) != 0; // in next byte data += 2; size -= 2; strm << margin << UString::Format(u"Mixinfo exists: %s", {mixinfo}) << std::endl << margin << UString::Format(u"Full service: %s", {full}) << std::endl << margin << UString::Format(u"Audio service type: %s", {NameFromSection(u"EAC3AudioServiceType", svc_type, names::VALUE)}) << std::endl << margin << UString::Format(u"Num. channels: %s", {NameFromSection(u"ATSCEAC3NumChannels", channels, names::VALUE)}) << std::endl; if (size > 0) { if (bsid_flag) { const uint8_t id = data[0] & 0x1F; strm << margin << UString::Format(u"Bit stream id (bsid): 0x%X (%d)", {id, id}) << std::endl; } data++; size--; } if (mainid_flag && size > 0) { const uint8_t id = data[0] & 0x07; strm << margin << UString::Format(u"Priority: %d", {(data[0] >> 3) & 0x03}) << std::endl << margin << UString::Format(u"Main id: 0x%X (%d)", {id, id}) << std::endl; data++; size--; } if (asvc_flag && size > 0) { strm << margin << UString::Format(u"Associated service (asvc): 0x%X (%d)", {data[0], data[0]}) << std::endl; data++; size--; } if (sub1_flag && size > 0) { strm << margin << UString::Format(u"Substream 1: 0x%X (%d)", {data[0], data[0]}) << std::endl; data++; size--; } if (sub2_flag && size > 0) { strm << margin << UString::Format(u"Substream 2: 0x%X (%d)", {data[0], data[0]}) << std::endl; data++; size--; } if (sub3_flag && size > 0) { strm << margin << UString::Format(u"Substream 3: 0x%X (%d)", {data[0], data[0]}) << std::endl; data++; size--; } if (lang_flag && size >= 3) { strm << margin << "Language: \"" << DeserializeLanguageCode(data) << "\"" << std::endl; data += 3; size -= 3; } if (lang2_flag && size >= 3) { strm << margin << "Language 2: \"" << DeserializeLanguageCode(data) << "\"" << std::endl; data += 3; size -= 3; } if (sub1_flag && size >= 3) { strm << margin << "Substream 1 language: \"" << DeserializeLanguageCode(data) << "\"" << std::endl; data += 3; size -= 3; } if (sub2_flag && size >= 3) { strm << margin << "Substream 2 language: \"" << DeserializeLanguageCode(data) << "\"" << std::endl; data += 3; size -= 3; } if (sub3_flag && size >= 3) { strm << margin << "Substream 3 language: \"" << DeserializeLanguageCode(data) << "\"" << std::endl; data += 3; size -= 3; } if (size > 0) { strm << margin << "Additional information:" << std::endl << UString::Dump(data, size, UString::HEXA | UString::ASCII | UString::OFFSET, indent); data += size; size = 0; } } display.displayExtraData(data, size, indent); } //---------------------------------------------------------------------------- // XML serialization //---------------------------------------------------------------------------- void ts::ATSCEAC3AudioDescriptor::buildXML(DuckContext& duck, xml::Element* root) const { root->setBoolAttribute(u"mixinfoexists", mixinfoexists); root->setBoolAttribute(u"full_service", full_service); root->setIntAttribute(u"audio_service_type", audio_service_type, true); root->setIntAttribute(u"number_of_channels", number_of_channels, true); root->setOptionalIntAttribute(u"bsid", bsid, true); root->setOptionalIntAttribute(u"priority", priority, true); root->setOptionalIntAttribute(u"mainid", mainid, true); root->setOptionalIntAttribute(u"asvc", asvc, true); root->setOptionalIntAttribute(u"substream1", substream1, true); root->setOptionalIntAttribute(u"substream2", substream2, true); root->setOptionalIntAttribute(u"substream3", substream3, true); root->setAttribute(u"language", language, true); root->setAttribute(u"language_2", language_2, true); root->setAttribute(u"substream1_lang", substream1_lang, true); root->setAttribute(u"substream2_lang", substream2_lang, true); root->setAttribute(u"substream3_lang", substream3_lang, true); if (!additional_info.empty()) { root->addElement(u"additional_info")->addHexaText(additional_info); } } //---------------------------------------------------------------------------- // XML deserialization //---------------------------------------------------------------------------- void ts::ATSCEAC3AudioDescriptor::fromXML(DuckContext& duck, const xml::Element* element) { clear(); _is_valid = checkXMLName(element) && element->getBoolAttribute(mixinfoexists, u"mixinfoexists", true) && element->getBoolAttribute(full_service, u"full_service", true) && element->getIntAttribute<uint8_t>(audio_service_type, u"audio_service_type", true, 0, 0, 0x07) && element->getIntAttribute<uint8_t>(number_of_channels, u"number_of_channels", true, 0, 0, 0x07) && element->getOptionalIntAttribute<uint8_t>(bsid, u"bsid", 0, 0x1F) && element->getOptionalIntAttribute<uint8_t>(priority, u"priority", 0, 0x03) && element->getOptionalIntAttribute<uint8_t>(mainid, u"mainid", 0, 0x07) && element->getOptionalIntAttribute<uint8_t>(asvc, u"asvc") && element->getOptionalIntAttribute<uint8_t>(substream1, u"substream1") && element->getOptionalIntAttribute<uint8_t>(substream2, u"substream2") && element->getOptionalIntAttribute<uint8_t>(substream3, u"substream3") && element->getAttribute(language, u"language", false, UString(), 0, 3) && element->getAttribute(language_2, u"language_2", false, UString(), 0, 3) && element->getAttribute(substream1_lang, u"substream1_lang", false, UString(), 0, 3) && element->getAttribute(substream2_lang, u"substream2_lang", false, UString(), 0, 3) && element->getAttribute(substream3_lang, u"substream3_lang", false, UString(), 0, 3) && element->getHexaTextChild(additional_info, u"additional_info"); }
38.571096
149
0.546323
[ "object" ]
a993a69e7684d496a6e50f49ce64cbe7ccc4e51b
5,594
cpp
C++
src/joint-position-controller.cpp
olivier-stasse/sot-talos-balance
8749650fc5f512a04c349f447a0cfb0d9e0e1e05
[ "BSD-2-Clause" ]
null
null
null
src/joint-position-controller.cpp
olivier-stasse/sot-talos-balance
8749650fc5f512a04c349f447a0cfb0d9e0e1e05
[ "BSD-2-Clause" ]
null
null
null
src/joint-position-controller.cpp
olivier-stasse/sot-talos-balance
8749650fc5f512a04c349f447a0cfb0d9e0e1e05
[ "BSD-2-Clause" ]
null
null
null
/* * Copyright 2018, Gepetto team, LAAS-CNRS * * This file is part of sot-talos-balance. * sot-talos-balance is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * sot-talos-balance 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 Lesser General Public License for more details. You should * have received a copy of the GNU Lesser General Public License along * with sot-talos-balance. If not, see <http://www.gnu.org/licenses/>. */ #include "sot/talos_balance/joint-position-controller.hh" #include <sot/core/debug.hh> #include <dynamic-graph/factory.h> #include <dynamic-graph/command-bind.h> #include <dynamic-graph/all-commands.h> #include <sot/core/stop-watch.hh> namespace dynamicgraph { namespace sot { namespace talos_balance { namespace dg = ::dynamicgraph; using namespace dg; using namespace dg::command; //Size to be aligned "-------------------------------------------------------" #define PROFILE_JOINTPOSITIONCONTROLLER_DQREF_COMPUTATION "JointPositionController: dqRef computation " #define INPUT_SIGNALS m_KpSIN << m_stateSIN << m_qDesSIN << m_dqDesSIN #define OUTPUT_SIGNALS m_dqRefSOUT /// Define EntityClassName here rather than in the header file /// so that it can be used by the macros DEFINE_SIGNAL_**_FUNCTION. typedef JointPositionController EntityClassName; /* --- DG FACTORY ---------------------------------------------------- */ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(JointPositionController, "JointPositionController"); /* ------------------------------------------------------------------- */ /* --- CONSTRUCTION -------------------------------------------------- */ /* ------------------------------------------------------------------- */ JointPositionController::JointPositionController(const std::string& name) : Entity(name) , CONSTRUCT_SIGNAL_IN(Kp, dynamicgraph::Vector) , CONSTRUCT_SIGNAL_IN(state, dynamicgraph::Vector) , CONSTRUCT_SIGNAL_IN(qDes, dynamicgraph::Vector) , CONSTRUCT_SIGNAL_IN(dqDes, dynamicgraph::Vector) , CONSTRUCT_SIGNAL_OUT(dqRef, dynamicgraph::Vector, INPUT_SIGNALS) , m_initSucceeded(false) { Entity::signalRegistration( INPUT_SIGNALS << OUTPUT_SIGNALS ); /* Commands. */ addCommand("init", makeCommandVoid1(*this, &JointPositionController::init, docCommandVoid1("Initialize the entity.","Control gains"))); } void JointPositionController::init(const unsigned & n) { if(n<1) return SEND_MSG("n must be at least 1", MSG_TYPE_ERROR); if(!m_KpSIN.isPlugged()) return SEND_MSG("Init failed: signal Kp is not plugged", MSG_TYPE_ERROR); if(!m_stateSIN.isPlugged()) return SEND_MSG("Init failed: signal q is not plugged", MSG_TYPE_ERROR); if(!m_qDesSIN.isPlugged()) return SEND_MSG("Init failed: signal qDes is not plugged", MSG_TYPE_ERROR); if(!m_dqDesSIN.isPlugged()) return SEND_MSG("Init failed: signal dqDes is not plugged", MSG_TYPE_ERROR); m_n = n; m_initSucceeded = true; } /* ------------------------------------------------------------------- */ /* --- SIGNALS ------------------------------------------------------- */ /* ------------------------------------------------------------------- */ DEFINE_SIGNAL_OUT_FUNCTION(dqRef, dynamicgraph::Vector) { if(!m_initSucceeded) { SEND_WARNING_STREAM_MSG("Cannot compute signal dqRef before initialization!"); return s; } if(s.size()!=m_n) s.resize(m_n); getProfiler().start(PROFILE_JOINTPOSITIONCONTROLLER_DQREF_COMPUTATION); const Vector & state = m_stateSIN(iter); const Vector & qDes = m_qDesSIN(iter); const Vector & dqDes = m_dqDesSIN(iter); const Vector & Kp = m_KpSIN(iter); assert(state.size()==m_n+6 && "Unexpected size of signal state"); assert(qDes.size()==m_n && "Unexpected size of signal qDes"); assert(dqDes.size()==m_n && "Unexpected size of signal dqDes"); assert(Kp.size()==m_n && "Unexpected size of signal Kp"); s = dqDes + Kp.cwiseProduct(qDes - state.tail(m_n)); getProfiler().stop(PROFILE_JOINTPOSITIONCONTROLLER_DQREF_COMPUTATION); return s; } /* --- COMMANDS ---------------------------------------------------------- */ /* ------------------------------------------------------------------- */ /* --- ENTITY -------------------------------------------------------- */ /* ------------------------------------------------------------------- */ void JointPositionController::display(std::ostream& os) const { os << "JointPositionController " << getName(); try { getProfiler().report_all(3, os); } catch (ExceptionSignal e) {} } } // namespace talos_balance } // namespace sot } // namespace dynamicgraph
40.244604
143
0.5463
[ "vector" ]
a993edcd5de92acf8462ed9a337a06454777e7bb
4,415
hpp
C++
Steamworks/Dependencies/SFGUI/include/SFGUI/Primitive.hpp
DrJonki/I-want-it-back
18c10a2354165fa0c13988aeb5904789ce2ed17c
[ "RSA-MD" ]
null
null
null
Steamworks/Dependencies/SFGUI/include/SFGUI/Primitive.hpp
DrJonki/I-want-it-back
18c10a2354165fa0c13988aeb5904789ce2ed17c
[ "RSA-MD" ]
null
null
null
Steamworks/Dependencies/SFGUI/include/SFGUI/Primitive.hpp
DrJonki/I-want-it-back
18c10a2354165fa0c13988aeb5904789ce2ed17c
[ "RSA-MD" ]
null
null
null
#pragma once #include <SFGUI/Config.hpp> #include <SFGUI/SharedPtr.hpp> #include <SFGUI/Signal.hpp> #include <SFML/Graphics.hpp> #include <SFML/OpenGL.hpp> namespace sfg { class RendererViewport; /** Renderer primitive. */ class SFGUI_API Primitive { public: typedef SharedPtr<Primitive> Ptr; //!< Shared pointer. /** Primitive vertex */ struct Vertex { sf::Vector2f position; sf::Color color; sf::Vector2f texture_coordinate; Vertex(); Vertex( const Vertex& other ); bool operator==( const Vertex& other ) const; }; /** Primitive Texture */ struct Texture { sf::Vector2f offset; sf::Vector2u size; void Update( const sf::Image& data ); Texture(); ~Texture(); }; /** Ctor. * @param Optional parameter hinting at how many vertices will be added to this primitive. */ Primitive( std::size_t vertex_reserve = 0 ); /** Merge another primitive into this primitive. * @param primitive Primitive to merge into this primitive. */ void Add( Primitive& primitive ); /** Add vertex to this primitive. * @param vertex Vertex to add. */ void AddVertex( const Vertex& vertex ); /** Add texture to this primitive. * @param texture Texture to add. */ void AddTexture( const SharedPtr<Texture>& texture ); /** Set position of this primitive. * @param position Position of this primitive. */ void SetPosition( const sf::Vector2f& position ); /** Get position of this primitive. * @return Position of this primitive. */ const sf::Vector2f& GetPosition() const; /** Set viewport this primitive should be drawn in. * @param viewport Viewport this primitive should be drawn in. */ void SetViewport( const SharedPtr<RendererViewport>& viewport ); /** Get viewport this primitive is drawn in. * @return Viewport this primitive is drawn in. */ const SharedPtr<RendererViewport>& GetViewport() const; /** Set draw layer of this primitive. * @param layer Draw layer of this primitive. */ void SetLayer( int layer ); /** Get draw layer of this primitive. * @return Draw layer of this primitive. */ int GetLayer() const; /** Set draw hierarchy level of this primitive. * Primitives with lower levels are drawn first. * @param level New draw hierarchy level of this primitive. */ void SetLevel( int level ); /** Get draw hierarchy level of this primitive. * Primitives with lower levels are drawn first. * @return Draw hierarchy level of this primitive. */ int GetLevel() const; /** Get vertices in this primitive. * @return Vertices in this primitive. */ std::vector<Vertex>& GetVertices(); /** Get textures in this primitive. * @return Textures in this primitive. */ std::vector<SharedPtr<Texture> >& GetTextures(); /** Get indices in this primitive. * @return Indices in this primitive. */ const std::vector<GLuint>& GetIndices() const; /** Set whether the primitive is synced with the VBO. * @param synced true to flag that primitive is synced with the VBO. */ void SetSynced( bool synced = true ); /** Is the primitive synced with the VBO?. * @return true when the primitive is synced with the VBO. */ bool IsSynced() const; /** Flag the primitive for drawing. * @param visible true to draw the primitive. */ void SetVisible( bool visible ); /** Is the primitive visible (drawn)?. * @return true when the primitive is visible. */ bool IsVisible() const; /** Set the function that should be called to render custom GL content. * @param callback Signal containing the functions to call. */ void SetCustomDrawCallback( const SharedPtr<Signal>& callback ); /** Get the Signal containing the functions to call to render custom GL content. * @return Signal containing the functions to call to render custom GL content. */ const SharedPtr<Signal>& GetCustomDrawCallback() const; /** Reset the primitive back to its default state. * This clears all vertices, textures, indices and any other saved values. */ void Clear(); private: sf::Vector2f m_position; SharedPtr<RendererViewport> m_viewport; SharedPtr<Signal> m_custom_draw_callback; int m_layer; int m_level; std::vector<Vertex> m_vertices; std::vector<SharedPtr<Texture> > m_textures; std::vector<GLuint> m_indices; bool m_synced; bool m_visible; }; }
25.373563
92
0.685844
[ "render", "vector" ]
a994a1d007644355b1247abfb22b931355f582db
588
cpp
C++
src/one.cpp
codemonkey-uk/aoc-2021
aa25c6a8ffc3d6cd122ff682fd2fc33e5f9aeab0
[ "MIT" ]
null
null
null
src/one.cpp
codemonkey-uk/aoc-2021
aa25c6a8ffc3d6cd122ff682fd2fc33e5f9aeab0
[ "MIT" ]
null
null
null
src/one.cpp
codemonkey-uk/aoc-2021
aa25c6a8ffc3d6cd122ff682fd2fc33e5f9aeab0
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> using namespace std; void One_A() { int a,b,c=0; cin >> a; while(cin>>b) { if (b>a) c++; a = b; } cout << c << endl; } void One_B() { int a=0; std::vector<int> data; data.reserve( 2048 ); while(cin>>a) { data.push_back(a); } int c = 0; for (size_t i = 3;i<data.size();++i) { int ps = data[i-1] + data[i-2] + data[i-3]; int is = data[i-0] + data[i-1] + data[i-2]; if (is>ps) c++; } cout << c << endl; }
15.473684
59
0.418367
[ "vector" ]
a9968808084227b3e5a1a4bb530b1c815c41126c
5,940
cc
C++
src/netconf.cc
thomwiggers/toggldesktop
fd4796d89aa28eb77b9fc12217065d5e57aa07ee
[ "BSD-3-Clause" ]
544
2019-11-17T09:38:44.000Z
2022-03-30T13:56:36.000Z
src/netconf.cc
thomwiggers/toggldesktop
fd4796d89aa28eb77b9fc12217065d5e57aa07ee
[ "BSD-3-Clause" ]
1,372
2019-11-14T09:22:21.000Z
2022-03-29T13:01:20.000Z
src/netconf.cc
thomwiggers/toggldesktop
fd4796d89aa28eb77b9fc12217065d5e57aa07ee
[ "BSD-3-Clause" ]
86
2019-11-14T04:47:23.000Z
2022-03-03T02:44:15.000Z
// Copyright 2015 Toggl Desktop developers. #include "netconf.h" #include <string> #include <sstream> #include "https_client.h" #include <Poco/Environment.h> #include <Poco/Logger.h> #include <Poco/Net/HTTPCredentials.h> #include <Poco/Net/HTTPClientSession.h> #include <Poco/URI.h> #include <Poco/UnicodeConverter.h> #ifdef __MACH__ #include <CoreFoundation/CoreFoundation.h> // NOLINT #include <CoreServices/CoreServices.h> // NOLINT #endif #if defined(_WIN32) || defined(WIN32) #include <winhttp.h> #pragma comment(lib, "winhttp") #endif namespace toggl { error Netconf::autodetectProxy( const std::string &encoded_url, std::vector<std::string> *proxy_strings) { poco_assert(proxy_strings); proxy_strings->clear(); if (encoded_url.empty()) { return noError; } #if defined(_WIN32) || defined(WIN32) WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = { 0 }; if (!WinHttpGetIEProxyConfigForCurrentUser(&ie_config)) { std::stringstream ss; ss << "WinHttpGetIEProxyConfigForCurrentUser error: " << GetLastError(); return ss.str(); } if (ie_config.lpszProxy) { std::wstring proxy_url_wide(ie_config.lpszProxy); std::string s(""); Poco::UnicodeConverter::toUTF8(proxy_url_wide, s); s = Poco::replace(s, std::string("http="), std::string("http://")); s = Poco::replace(s, std::string("https="), std::string("https://")); std::stringstream ss(s); std::string proxy_address; while (std::getline(ss, proxy_address, ';')) { proxy_strings->push_back(proxy_address); } } #endif // Inspired by VLC source code // https://github.com/videolan/vlc/blob/master/src/darwin/netconf.c #ifdef __MACH__ CFDictionaryRef dicRef = CFNetworkCopySystemProxySettings(); if (NULL != dicRef) { const CFStringRef proxyCFstr = (const CFStringRef)CFDictionaryGetValue( dicRef, (const void*)kCFNetworkProxiesHTTPProxy); const CFNumberRef portCFnum = (const CFNumberRef)CFDictionaryGetValue( dicRef, (const void*)kCFNetworkProxiesHTTPPort); if (NULL != proxyCFstr && NULL != portCFnum) { int port = 0; if (!CFNumberGetValue(portCFnum, kCFNumberIntType, &port)) { CFRelease(dicRef); return noError; } const std::size_t kBufsize(4096); char host_buffer[kBufsize]; memset(host_buffer, 0, sizeof(host_buffer)); if (CFStringGetCString(proxyCFstr, host_buffer, sizeof(host_buffer) - 1, kCFStringEncodingUTF8)) { char buffer[kBufsize]; snprintf(buffer, kBufsize, "%s:%d", host_buffer, port); proxy_strings->push_back(std::string(buffer)); } } CFRelease(dicRef); } #endif return noError; } error Netconf::ConfigureProxy( const std::string &encoded_url, Poco::Net::HTTPClientSession *session) { Logger logger { "ConfigureProxy" }; std::string proxy_url(""); if (HTTPClient::Config.AutodetectProxy) { if (Poco::Environment::has("HTTPS_PROXY")) { proxy_url = Poco::Environment::get("HTTPS_PROXY"); } if (Poco::Environment::has("https_proxy")) { proxy_url = Poco::Environment::get("https_proxy"); } if (Poco::Environment::has("HTTP_PROXY")) { proxy_url = Poco::Environment::get("HTTP_PROXY"); } if (Poco::Environment::has("http_proxy")) { proxy_url = Poco::Environment::get("http_proxy"); } if (proxy_url.empty()) { std::vector<std::string> proxy_strings; error err = autodetectProxy(encoded_url, &proxy_strings); if (err != noError) { return err; } if (!proxy_strings.empty()) { proxy_url = proxy_strings[0]; } } if (!proxy_url.empty()) { if (proxy_url.find("://") == std::string::npos) { proxy_url = "http://" + proxy_url; } Poco::URI proxy_uri(proxy_url); logger.debug("Using proxy URI=", proxy_uri.toString(), " host=", proxy_uri.getHost(), " port=", proxy_uri.getPort()); session->setProxy( proxy_uri.getHost(), proxy_uri.getPort()); if (!proxy_uri.getUserInfo().empty()) { Poco::Net::HTTPCredentials credentials; credentials.fromUserInfo(proxy_uri.getUserInfo()); session->setProxyCredentials( credentials.getUsername(), credentials.getPassword()); logger.debug("Proxy credentials detected username=", credentials.getUsername()); } } } // Try to use user-configured proxy if (proxy_url.empty() && HTTPClient::Config.UseProxy && HTTPClient::Config.ProxySettings.IsConfigured()) { session->setProxy( HTTPClient::Config.ProxySettings.Host(), static_cast<Poco::UInt16>( HTTPClient::Config.ProxySettings.Port())); logger.debug("Proxy configured ", " host=", HTTPClient::Config.ProxySettings.Host(), " port=", HTTPClient::Config.ProxySettings.Port()); if (HTTPClient::Config.ProxySettings.HasCredentials()) { session->setProxyCredentials( HTTPClient::Config.ProxySettings.Username(), HTTPClient::Config.ProxySettings.Password()); logger.debug("Proxy credentials configured username=", HTTPClient::Config.ProxySettings.Username()); } } return noError; } } // namespace toggl
32.81768
79
0.582323
[ "vector" ]
a997c0129e5ee8151144127163a624441ea35385
52,545
cpp
C++
_vscp_common/devicethread.cpp
benys/vscpworks
755a1733d0c55c8dd22d65e0e1ed1598311ef999
[ "MIT" ]
1
2022-01-24T20:21:09.000Z
2022-01-24T20:21:09.000Z
_vscp_common/devicethread.cpp
benys/vscpworks
755a1733d0c55c8dd22d65e0e1ed1598311ef999
[ "MIT" ]
1
2020-05-05T18:40:57.000Z
2020-05-05T18:40:57.000Z
_vscp_common/devicethread.cpp
benys/vscpworks
755a1733d0c55c8dd22d65e0e1ed1598311ef999
[ "MIT" ]
1
2020-05-05T08:07:32.000Z
2020-05-05T08:07:32.000Z
// devicethread.cpp // // This file is part of the VSCP (http://www.vscp.org) // // The MIT License (MIT) // // Copyright (c) 2000-2018 Ake Hedman, Grodans Paradis AB <info@grodansparadis.com> // // 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. // #ifdef WIN32 #include <winsock2.h> #endif //#include "wx/wxprec.h" #include "wx/wx.h" #include "wx/defs.h" #include "wx/app.h" #ifdef WIN32 #else #define _POSIX #include <stdio.h> #include <unistd.h> #include <string.h> #include <syslog.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #endif #ifndef DWORD #define DWORD unsigned long #endif #include "daemonworker.h" #include <canal_win32_ipc.h> #include <canal_macro.h> #include <vscp.h> #include <vscp_debug.h> #include <vscpdlldef.h> #include <vscphelper.h> #include <dllist.h> #include <controlobject.h> #include "devicethread.h" /////////////////////////////////////////////////////////////////////////////// // deviceThread // deviceThread::deviceThread() : wxThread(wxTHREAD_JOINABLE) { m_pDeviceItem = NULL; m_pCtrlObject = NULL; m_preceiveThread = NULL; m_pwriteThread = NULL; m_preceiveLevel2Thread = NULL; m_pwriteLevel2Thread = NULL; } /////////////////////////////////////////////////////////////////////////////// // stopDriver // deviceThread::~deviceThread() { ; } /////////////////////////////////////////////////////////////////////////////// // Entry // void *deviceThread::Entry() { // Must have a valid pointer to the device item if (NULL == m_pDeviceItem) return NULL; // Must have a valid pointer to the control object if (NULL == m_pCtrlObject) return NULL; // We need to create a clientobject and add this object to the list m_pDeviceItem->m_pClientItem = new CClientItem; if ( NULL == m_pDeviceItem->m_pClientItem ) { return NULL; } // This is now an active Client m_pDeviceItem->m_pClientItem->m_bOpen = true; if ( VSCP_DRIVER_LEVEL1 == m_pDeviceItem->m_driverLevel ) { m_pDeviceItem->m_pClientItem->m_type = CLIENT_ITEM_INTERFACE_TYPE_DRIVER_LEVEL1; } else if ( VSCP_DRIVER_LEVEL2 == m_pDeviceItem->m_driverLevel ) { m_pDeviceItem->m_pClientItem->m_type = CLIENT_ITEM_INTERFACE_TYPE_DRIVER_LEVEL2; } else if ( VSCP_DRIVER_LEVEL3 == m_pDeviceItem->m_driverLevel ) { m_pDeviceItem->m_pClientItem->m_type = CLIENT_ITEM_INTERFACE_TYPE_DRIVER_LEVEL3; } m_pDeviceItem->m_pClientItem->m_strDeviceName = m_pDeviceItem->m_strName; m_pDeviceItem->m_pClientItem->m_strDeviceName += _("|Started at "); m_pDeviceItem->m_pClientItem->m_strDeviceName += wxDateTime::Now().FormatISODate(); m_pDeviceItem->m_pClientItem->m_strDeviceName += _(" "); m_pDeviceItem->m_pClientItem->m_strDeviceName += wxDateTime::Now().FormatISOTime(); m_pCtrlObject->logMsg( m_pDeviceItem->m_pClientItem->m_strDeviceName + _("\n"), DAEMON_LOGMSG_DEBUG); // Add the client to the Client List m_pCtrlObject->m_wxClientMutex.Lock(); if ( !m_pCtrlObject->addClient( m_pDeviceItem->m_pClientItem, m_pDeviceItem->m_interface_guid.getClientID() ) ) { // Failed to add client delete m_pDeviceItem->m_pClientItem; m_pDeviceItem->m_pClientItem = NULL; m_pCtrlObject->m_wxClientMutex.Unlock(); m_pCtrlObject->logMsg( _("Devicethread: Failed to add client. Terminating thread.") ); return NULL; } m_pCtrlObject->m_wxClientMutex.Unlock(); // Client now have GUID set to server GUID + channel id // If device has a non NULL GUID replace the client GUID preserving // the channel id with that GUID if ( !m_pDeviceItem->m_pClientItem->m_guid.isNULL() ) { memcpy( m_pDeviceItem->m_pClientItem->m_guid.m_id, m_pDeviceItem->m_interface_guid.getGUID(), 12 ); } if ( VSCP_DRIVER_LEVEL3 != m_pDeviceItem->m_driverLevel ) { // Load dynamic library if ( !m_wxdll.Load( m_pDeviceItem->m_strPath, wxDL_LAZY ) ) { m_pCtrlObject->logMsg(_("Unable to load dynamic library.\n") ); return NULL; } } else { // Level II driver // Startup Level III driver /*wxString executable = m_pDeviceItem->m_strPath; if ( 0 == ( m_pDeviceItem->m_pid = wxExecute( executable.mbc_str() ) ) ) { wxString str; str = _("Failed to load level III driver: "); str += m_pDeviceItem->m_strName; str += _("\n"); m_pCtrlObject->logMsg(str); wxLogDebug(str); return NULL; }*/ } if ( VSCP_DRIVER_LEVEL1 == m_pDeviceItem->m_driverLevel ) { // Now find methods in library { wxString str; str = _("Loading level I driver: "); str += m_pDeviceItem->m_strName; str += _("\n"); m_pCtrlObject->logMsg(str); wxLogDebug(str); } // * * * * CANAL OPEN * * * * if (NULL == (m_pDeviceItem->m_proc_CanalOpen = (LPFNDLL_CANALOPEN) m_wxdll.GetSymbol(_("CanalOpen")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalOpen.\n") ); return NULL; } // * * * * CANAL CLOSE * * * * if (NULL == (m_pDeviceItem->m_proc_CanalClose = (LPFNDLL_CANALCLOSE) m_wxdll.GetSymbol(_("CanalClose")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalClose.\n") ); return NULL; } // * * * * CANAL GETLEVEL * * * * if (NULL == (m_pDeviceItem->m_proc_CanalGetLevel = (LPFNDLL_CANALGETLEVEL) m_wxdll.GetSymbol(_("CanalGetLevel")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalGetLevel.\n") ); return NULL; } // * * * * CANAL SEND * * * * if (NULL == (m_pDeviceItem->m_proc_CanalSend = (LPFNDLL_CANALSEND) m_wxdll.GetSymbol(_("CanalSend")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalSend.\n") ); return NULL; } // * * * * CANAL DATA AVAILABLE * * * * if (NULL == (m_pDeviceItem->m_proc_CanalDataAvailable = (LPFNDLL_CANALDATAAVAILABLE) m_wxdll.GetSymbol(_("CanalDataAvailable")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalDataAvailable.\n") ); return NULL; } // * * * * CANAL RECEIVE * * * * if (NULL == (m_pDeviceItem->m_proc_CanalReceive = (LPFNDLL_CANALRECEIVE) m_wxdll.GetSymbol(_("CanalReceive")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalReceive.\n") ); return NULL; } // * * * * CANAL GET STATUS * * * * if (NULL == (m_pDeviceItem->m_proc_CanalGetStatus = (LPFNDLL_CANALGETSTATUS) m_wxdll.GetSymbol(_("CanalGetStatus")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalGetStatus.\n") ); return NULL; } // * * * * CANAL GET STATISTICS * * * * if (NULL == (m_pDeviceItem->m_proc_CanalGetStatistics = (LPFNDLL_CANALGETSTATISTICS) m_wxdll.GetSymbol(_("CanalGetStatistics")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalGetStatistics.\n") ); return NULL; } // * * * * CANAL SET FILTER * * * * if (NULL == (m_pDeviceItem->m_proc_CanalSetFilter = (LPFNDLL_CANALSETFILTER) m_wxdll.GetSymbol(_("CanalSetFilter")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalSetFilter.\n") ); return NULL; } // * * * * CANAL SET MASK * * * * if (NULL == (m_pDeviceItem->m_proc_CanalSetMask = (LPFNDLL_CANALSETMASK) m_wxdll.GetSymbol(_("CanalSetMask")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalSetMask.\n") ); return NULL; } // * * * * CANAL GET VERSION * * * * if (NULL == (m_pDeviceItem->m_proc_CanalGetVersion = (LPFNDLL_CANALGETVERSION) m_wxdll.GetSymbol(_("CanalGetVersion")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalGetVersion.\n") ); return NULL; } // * * * * CANAL GET DLL VERSION * * * * if (NULL == (m_pDeviceItem->m_proc_CanalGetDllVersion = (LPFNDLL_CANALGETDLLVERSION) m_wxdll.GetSymbol(_("CanalGetDllVersion")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalGetDllVersion.\n") ); return NULL; } // * * * * CANAL GET VENDOR STRING * * * * if (NULL == (m_pDeviceItem->m_proc_CanalGetVendorString = (LPFNDLL_CANALGETVENDORSTRING) m_wxdll.GetSymbol(_("CanalGetVendorString")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalGetVendorString.\n") ); return NULL; } // ****************************** // Generation 2 Methods // ****************************** // * * * * CANAL BLOCKING SEND * * * * m_pDeviceItem->m_proc_CanalBlockingSend = NULL; if (m_wxdll.HasSymbol(_("CanalBlockingSend"))) { if (NULL == (m_pDeviceItem->m_proc_CanalBlockingSend = (LPFNDLL_CANALBLOCKINGSEND) m_wxdll.GetSymbol(_("CanalBlockingSend")))) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalBlockingSend. Probably Generation 1 driver.\n") ); m_pDeviceItem->m_proc_CanalBlockingSend = NULL; } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": CanalBlockingSend not available. \n\tNon blocking operations set.\n") ); } // * * * * CANAL BLOCKING RECEIVE * * * * m_pDeviceItem->m_proc_CanalBlockingReceive = NULL; if (m_wxdll.HasSymbol(_("CanalBlockingReceive"))) { if (NULL == (m_pDeviceItem->m_proc_CanalBlockingReceive = (LPFNDLL_CANALBLOCKINGRECEIVE) m_wxdll.GetSymbol(_("CanalBlockingReceive")))) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalBlockingReceive. Probably Generation 1 driver.\n") ); m_pDeviceItem->m_proc_CanalBlockingReceive = NULL; } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": CanalBlockingReceive not available. \n\tNon blocking operations set.\n")); } // * * * * CANAL GET DRIVER INFO * * * * m_pDeviceItem->m_proc_CanalGetdriverInfo = NULL; if (m_wxdll.HasSymbol(_("CanalGetDriverInfo"))) { if (NULL == (m_pDeviceItem->m_proc_CanalGetdriverInfo = (LPFNDLL_CANALGETDRIVERINFO) m_wxdll.GetSymbol(_("CanalGetDriverInfo")))) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for CanalGetDriverInfo. Probably Generation 1 driver.\n") ); m_pDeviceItem->m_proc_CanalGetdriverInfo = NULL; } } // Open the device m_pDeviceItem->m_openHandle = m_pDeviceItem->m_proc_CanalOpen((const char *) m_pDeviceItem->m_strParameter.mb_str(wxConvUTF8), m_pDeviceItem->m_DeviceFlags); // Check if the driver opened properly if (m_pDeviceItem->m_openHandle <= 0) { wxString errMsg = _("Failed to open driver. Will not use it! \n\t[ ") + m_pDeviceItem->m_strName + _(" ]\n"); m_pCtrlObject->logMsg( errMsg ); return NULL; } else { wxString wxstr = wxString::Format(_("Driver %s opended.\n"), (const char *)m_pDeviceItem->m_strName.mbc_str() ); m_pCtrlObject->logMsg( wxstr ); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I Driver open.")); } // Get Driver Level m_pDeviceItem->m_driverLevel = m_pDeviceItem->m_proc_CanalGetLevel(m_pDeviceItem->m_openHandle); // * * * Level I Driver * * * // Check if blocking driver is available if (NULL != m_pDeviceItem->m_proc_CanalBlockingReceive) { // * * * * Blocking version * * * * if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I blocking version.")); } ///////////////////////////////////////////////////////////////////////////// // Device write worker thread ///////////////////////////////////////////////////////////////////////////// m_pwriteThread = new deviceLevel1WriteThread; if (m_pwriteThread) { m_pwriteThread->m_pMainThreadObj = this; wxThreadError err; if (wxTHREAD_NO_ERROR == (err = m_pwriteThread->Create())) { m_pwriteThread->SetPriority(WXTHREAD_MAX_PRIORITY); if (wxTHREAD_NO_ERROR != (err = m_pwriteThread->Run())) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to run device write worker thread.\n") ); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to create device write worker thread.\n") ); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to allocate memory for device write worker thread.\n") ); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I write thread started.")); } ///////////////////////////////////////////////////////////////////////////// // Device read worker thread ///////////////////////////////////////////////////////////////////////////// m_preceiveThread = new deviceLevel1ReceiveThread; if (m_preceiveThread) { m_preceiveThread->m_pMainThreadObj = this; wxThreadError err; if (wxTHREAD_NO_ERROR == (err = m_preceiveThread->Create())) { m_preceiveThread->SetPriority(WXTHREAD_MAX_PRIORITY); if (wxTHREAD_NO_ERROR != (err = m_preceiveThread->Run())) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to run device receive worker thread.\n") ); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to create device receive worker thread.\n") ); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to allocate memory for device receive worker thread.\n") ); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I receive thread started.")); } // Just sit and wait until the end of the world as we know it... while (!m_pDeviceItem->m_bQuit) { wxSleep(1); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I work loop ended.")); } m_preceiveThread->m_bQuit = true; m_pwriteThread->m_bQuit = true; m_preceiveThread->Wait(); m_pwriteThread->Wait(); } else { // * * * * Non blocking version * * * * if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I NON Blocking version.")); } bool bActivity; while ( !TestDestroy() && !m_pDeviceItem->m_bQuit ) { bActivity = false; ///////////////////////////////////////////////////////////////////////////// // Receive from device // ///////////////////////////////////////////////////////////////////////////// canalMsg msg; if ( m_pDeviceItem->m_proc_CanalDataAvailable( m_pDeviceItem->m_openHandle ) ) { if ( CANAL_ERROR_SUCCESS == m_pDeviceItem->m_proc_CanalReceive(m_pDeviceItem->m_openHandle, &msg ) ) { bActivity = true; // There must be room in the receive queue if (m_pCtrlObject->m_maxItemsInClientReceiveQueue > m_pCtrlObject->m_clientOutputQueue.GetCount()) { vscpEvent *pvscpEvent = new vscpEvent; if (NULL != pvscpEvent) { // Set driver GUID if set /*if ( m_pDeviceItem->m_interface_guid.isNULL() ) { m_pDeviceItem->m_interface_guid.writeGUID( pvscpEvent->GUID ); } else { // If no driver GUID set use interface GUID m_pDeviceItem->m_pClientItem->m_guid.writeGUID( pvscpEvent->GUID ); }*/ // Convert CANAL message to VSCP event vscp_convertCanalToEvent( pvscpEvent, &msg, m_pDeviceItem->m_pClientItem->m_guid.m_id ); pvscpEvent->obid = m_pDeviceItem->m_pClientItem->m_clientID; m_pCtrlObject->m_mutexClientOutputQueue.Lock(); m_pCtrlObject->m_clientOutputQueue.Append(pvscpEvent); m_pCtrlObject->m_semClientOutputQueue.Post(); m_pCtrlObject->m_mutexClientOutputQueue.Unlock(); } } } } // data available // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Send messages (if any) in the output queue // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Check if there is something to send if ( m_pDeviceItem->m_pClientItem->m_clientInputQueue.GetCount() ) { bActivity = true; CLIENTEVENTLIST::compatibility_iterator nodeClient; m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Lock(); nodeClient = m_pDeviceItem->m_pClientItem->m_clientInputQueue.GetFirst(); vscpEvent *pqueueEvent = nodeClient->GetData(); m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Unlock(); // Trow away event if Level II and Level I interface if ( ( CLIENT_ITEM_INTERFACE_TYPE_DRIVER_LEVEL1 == m_pDeviceItem->m_pClientItem->m_type ) && ( pqueueEvent->vscp_class > 512 ) ) { // Remove the event and the node delete pqueueEvent; m_pDeviceItem->m_pClientItem->m_clientInputQueue.DeleteNode(nodeClient); continue; } canalMsg canalMsg; vscp_convertEventToCanal(&canalMsg, pqueueEvent); if (CANAL_ERROR_SUCCESS == m_pDeviceItem->m_proc_CanalSend(m_pDeviceItem->m_openHandle, &canalMsg)) { // Remove the event and the node delete pqueueEvent; m_pDeviceItem->m_pClientItem->m_clientInputQueue.DeleteNode(nodeClient); } else { // Another try //m_pCtrlObject->m_semClientOutputQueue.Post(); vscp_deleteVSCPevent(pqueueEvent); m_pDeviceItem->m_pClientItem->m_clientInputQueue.DeleteNode(nodeClient); } } // events if (!bActivity) { ::wxMilliSleep(100); } bActivity = false; } // while working - non blocking } // if blocking/non blocking if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I Work loop ended.")); } // Close CANAL channel m_pDeviceItem->m_proc_CanalClose(m_pDeviceItem->m_openHandle); if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level I Closed.")); } // Library is unloaded in destructor // Remove messages in the client queues m_pCtrlObject->m_wxClientMutex.Lock(); m_pCtrlObject->removeClient(m_pDeviceItem->m_pClientItem); m_pCtrlObject->m_wxClientMutex.Unlock(); if (NULL != m_preceiveThread) { m_preceiveThread->Wait(); delete m_preceiveThread; } if (NULL != m_pwriteThread) { m_pwriteThread->Wait(); delete m_pwriteThread; } } else if (VSCP_DRIVER_LEVEL2 == m_pDeviceItem->m_driverLevel) { // Now find methods in library { wxString str; str = _("Loading level II driver: <"); str += m_pDeviceItem->m_strName; str += _(">"); str += _("\n"); m_pCtrlObject->logMsg(str); } // * * * * VSCP OPEN * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPOpen = (LPFNDLL_VSCPOPEN) m_wxdll.GetSymbol(_("VSCPOpen")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPOpen.\n")); return NULL; } // * * * * VSCP CLOSE * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPClose = (LPFNDLL_VSCPCLOSE) m_wxdll.GetSymbol(_("VSCPClose")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPClose.\n")); return NULL; } // * * * * VSCP BLOCKINGSEND * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPBlockingSend = (LPFNDLL_VSCPBLOCKINGSEND) m_wxdll.GetSymbol(_("VSCPBlockingSend")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPBlockingSend.\n")); return NULL; } // * * * * VSCP BLOCKINGRECEIVE * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPBlockingReceive = (LPFNDLL_VSCPBLOCKINGRECEIVE) m_wxdll.GetSymbol(_("VSCPBlockingReceive")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPBlockingReceive.\n")); return NULL; } // * * * * VSCP GETLEVEL * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPGetLevel = (LPFNDLL_VSCPGETLEVEL) m_wxdll.GetSymbol(_("VSCPGetLevel")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPGetLevel.\n")); return NULL; } // * * * * VSCP GET DLL VERSION * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPGetDllVersion = (LPFNDLL_VSCPGETDLLVERSION) m_wxdll.GetSymbol(_("VSCPGetDllVersion")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPGetDllVersion.\n")); return NULL; } // * * * * VSCP GET VENDOR STRING * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPGetVendorString = (LPFNDLL_VSCPGETVENDORSTRING) m_wxdll.GetSymbol(_("VSCPGetVendorString")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPGetVendorString.\n")); return NULL; } // * * * * VSCP GET DRIVER INFO * * * * if (NULL == (m_pDeviceItem->m_proc_CanalGetdriverInfo = (LPFNDLL_VSCPGETVENDORSTRING) m_wxdll.GetSymbol(_("VSCPGetDriverInfo")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPGetDriverInfo.\n")); return NULL; } // * * * * VSCP GET WEB PAGE TEMPLATE * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPGetWebPageTemplate = (LPFNDLL_VSCPGETWEBPAGETEMPLATE) m_wxdll.GetSymbol(_("VSCPGetWebPageTemplate")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPGetWebPageTemplate.\n")); return NULL; } // * * * * VSCP GET WEB PAGE INFO * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPGetWebPageInfo = (LPFNDLL_VSCPGETWEBPAGEINFO) m_wxdll.GetSymbol(_("VSCPGetWebPageInfo")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPGetWebPageInfo.\n")); return NULL; } // * * * * VSCP WEB PAGE UPDATE * * * * if (NULL == (m_pDeviceItem->m_proc_VSCPWebPageupdate = (LPFNDLL_VSCPWEBPAGEUPDATE) m_wxdll.GetSymbol(_("VSCPWebPageupdate")))) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to get dl entry for VSCPWebPageupdate.\n")); return NULL; } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Discovered all methods\n")); } // Username, password, host and port can be set in configuration file. Read in them here // if they are. wxString strHost(_("127.0.0.1")); short port = 9598; wxStringTokenizer tkz(m_pDeviceItem->m_strParameter, _(";")); if ( tkz.HasMoreTokens() ) { CVSCPVariable variable; // Get prefix wxString prefix = tkz.GetNextToken(); // Check if username is specified in the configuration file if ( m_pCtrlObject->m_variables.find( m_pDeviceItem->m_strName + _("_username"), variable ) ) { wxString str; if (VSCP_DAEMON_VARIABLE_CODE_STRING == variable.getType()) { str = variable.getValue(); m_pCtrlObject->m_driverUsername = str; } } // Check if password is specified in the configuration file if ( m_pCtrlObject->m_variables.find( m_pDeviceItem->m_strName + _("_password"), variable ) ) { wxString str; if (VSCP_DAEMON_VARIABLE_CODE_STRING == variable.getType()) { str = variable.getValue(); m_pCtrlObject->m_driverPassword = str; } } // Check if host is specified in the configuration file if ( m_pCtrlObject->m_variables.find( m_pDeviceItem->m_strName + _("_host"), variable ) ) { wxString str; if (VSCP_DAEMON_VARIABLE_CODE_STRING == variable.getType()) { str = variable.getValue(); strHost = str; } } // Check if host is specified in the configuration file if ( m_pCtrlObject->m_variables.find( m_pDeviceItem->m_strName + _("_port"), variable ) ) { wxString str; if (VSCP_DAEMON_VARIABLE_CODE_INTEGER == variable.getType()) { str = variable.getValue(); port = vscp_readStringValue( str ); } } } // Open up the driver m_pDeviceItem->m_openHandle = m_pDeviceItem->m_proc_VSCPOpen( m_pCtrlObject->m_driverUsername.mbc_str(), ( const char * )m_pCtrlObject->m_driverPassword.mbc_str(), ( const char * )strHost.mbc_str(), port, ( const char * )m_pDeviceItem->m_strName.mbc_str(), ( const char * )m_pDeviceItem->m_strParameter.mbc_str() ); if ( 0 == m_pDeviceItem->m_openHandle ) { // Free the library m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Unable to open VSCP " "driver (check username/password/path/" "rights). Possible additional info from driver " "in syslog.\n" ) ); return NULL; } else { wxString wxstr = wxString::Format(_("Driver %s opended.\n"), (const char *)m_pDeviceItem->m_strName.mbc_str() ); m_pCtrlObject->logMsg( wxstr ); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level II Open.")); } ///////////////////////////////////////////////////////////////////////////// // Device write worker thread ///////////////////////////////////////////////////////////////////////////// m_pwriteLevel2Thread = new deviceLevel2WriteThread; if ( m_pwriteLevel2Thread ) { m_pwriteLevel2Thread->m_pMainThreadObj = this; wxThreadError err; if (wxTHREAD_NO_ERROR == (err = m_pwriteLevel2Thread->Create())) { m_pwriteLevel2Thread->SetPriority(WXTHREAD_MAX_PRIORITY); if (wxTHREAD_NO_ERROR != (err = m_pwriteLevel2Thread->Run())) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to run device write worker thread.")); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to create device write worker thread.")); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to allocate memory for device write worker thread.")); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level II Write thread created.")); } ///////////////////////////////////////////////////////////////////////////// // Device read worker thread ///////////////////////////////////////////////////////////////////////////// m_preceiveLevel2Thread = new deviceLevel2ReceiveThread; if ( NULL != m_preceiveLevel2Thread ) { m_preceiveLevel2Thread->m_pMainThreadObj = this; wxThreadError err; if (wxTHREAD_NO_ERROR == (err = m_preceiveLevel2Thread->Create())) { m_preceiveLevel2Thread->SetPriority(WXTHREAD_MAX_PRIORITY); if (wxTHREAD_NO_ERROR != (err = m_preceiveLevel2Thread->Run())) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to run device " "receive worker thread.")); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to create device receive " "worker thread.") ); } } else { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": Unable to allocate memory for device " "receive worker thread.") ); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level II Read thread created.")); } // Just sit and wait until the end of the world as we know it... while (!TestDestroy() && !m_pDeviceItem->m_bQuit) { wxSleep(1); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level II Cloing.")); } //m_preceiveLevel2Thread->m_bQuit = true; //m_pwriteLevel2Thread->m_bQuit = true; // Close channel m_pDeviceItem->m_proc_VSCPClose( m_pDeviceItem->m_openHandle ); if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level II Closed.")); } // Library is unloaded in destructor // Remove messages in the client queues m_pCtrlObject->m_wxClientMutex.Lock(); m_pCtrlObject->removeClient(m_pDeviceItem->m_pClientItem); m_pCtrlObject->m_wxClientMutex.Unlock(); if (NULL != m_preceiveLevel2Thread) { m_preceiveLevel2Thread->Wait(); delete m_preceiveLevel2Thread; } if (NULL != m_pwriteLevel2Thread) { m_pwriteLevel2Thread->Wait(); delete m_pwriteLevel2Thread; } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level II Done waiting for threads.")); } } else if (VSCP_DRIVER_LEVEL3 == m_pDeviceItem->m_driverLevel) { if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level III Start server loop.")); } // Just sit and wait until the end of the world as we know it... while ( !m_pDeviceItem->m_bQuit ) { wxSleep(1); } if ( m_pCtrlObject->m_debugFlags1 & VSCP_DEBUG1_DRIVER ) { m_pCtrlObject->logMsg( m_pDeviceItem->m_strName + _(": [Device tread] Level II End server loop.")); } // Send stop to device //kill( m_pDeviceItem->m_pid, SIGKILL ); //*** This happens in the item destructor now *** } // // ===================================================================================== // return NULL; } /////////////////////////////////////////////////////////////////////////////// // OnExit // void deviceThread::OnExit() { } // **************************************************************************** /////////////////////////////////////////////////////////////////////////////// // deviceCanalReceiveThread // deviceLevel1ReceiveThread::deviceLevel1ReceiveThread() : wxThread(wxTHREAD_JOINABLE) { m_pMainThreadObj = NULL; m_bQuit = false; } deviceLevel1ReceiveThread::~deviceLevel1ReceiveThread() { ; } /////////////////////////////////////////////////////////////////////////////// // Entry // void *deviceLevel1ReceiveThread::Entry() { canalMsg msg; Level1MsgOutList::compatibility_iterator nodeLevel1; // Must be a valid main object pointer if (NULL == m_pMainThreadObj) return NULL; // Blocking receive method must have been found if (NULL == m_pMainThreadObj->m_pDeviceItem->m_proc_CanalBlockingReceive) return NULL; while (!TestDestroy() && !m_bQuit) { if (CANAL_ERROR_SUCCESS == m_pMainThreadObj->m_pDeviceItem->m_proc_CanalBlockingReceive( m_pMainThreadObj->m_pDeviceItem->m_openHandle, &msg, 500 ) ) { // There must be room in the receive queue if (m_pMainThreadObj->m_pCtrlObject->m_maxItemsInClientReceiveQueue > m_pMainThreadObj->m_pCtrlObject->m_clientOutputQueue.GetCount()) { vscpEvent *pvscpEvent = new vscpEvent; if (NULL != pvscpEvent) { memset( pvscpEvent, 0, sizeof( vscpEvent ) ); // Set driver GUID if set /*if ( m_pMainThreadObj->m_pDeviceItem->m_interface_guid.isNULL() ) { m_pMainThreadObj->m_pDeviceItem->m_interface_guid.writeGUID( pvscpEvent->GUID ); } else { // If no driver GUID set use interface GUID m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_guid.writeGUID( pvscpEvent->GUID ); }*/ // Convert CANAL message to VSCP event vscp_convertCanalToEvent( pvscpEvent, &msg, m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_guid.m_id ); pvscpEvent->obid = m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientID; // If no GUID is set, // - Set driver GUID if it is defined // - Set to interface GUID if not. uint8_t ifguid[16]; // Save nickname uint8_t nickname_lsb = pvscpEvent->GUID[15]; // Set if to use memcpy( ifguid, pvscpEvent->GUID, 16 ); ifguid[14] = 0; ifguid[15] = 0; // If if is set to zero use interface id if ( vscp_isGUIDEmpty( ifguid ) ) { // Set driver GUID if set if ( !m_pMainThreadObj->m_pDeviceItem->m_interface_guid.isNULL() ) { m_pMainThreadObj->m_pDeviceItem->m_interface_guid.writeGUID( pvscpEvent->GUID ); } else { // If no driver GUID set use interface GUID m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_guid.writeGUID( pvscpEvent->GUID ); } // Preserve nickname pvscpEvent->GUID[15] = nickname_lsb; } // ========================================================= // Outgoing translations // ========================================================= // Level I measurement events to Level II measurement float if ( m_pMainThreadObj->m_pDeviceItem->m_translation & VSCP_DRIVER_OUT_TR_M1M2F ) { vscp_convertLevel1MeasuremenToLevel2Double( pvscpEvent ); } // Level I measurement events to Level II measurement string else if ( m_pMainThreadObj->m_pDeviceItem->m_translation & VSCP_DRIVER_OUT_TR_M1M2S ) { vscp_convertLevel1MeasuremenToLevel2String( pvscpEvent ); } // Level I events to Level I over Level II events if ( m_pMainThreadObj->m_pDeviceItem->m_translation & VSCP_DRIVER_OUT_TR_ALL512 ) { pvscpEvent->vscp_class += 512; uint8_t *p = new uint8_t[ 16 + pvscpEvent->sizeData ]; if ( NULL != p ) { memset( p, 0, 16 + pvscpEvent->sizeData ); memcpy( p + 16, pvscpEvent->pdata, pvscpEvent->sizeData ); pvscpEvent->sizeData += 16; delete [] pvscpEvent->pdata; pvscpEvent->pdata = p; } } m_pMainThreadObj->m_pCtrlObject->m_mutexClientOutputQueue.Lock(); m_pMainThreadObj->m_pCtrlObject->m_clientOutputQueue.Append( pvscpEvent ); m_pMainThreadObj->m_pCtrlObject->m_semClientOutputQueue.Post(); m_pMainThreadObj->m_pCtrlObject->m_mutexClientOutputQueue.Unlock(); } } } } return NULL; } /////////////////////////////////////////////////////////////////////////////// // OnExit // void deviceLevel1ReceiveThread::OnExit() { ; } // **************************************************************************** /////////////////////////////////////////////////////////////////////////////// // deviceCanalWriteThread // deviceLevel1WriteThread::deviceLevel1WriteThread() : wxThread(wxTHREAD_JOINABLE) { m_pMainThreadObj = NULL; m_bQuit = false; } deviceLevel1WriteThread::~deviceLevel1WriteThread() { ; } /////////////////////////////////////////////////////////////////////////////// // Entry // void *deviceLevel1WriteThread::Entry() { Level1MsgOutList::compatibility_iterator nodeLevel1; // Must be a valid main object pointer if (NULL == m_pMainThreadObj) return NULL; // Blocking send method must have been found if (NULL == m_pMainThreadObj->m_pDeviceItem->m_proc_CanalBlockingSend) return NULL; while (!TestDestroy() && !m_bQuit) { // Wait until there is something to send if (wxSEMA_TIMEOUT == m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_semClientInputQueue.WaitTimeout(500)) { continue; } CLIENTEVENTLIST::compatibility_iterator nodeClient; if (m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientInputQueue.GetCount()) { m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Lock(); nodeClient = m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientInputQueue.GetFirst(); vscpEvent *pqueueEvent = nodeClient->GetData(); m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Unlock(); // Trow away event if Level II and Level I interface if ( ( CLIENT_ITEM_INTERFACE_TYPE_DRIVER_LEVEL1 == m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_type ) && ( pqueueEvent->vscp_class > 512 ) ) { // Remove the event and the node delete pqueueEvent; m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientInputQueue.DeleteNode(nodeClient); continue; } canalMsg canalMsg; vscp_convertEventToCanal(&canalMsg, pqueueEvent); if (CANAL_ERROR_SUCCESS == m_pMainThreadObj->m_pDeviceItem->m_proc_CanalBlockingSend( m_pMainThreadObj->m_pDeviceItem->m_openHandle, &canalMsg, 300)) { // Remove the node vscp_deleteVSCPevent(pqueueEvent); m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientInputQueue.DeleteNode(nodeClient); } else { // Give it another try m_pMainThreadObj->m_pCtrlObject->m_semClientOutputQueue.Post(); } } // events in queue } // while return NULL; } /////////////////////////////////////////////////////////////////////////////// // OnExit // void deviceLevel1WriteThread::OnExit() { } //----------------------------------------------------------------------------- // L e v e l I I //----------------------------------------------------------------------------- // **************************************************************************** /////////////////////////////////////////////////////////////////////////////// // deviceLevel2ReceiveThread // deviceLevel2ReceiveThread::deviceLevel2ReceiveThread() : wxThread(wxTHREAD_JOINABLE) { m_pMainThreadObj = NULL; m_bQuit = false; } deviceLevel2ReceiveThread::~deviceLevel2ReceiveThread() { ; } /////////////////////////////////////////////////////////////////////////////// // Entry // Read from device // void *deviceLevel2ReceiveThread::Entry() { vscpEvent *pEvent; // Must be a valid main object pointer if (NULL == m_pMainThreadObj) return NULL; int rv; while ( !TestDestroy() && !m_bQuit ) { pEvent = new vscpEvent; if (NULL == pEvent) continue; rv = m_pMainThreadObj->m_pDeviceItem->m_proc_VSCPBlockingReceive( m_pMainThreadObj->m_pDeviceItem->m_openHandle, pEvent, 500); if ((CANAL_ERROR_SUCCESS != rv) || (NULL == pEvent)) { delete pEvent; continue; } // Identify ourselves pEvent->obid = m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientID; // If timestamp is zero we set it here if ( 0 == pEvent->timestamp ) { pEvent->timestamp = vscp_makeTimeStamp(); } // If no GUID is set, // - Set driver GUID if define // - Set interface GUID if no driver GUID defined. uint8_t ifguid[16]; // Save nickname uint8_t nickname_msb = pEvent->GUID[14]; uint8_t nickname_lsb = pEvent->GUID[15]; // Set if to use memcpy( ifguid, pEvent->GUID, 16 ); ifguid[14] = 0; ifguid[15] = 0; // If if is set to zero use interface id if ( vscp_isGUIDEmpty( ifguid ) ) { // Set driver GUID if set if ( !m_pMainThreadObj->m_pDeviceItem->m_interface_guid.isNULL() ) { m_pMainThreadObj->m_pDeviceItem->m_interface_guid.writeGUID( pEvent->GUID ); } else { // If no driver GUID set use interface GUID m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_guid.writeGUID( pEvent->GUID ); } // Preserve nickname pEvent->GUID[14] = nickname_msb; pEvent->GUID[15] = nickname_lsb; } // There must be room in the receive queue (even if room (or whisky) has been better) if ( m_pMainThreadObj->m_pCtrlObject->m_maxItemsInClientReceiveQueue > m_pMainThreadObj->m_pCtrlObject->m_clientOutputQueue.GetCount() ) { m_pMainThreadObj->m_pCtrlObject->m_mutexClientOutputQueue.Lock(); m_pMainThreadObj->m_pCtrlObject->m_clientOutputQueue.Append( pEvent ); m_pMainThreadObj->m_pCtrlObject->m_semClientOutputQueue.Post(); m_pMainThreadObj->m_pCtrlObject->m_mutexClientOutputQueue.Unlock(); } else { if (NULL == pEvent) vscp_deleteVSCPevent( pEvent ); delete pEvent; pEvent = NULL; } } return NULL; } /////////////////////////////////////////////////////////////////////////////// // OnExit // void deviceLevel2ReceiveThread::OnExit() { ; } // **************************************************************************** /////////////////////////////////////////////////////////////////////////////// // deviceLevel2WriteThread // deviceLevel2WriteThread::deviceLevel2WriteThread() : wxThread(wxTHREAD_JOINABLE) { m_pMainThreadObj = NULL; m_bQuit = false; } deviceLevel2WriteThread::~deviceLevel2WriteThread() { ; } /////////////////////////////////////////////////////////////////////////////// // Entry // Write to device // void *deviceLevel2WriteThread::Entry() { // Must be a valid main object pointer if ( NULL == m_pMainThreadObj ) return NULL; while ( !TestDestroy() && !m_bQuit ) { // Wait until there is something to send if (wxSEMA_TIMEOUT == m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_semClientInputQueue.WaitTimeout(500)) { continue; } if (m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientInputQueue.GetCount()) { CLIENTEVENTLIST::compatibility_iterator nodeClient; m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Lock(); nodeClient = m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientInputQueue.GetFirst(); vscpEvent *pqueueEvent = nodeClient->GetData(); m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Unlock(); if (CANAL_ERROR_SUCCESS == m_pMainThreadObj->m_pDeviceItem->m_proc_VSCPBlockingSend( m_pMainThreadObj->m_pDeviceItem->m_openHandle, pqueueEvent, 300)) { // Remove the node m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Lock(); m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_clientInputQueue.DeleteNode( nodeClient ); m_pMainThreadObj->m_pDeviceItem->m_pClientItem->m_mutexClientInputQueue.Unlock(); } else { // Give it another try m_pMainThreadObj->m_pCtrlObject->m_semClientOutputQueue.Post(); } } // events in queue } // while return NULL; } /////////////////////////////////////////////////////////////////////////////// // OnExit // void deviceLevel2WriteThread::OnExit() { }
38.922222
157
0.53065
[ "object" ]
a997f2c06e667e5f84d2190a09776a6143ddb976
3,533
cpp
C++
Code/Model.cpp
tehAndrew/3DProject
54592b93a114a89aa5ac1ecaaef656558aea9e5e
[ "MIT" ]
null
null
null
Code/Model.cpp
tehAndrew/3DProject
54592b93a114a89aa5ac1ecaaef656558aea9e5e
[ "MIT" ]
null
null
null
Code/Model.cpp
tehAndrew/3DProject
54592b93a114a89aa5ac1ecaaef656558aea9e5e
[ "MIT" ]
null
null
null
#include "Model.h" #include <cstdlib> Model::Model() { mVertexBuffer = nullptr; mIndexBuffer = nullptr; mMaterialBuffer = nullptr; mVertexAmount = 0; mIndexAmount = 0; mX = 0.f; mY = 0.f; mZ = 0.f; mScaleX = 1.f; mScaleY = 1.f; mScaleZ = 1.f; mRotX = 0.f; mRotY = 0.f; mRotZ = 0.f; mTexture = nullptr; } Model::~Model() { if (mVertexBuffer != nullptr) mVertexBuffer->Release(); if (mIndexBuffer != nullptr) mIndexBuffer->Release(); if (mMaterialBuffer != nullptr) mMaterialBuffer->Release(); } void Model::setPos(FXMVECTOR pos) { XMFLOAT3 temp; XMStoreFloat3(&temp, pos); mX = temp.x; mY = temp.y; mZ = temp.z; } void Model::setScale(FXMVECTOR scale) { XMFLOAT3 temp; XMStoreFloat3(&temp, scale); mScaleX = temp.x; mScaleY = temp.y; mScaleZ = temp.z; } void Model::setRot(FXMVECTOR rot) { XMFLOAT3 temp; XMStoreFloat3(&temp, rot); mRotX = temp.x; mRotY = temp.y; mRotZ = temp.z; } XMMATRIX Model::getWorldMatrix() const { XMMATRIX worldMatrix = XMMatrixScaling(mScaleX, mScaleY, mScaleZ) * XMMatrixRotationX(XMConvertToRadians(mRotX)) * XMMatrixRotationY(XMConvertToRadians(mRotY)) * XMMatrixRotationZ(XMConvertToRadians(mRotZ)) * XMMatrixTranslation(mX, mY, mZ); return XMMatrixTranspose(worldMatrix); } ID3D11ShaderResourceView* Model::getTexture() const { return mTexture->getTexture(); } ID3D11Buffer* Model::getMaterial() const { return mMaterialBuffer; } HRESULT Model::defineGeometry(std::vector<Vertex> *vertices, std::vector<UINT32> *indices, ID3D11Device* device, Texture* texture, MaterialData material) { mVertexAmount = vertices->size(); mIndexAmount = indices->size(); mMaterial = material; HRESULT hr; D3D11_BUFFER_DESC vertexBufferDesc, indexBufferDesc, materialBufferDesc; D3D11_SUBRESOURCE_DATA vertexData, indexData, materialData; ZeroMemory(&vertexBufferDesc, sizeof(D3D11_BUFFER_DESC)); ZeroMemory(&indexBufferDesc, sizeof(D3D11_BUFFER_DESC)); ZeroMemory(&materialBufferDesc, sizeof(D3D11_BUFFER_DESC)); // Create vertex buffer. vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexBufferDesc.Usage = D3D11_USAGE_DEFAULT; vertexBufferDesc.ByteWidth = sizeof(Vertex) * vertices->size(); vertexData.pSysMem = const_cast<Vertex*>(vertices->data()); if (FAILED(hr = device->CreateBuffer(&vertexBufferDesc, &vertexData, &mVertexBuffer))) return hr; // Create index buffer. indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER; indexBufferDesc.Usage = D3D11_USAGE_DEFAULT; indexBufferDesc.ByteWidth = sizeof(unsigned int) * indices->size(); indexData.pSysMem = const_cast<unsigned int*>(indices->data()); if (FAILED(hr = device->CreateBuffer(&indexBufferDesc, &indexData, &mIndexBuffer))) return hr; // Create material buffer. materialBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; materialBufferDesc.Usage = D3D11_USAGE_DEFAULT; materialBufferDesc.ByteWidth = sizeof(MaterialData); materialData.pSysMem = const_cast<MaterialData*>(&mMaterial); if (FAILED(hr = device->CreateBuffer(&materialBufferDesc, &materialData, &mMaterialBuffer))) return hr; mTexture = texture; return hr; } void Model::render(ID3D11DeviceContext* deviceContext) { // Set vertex buffer stride and offset. UINT32 stride = sizeof(Vertex); UINT32 offset = 0; deviceContext->IASetVertexBuffers(0, 1, &mVertexBuffer, &stride, &offset); deviceContext->IASetIndexBuffer(mIndexBuffer, DXGI_FORMAT_R32_UINT, 0); deviceContext->DrawIndexed(mIndexAmount, 0, 0); }
25.235714
155
0.735069
[ "render", "vector", "model" ]
a999ecbf79e7b88c653fd93e73ba25a7e35225b6
5,869
cpp
C++
magician_school/main.cpp
bosornd/magician_school
1a9bf3df9d9017b553e360fd9f7bb3898f7ed927
[ "Apache-2.0" ]
null
null
null
magician_school/main.cpp
bosornd/magician_school
1a9bf3df9d9017b553e360fd9f7bb3898f7ed927
[ "Apache-2.0" ]
null
null
null
magician_school/main.cpp
bosornd/magician_school
1a9bf3df9d9017b553e360fd9f7bb3898f7ed927
[ "Apache-2.0" ]
1
2021-12-05T02:45:22.000Z
2021-12-05T02:45:22.000Z
#include <bangtal> #include <iostream> using namespace bangtal; using namespace std; extern void dormitory_main(); extern int magicalHerb(const string ch); extern void animalGame(); extern int Quidditch(const string ch); extern void astronomyGame(); extern void MaraudersMap_main(); const int gameMax = 5; static int stage; ScenePtr mainScene, endScene; // mainScene: home 화면(게임 선택할 수 있는), endScene: 성적 화면, 졸업화면 SoundPtr main_bgm; int dorm; bool P_F[gameMax] = { 0, }; // 게임 P/F ScenePtr empty_scene; TimerPtr result_timer; void setHome(const int d) { dorm = d; mainScene->setImage("images/home" + to_string(dorm) + ".jpg"); endScene->setImage("images/home" + to_string(dorm) + ".jpg"); mainScene->enter(); main_bgm->play(true); } void checkStage(int gameNum, bool PF = false) { P_F[gameNum] = PF; if (PF == true) { auto pass = Object::create("images/pass" + to_string(gameNum) + ".png", empty_scene, 0, -10); pass->setScale(1.1f); } else if (PF == false) { auto fail = Object::create("images/fail" + to_string(gameNum) + ".png", empty_scene, 0, -10); fail->setScale(1.1f); } empty_scene->enter(); result_timer->start(); result_timer->setOnTimerCallback([&](TimerPtr)->bool { if (stage == gameMax) endScene->enter(); else { mainScene->enter(); main_bgm->play(true); } result_timer->set(3.0f); return true; }); } int main() { setGameOption(GameOption::GAME_OPTION_ROOM_TITLE, false); setGameOption(GameOption::GAME_OPTION_MESSAGE_BOX_BUTTON, false); setGameOption(GameOption::GAME_OPTION_INVENTORY_BUTTON, false); empty_scene = Scene::create("", "images/startScene1.png"); result_timer = Timer::create(3.0f); stage = 0; string playerName; // 시작 장면 auto startScene = Scene::create("", "images/startScene.png"); auto startbutton = Object::create("images/startbutton.png", startScene); main_bgm = Sound::create("sounds/오프닝엔딩.mp3"); main_bgm->play(true); startbutton->setOnMouseCallback([&playerName, startScene](ObjectPtr, int, int, MouseAction)-> bool { auto story = Object::create("images/story.jpg", startScene); story->setScale(1.2f); showMessage("호그와트 입학을 축하드립니다. 이제 기숙사를 정해볼까요? (화면을 클릭해주세요.)"); story->setOnMouseCallback([&playerName](ObjectPtr, int, int, MouseAction)->bool { main_bgm->stop(); dormitory_main(); return true; }); return true; }); // 게임 선택 home화면 mainScene = Scene::create(" ", "images/home0.jpg"); // 게임 선택 버튼, 위치 설정 미완료 ObjectPtr games[gameMax]; games[0] = Object::create("images/magicalHerb.png", mainScene, 100, 400); // Magical herb - 0 games[1] = Object::create("images/astronomy.png", mainScene, 500, 400); // Astronomy Game - 1 games[2] = Object::create("images/magicalCreature.png", mainScene, 900, 400); // Magical Creature Game - 2 games[3] = Object::create("images/maraudersMap.png", mainScene, 300, 150); // Marauders Map Game - 3 games[4] = Object::create("images/quidditch.png", mainScene, 700, 150); // Quidditch Game - 4 bool gameComplete[gameMax] = { 0, }; // 이미 실행한 게임인지 확인하기 위한 변수 // 게임 버튼 클릭 시 게임 실행 for (int i = 0; i < gameMax; i++) { games[i]->setOnMouseCallback([=, &playerName, &gameComplete](ObjectPtr, int, int, MouseAction) -> bool { string ch_list[4] = { "harry", "luna", "malfoy", "newton" }; playerName = ch_list[dorm]; if (!gameComplete[i]) { stage++; gameComplete[i] = true; auto tutorial = Scene::create("", "images/back_tutorial" + to_string(i) + ".png"); auto howtoplay = Object::create("images/tutorial" + to_string(i) + ".png", tutorial, -50, 0); auto button = Object::create("images/startbutton.png", tutorial); // 위치 설정 미완료 tutorial->enter(); button->setOnMouseCallback([=](ObjectPtr, int, int, MouseAction) -> bool { switch (i) { case 0: main_bgm->stop(); magicalHerb(playerName); break; case 1: main_bgm->stop(); astronomyGame(); break; case 2: main_bgm->stop(); animalGame(); break; case 3: main_bgm->stop(); MaraudersMap_main(); break; case 4: main_bgm->stop(); Quidditch(playerName); break; default: break; } return true; }); } else if (gameComplete[i]) { showMessage("이미 플레이한 게임입니다."); } return true; }); } endScene = Scene::create("", "images/home0.jpg"); endScene->setOnEnterCallback([](ScenePtr)->bool { main_bgm->play(true); auto gradePaper = Object::create("images/paper" + to_string(dorm) + ".png", endScene, 400, 0); gradePaper->setScale(0.36f); static int PFcount = 0; ObjectPtr grade[gameMax]; // 게임별 성적을 보여주기 위한 Object for (int i = 0; i < gameMax; i++) { string s = (P_F[i]) ? "p" : "f"; if (P_F[i]) PFcount++; grade[i] = Object::create("images/" + s + ".jpg", endScene, 800, 390 - i * 30); // 위치 설정 미완료. grade[i]->setScale(0.8f); if (i >= 3) grade[i]->locate(endScene, 800, 380 - i * 30); cout << endl << P_F[i]; } gradePaper->setOnMouseCallback([=](ObjectPtr, int, int, MouseAction)-> bool { string s = (PFcount >= 3) ? "graduation" : "fail"; for (int i = 0; i < gameMax; i++) { grade[i]->hide(); } gradePaper->hide(); endScene->setImage("images/" + s + ".jpg"); endScene->setOnKeyboardCallback([](ScenePtr, KeyCode, bool) -> bool { endGame(); return true; }); return true; }); /* auto timer = Timer::create(10.0f); timer->setOnTimerCallback([=](TimerPtr)->bool { string s = (PFcount >= 3) ? "graduation" : "fail"; for (int i = 0; i < gameMax; i++) { grade[i]->hide(); } gradePaper->hide(); endScene->setImage("images/" + s + ".jpg"); endScene->setOnKeyboardCallback([](ScenePtr, int, bool) -> bool { endGame(); return true; }); return true; }); timer->start(); */ // 10초 동안 성적 보여주고 자동으로 졸업 장면으로 넘어감. 졸업 장면에서 키보드 클릭 시 게임 종료 return true; }); // 모든 게임을 완료했을 시 성적장면으로 이동 bangtal::startGame(startScene); }
28.352657
142
0.640825
[ "object" ]
a99a190a0bd0dc60582830af1be87c19662ce2dd
4,706
hpp
C++
src/AirPlaySlideshow.hpp
jdgordy/slideshow-apple-tv-bb10
968e0f0c07dad3a6f91804d69b470a5eb095aa24
[ "Apache-2.0" ]
null
null
null
src/AirPlaySlideshow.hpp
jdgordy/slideshow-apple-tv-bb10
968e0f0c07dad3a6f91804d69b470a5eb095aa24
[ "Apache-2.0" ]
null
null
null
src/AirPlaySlideshow.hpp
jdgordy/slideshow-apple-tv-bb10
968e0f0c07dad3a6f91804d69b470a5eb095aa24
[ "Apache-2.0" ]
null
null
null
#ifndef AIRPLAYSLIDESHOW_HPP_ #define AIRPLAYSLIDESHOW_HPP_ #include <QtCore/QObject> #include <QtCore/QStringList> #include <QtCore/QVariantList> #include <QtCore/QVariantMap> #include <QtNetwork/QHostInfo> #include <bb/system/InvokeManager> #include <bb/system/InvokeRequest> #include "BonjourRecord.hpp" #include "dns_sd.h" // Forward class declarations namespace bb { namespace cascades { class Application; class DataModel; class ArrayDataModel; class LocaleHandler; } } class BonjourBrowser; class BonjourResolver; class AirPlayDevice; class DevicePropertiesViewer; class SlideshowViewer; class QTranslator; // // AirPlaySlideshow // class AirPlaySlideshow : public QObject { Q_OBJECT // The model that provides the list of service records Q_PROPERTY(bb::cascades::DataModel* recordListModel READ recordListModel NOTIFY recordListModelChanged); // The model that provides the list of files Q_PROPERTY(bb::cascades::DataModel* fileListModel READ fileListModel NOTIFY fileListModelChanged); // The currently selected device Q_PROPERTY(AirPlayDevice* device READ device NOTIFY deviceChanged); // The viewer object for the current device Q_PROPERTY(DevicePropertiesViewer* devicePropertiesViewer READ devicePropertiesViewer CONSTANT); // The slideshow viewer object Q_PROPERTY(SlideshowViewer* slideshowViewer READ slideshowViewer CONSTANT); public: // Constructor / destructor AirPlaySlideshow(bb::cascades::Application* app); virtual ~AirPlaySlideshow(); // Set or retrieve configuration parameters Q_INVOKABLE void setParameter(const QString& parameter, const QString& value); Q_INVOKABLE QString getParameter(const QString& parameter, const QString& defaultValue); // Set device and trigger resolution Q_INVOKABLE void setDevice(const QVariantList& indexPath); // Add item(s) to slideshow file list Q_INVOKABLE void addFileList(const QStringList& fileList); // Remove one or multiple items from slideshow file list Q_INVOKABLE void removeFiles(const QVariantList& selectionList); // Launch file viewer for preview Q_INVOKABLE void viewFile(const QVariantList& indexPath); // Set password Q_INVOKABLE void setPassword(const QString& password); // Set slideshow transition Q_INVOKABLE void setTransition(int transition); // View device record Q_INVOKABLE void viewDevice(const QVariantList& indexPath); // Configure slideshow Q_INVOKABLE void configureSlideshow(); Q_SIGNALS: // Property change notification signals void deviceChanged(); void recordListModelChanged(); void fileListModelChanged(); protected Q_SLOTS: // Handler for browser replies void handleBrowserRecordsChanged(const QList<BonjourRecord>& recordList); // Handler for resolver replies void handleRecordResolved(const QString& fullName, const QHostInfo& hostInfo, int port, const QVariantMap& txtRecord); // Handler for error replies void handleError(DNSServiceErrorType err); // Handler for invocation messages void handleInvoke(const bb::system::InvokeRequest& request); // Handler for system language change event void handleSystemLanguageChanged(); protected: // Add item to file list, checking for duplicates void addFileEntry(const QVariantMap& entry); // Remove item from file list void removeFile(const QVariantList& indexPath); // Property accessor methods bb::cascades::DataModel* recordListModel() const; bb::cascades::DataModel* fileListModel() const; AirPlayDevice* device() const; DevicePropertiesViewer* devicePropertiesViewer() const; SlideshowViewer* slideshowViewer() const; // Property values bb::cascades::ArrayDataModel* m_pRecordListModel; bb::cascades::ArrayDataModel* m_pFileListModel; AirPlayDevice* m_pDevice; DevicePropertiesViewer* m_pDevicePropertiesViewer; SlideshowViewer* m_pSlideshowViewer; // Invocation manager bb::system::InvokeManager* m_pInvokeManager; // Slideshow properties QString m_password; int m_transition; // Bonjour service browser and resolver BonjourBrowser* m_pBrowser; BonjourResolver* m_pResolver; // Translator and locale handler objects QTranslator* m_pTranslator; bb::cascades::LocaleHandler* m_pLocaleHandler; }; #endif /* AIRPLAYSLIDESHOW_HPP_ */
31.165563
123
0.711007
[ "object", "model" ]
a99f6c57c98ad9fa1aee2055de952883e6558cc5
5,263
cpp
C++
src/DynamicTable.cpp
dmlys/QtTools
aaf9605a5dd9b01460c90641bb849bc9477e2fff
[ "BSL-1.0" ]
null
null
null
src/DynamicTable.cpp
dmlys/QtTools
aaf9605a5dd9b01460c90641bb849bc9477e2fff
[ "BSL-1.0" ]
null
null
null
src/DynamicTable.cpp
dmlys/QtTools
aaf9605a5dd9b01460c90641bb849bc9477e2fff
[ "BSL-1.0" ]
1
2019-02-12T09:33:48.000Z
2019-02-12T09:33:48.000Z
#include <QtTools/DynamicTable.hqt> #include <QtWidgets/QApplication> #include <QtWidgets/QTableView> #include <QtWidgets/QPushButton> #include <QtGui/QKeyEvent> namespace QtTools { void DynamicTable::OnUpItem() { auto idx = m_view->selectionModel()->currentIndex(); if (!idx.isValid() || idx.row() == 0) return; m_model->moveRow(idx.parent(), idx.row(), idx.parent(), idx.row() - 1); } void DynamicTable::OnDownItem() { auto idx = m_view->selectionModel()->currentIndex(); if (!idx.isValid() || idx.row() == m_model->rowCount() - 1) return; m_model->moveRow(idx.parent(), idx.row(), idx.parent(), idx.row() + 2); } void DynamicTable::OnNewItem() { auto rc = m_model->rowCount(); m_model->insertRow(rc); } void DynamicTable::OnDeleteItem() { auto idx = m_view->selectionModel()->currentIndex(); if (!idx.isValid()) return; m_model->removeRow(idx.row()); } void DynamicTable::OnDialogButtonClick(QAbstractButton * button) { if (m_buttonBox->standardButton(button) == QDialogButtonBox::Reset) Q_EMIT Reset(); else if (m_buttonBox->standardButton(button) == QDialogButtonBox::Apply) Q_EMIT Apply(); else if (m_buttonBox->standardButton(button) == QDialogButtonBox::Ok) { Q_EMIT Apply(); close(); Q_EMIT Closed(); } else if (m_buttonBox->standardButton(button) == QDialogButtonBox::Close) { //ResetAction(); close(); Q_EMIT Closed(); } } void DynamicTable::Init() { setupUi(); retranslateUi(); connectSignals(); } DynamicTable::DynamicTable(QWidget * parent /* = nullptr */) : QWidget(parent) { } DynamicTable::DynamicTable(QAbstractItemModel * model, QWidget * parent /* = nullptr */) : QWidget(parent) { m_model = model; m_view = new QTableView(this); m_view->setModel(m_model); Init(); } void DynamicTable::connectSignals() { connect(m_buttonBox, &QDialogButtonBox::clicked, this, &DynamicTable::OnDialogButtonClick); connect(m_newEntryButton, &QToolButton::clicked, this, &DynamicTable::OnNewItem); connect(m_deleteEntryButton, &QToolButton::clicked, this, &DynamicTable::OnDeleteItem); connect(m_upEntryButton, &QToolButton::clicked, this, &DynamicTable::OnUpItem); connect(m_downEntryButton, &QToolButton::clicked, this, &DynamicTable::OnDownItem); } void DynamicTable::setupUi() { if (objectName().isEmpty()) setObjectName(QStringLiteral("DynamicTableBase")); // main layout m_verticalLayout = new QVBoxLayout(this); m_verticalLayout->setObjectName(QStringLiteral("verticalLayout")); {// create toolbar, spacer with 4 buttons m_horizontalLayout = new QHBoxLayout(); m_horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); m_verticalLayout->addLayout(m_horizontalLayout); m_horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); m_horizontalLayout->addItem(m_horizontalSpacer); // buttons m_newEntryButton = new QToolButton(this); m_newEntryButton->setObjectName(QStringLiteral("newEntryButton")); m_deleteEntryButton = new QToolButton(this); m_deleteEntryButton->setObjectName(QStringLiteral("deleteEntryButton")); m_upEntryButton = new QToolButton(this); m_upEntryButton->setObjectName(QStringLiteral("upEntryButton")); m_downEntryButton = new QToolButton(this); m_downEntryButton->setObjectName(QStringLiteral("downEntryButton")); //set icons QIcon icon; icon.addFile(QStringLiteral(":/icons/new_item.ico"), QSize(), QIcon::Normal, QIcon::Off); m_newEntryButton->setIcon(icon); QIcon icon1; icon1.addFile(QStringLiteral(":/icons/edit_delete.ico"), QSize(), QIcon::Normal, QIcon::Off); m_deleteEntryButton->setIcon(icon1); QIcon icon2; icon2.addFile(QStringLiteral(":/icons/arrow_up.ico"), QSize(), QIcon::Normal, QIcon::Off); m_upEntryButton->setIcon(icon2); QIcon icon3; icon3.addFile(QStringLiteral(":/icons/arrow_down.ico"), QSize(), QIcon::Normal, QIcon::Off); m_downEntryButton->setIcon(icon3); m_horizontalLayout->addWidget(m_newEntryButton); m_horizontalLayout->addWidget(m_deleteEntryButton); m_horizontalLayout->addWidget(m_upEntryButton); m_horizontalLayout->addWidget(m_downEntryButton); } m_verticalLayout->addWidget(m_view); m_buttonBox = new QDialogButtonBox(this); m_buttonBox->setObjectName(QStringLiteral("buttonBox")); m_buttonBox->setStandardButtons(QDialogButtonBox::Apply | QDialogButtonBox::Close | QDialogButtonBox::Ok | QDialogButtonBox::Reset); m_verticalLayout->addWidget(m_buttonBox); setFocusProxy(m_view); m_buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL + Qt::Key_Return); m_buttonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape); retranslateUi(); } void DynamicTable::retranslateUi() { m_newEntryButton->setToolTip(tr("Add new entry (Ctrl+Ins)")); m_newEntryButton->setShortcut(tr("Ctrl+Ins")); m_deleteEntryButton->setToolTip(tr("Delete current entry (Del)")); m_deleteEntryButton->setShortcut(tr("Del")); m_upEntryButton->setToolTip(tr("Move current entry up (Ctrl+Up)")); m_upEntryButton->setShortcut(tr("Ctrl+Up")); m_downEntryButton->setToolTip(tr("Move current entry down (Ctrl+Down)")); m_downEntryButton->setShortcut(tr("Ctrl+Down")); } }
31.51497
134
0.728482
[ "model" ]
a9a07d60c39c5302873a1d8f78d5368d7f0161a8
3,944
cc
C++
RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.cc
eric-moreno/cmssw
3dc2c26f276632ac8357ac7b52675f04649e3903
[ "Apache-2.0" ]
null
null
null
RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.cc
eric-moreno/cmssw
3dc2c26f276632ac8357ac7b52675f04649e3903
[ "Apache-2.0" ]
null
null
null
RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.cc
eric-moreno/cmssw
3dc2c26f276632ac8357ac7b52675f04649e3903
[ "Apache-2.0" ]
2
2019-09-27T08:33:22.000Z
2019-11-14T10:52:30.000Z
#include "DataFormats/Common/interface/Handle.h" #include "DataFormats/Common/interface/ValueMap.h" #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/InputTag.h" #include "RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.h" //////////////////////////////////////////////////////////////////////////////// // LowPtGsfElectronIDProducer::LowPtGsfElectronIDProducer(const edm::ParameterSet& conf, const lowptgsfeleid::HeavyObjectCache*) : gsfElectrons_(consumes<reco::GsfElectronCollection>(conf.getParameter<edm::InputTag>("electrons"))), rho_(consumes<double>(conf.getParameter<edm::InputTag>("rho"))), names_(conf.getParameter<std::vector<std::string> >("ModelNames")), passThrough_(conf.getParameter<bool>("PassThrough")), minPtThreshold_(conf.getParameter<double>("MinPtThreshold")), maxPtThreshold_(conf.getParameter<double>("MaxPtThreshold")) { for (const auto& name : names_) { produces<edm::ValueMap<float> >(name); } } //////////////////////////////////////////////////////////////////////////////// // LowPtGsfElectronIDProducer::~LowPtGsfElectronIDProducer() {} //////////////////////////////////////////////////////////////////////////////// // void LowPtGsfElectronIDProducer::produce(edm::Event& event, const edm::EventSetup& setup) { // Pileup edm::Handle<double> rho; event.getByToken(rho_, rho); if (!rho.isValid()) { edm::LogError("Problem with rho handle"); } // Retrieve GsfElectrons from Event edm::Handle<reco::GsfElectronCollection> gsfElectrons; event.getByToken(gsfElectrons_, gsfElectrons); if (!gsfElectrons.isValid()) { edm::LogError("Problem with gsfElectrons handle"); } // Iterate through Electrons, evaluate BDT, and store result std::vector<std::vector<float> > output; for (unsigned int iname = 0; iname < names_.size(); ++iname) { output.push_back(std::vector<float>(gsfElectrons->size(), -999.)); } for (unsigned int iele = 0; iele < gsfElectrons->size(); iele++) { reco::GsfElectronRef ele(gsfElectrons, iele); //if ( !passThrough_ && ( ele->pt() < minPtThreshold_ ) ) { continue; } for (unsigned int iname = 0; iname < names_.size(); ++iname) { output[iname][iele] = globalCache()->eval(names_[iname], ele, *rho); } } // Create and put ValueMap in Event for (unsigned int iname = 0; iname < names_.size(); ++iname) { auto ptr = std::make_unique<edm::ValueMap<float> >(edm::ValueMap<float>()); edm::ValueMap<float>::Filler filler(*ptr); filler.insert(gsfElectrons, output[iname].begin(), output[iname].end()); filler.fill(); reco::GsfElectronRef ele(gsfElectrons, 0); event.put(std::move(ptr), names_[iname]); } } ////////////////////////////////////////////////////////////////////////////////////////// // void LowPtGsfElectronIDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add<edm::InputTag>("electrons", edm::InputTag("lowPtGsfElectrons")); desc.add<edm::InputTag>("rho", edm::InputTag("fixedGridRhoFastjetAllTmp")); desc.add<std::vector<std::string> >("ModelNames", std::vector<std::string>()); desc.add<std::vector<std::string> >("ModelWeights", std::vector<std::string>()); desc.add<std::vector<double> >("ModelThresholds", std::vector<double>()); desc.add<bool>("PassThrough", false); desc.add<double>("MinPtThreshold", 0.5); desc.add<double>("MaxPtThreshold", 15.); descriptions.add("defaultLowPtGsfElectronID", desc); } ////////////////////////////////////////////////////////////////////////////////////////// // #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(LowPtGsfElectronIDProducer);
44.818182
106
0.630325
[ "vector" ]
a9a753bf33b02a0ede917b5b28db90a776fa5836
10,647
cpp
C++
gcommon/source/gmeshinstancemodifiermorph.cpp
DavidCoenFish/ancient-code-0
243fb47b9302a77f9b9392b6e3f90bba2ef3c228
[ "Unlicense" ]
null
null
null
gcommon/source/gmeshinstancemodifiermorph.cpp
DavidCoenFish/ancient-code-0
243fb47b9302a77f9b9392b6e3f90bba2ef3c228
[ "Unlicense" ]
null
null
null
gcommon/source/gmeshinstancemodifiermorph.cpp
DavidCoenFish/ancient-code-0
243fb47b9302a77f9b9392b6e3f90bba2ef3c228
[ "Unlicense" ]
null
null
null
// // GMeshInstanceModifierMorph.cpp // // Created by David Coen on 2011 03 08 // Copyright 2010 Pleasure seeking morons. All rights reserved. // #include "GMeshInstanceModifierMorph.h" #include "GMesh.h" #include "GMeshModifier.h" #include "GMeshModifierMorph.h" #include "GMeshModifierMorphTarget.h" #include "GMeshModifierMorphTargetStream.h" #include "GMeshVertexData.h" #include "GMath.h" #include "GMeshStreamInfo.h" #include "GCommon.h" #include "GSkeletonInstance.h" #include "GScratchPadLock.h" typedef std::vector<int> TArrayInt; static const bool LocalTestWriteToThisStream( const int in_streamIndex, const TArrayInt& in_arraySkeletonMorphTargetIndex, const GSkeletonInstance& in_skeletonInstance, const GMeshModifierMorph& in_morphLoad ) { const int count = in_arraySkeletonMorphTargetIndex.size(); for (int index = 0; index < count; ++index) { const float weight = in_skeletonInstance.GetMorphTargetWeight(in_arraySkeletonMorphTargetIndex[index]); if (!weight) { continue; } if (in_morphLoad.GetArrayTarget()[index].GetArrayStream()[in_streamIndex].GetArrayDuplicateTableOffsetCount()) { return true; } } return false; } static const int LocalGetStreamsToWrite( const int in_streamCount, const TArrayInt& in_arraySkeletonMorphTargetIndex, const GSkeletonInstance& in_skeletonInstance, const GMeshModifierMorph& in_morphLoad ) { int flag = 0; for (int index = 0; index < in_streamCount; ++index) { if (LocalTestWriteToThisStream( index, in_arraySkeletonMorphTargetIndex, in_skeletonInstance, in_morphLoad )) { flag |= (1 << index); } } return flag; } static void LocalMorphValue( unsigned char* const in_pDestination, const unsigned char* const in_pSource, const int in_vertexDataOffset, const int in_vertexDataSize, const float in_weight, const unsigned char* const in_pMorphSource, const GMeshStreamInfo& in_streamInfoLoad ) { const int count = in_streamInfoLoad.GetCount(); switch (in_streamInfoLoad.GetType()) { default: break; case GMeshType::TStreamType::TByte: case GMeshType::TStreamType::TUnsignedByte: { for (int index = 0; index < count; ++index) { unsigned char& destinationValue = *(unsigned char*)(in_pDestination + in_vertexDataOffset + (sizeof(unsigned char) * index)); const unsigned char originalValue = *(unsigned char*)(in_pSource + in_vertexDataOffset + (sizeof(unsigned char) * index)); const unsigned char morphValue = *(unsigned char*)(in_pMorphSource + (sizeof(unsigned char) * index)); destinationValue = (unsigned char)GMath::Clamp(GMath::Lerp(in_weight, destinationValue, morphValue - originalValue), 0, 255); } } break; case GMeshType::TStreamType::TFloat: { for (int index = 0; index < count; ++index) { float& destinationValue = *(float*)(in_pDestination + in_vertexDataOffset + (sizeof(float) * index)); const float originalValue = *(float*)(in_pSource + in_vertexDataOffset + (sizeof(float) * index)); const float morphValue = *(float*)(in_pMorphSource + (sizeof(float) * index)); destinationValue += GMath::Lerp(in_weight, 0.0F, morphValue - originalValue); } } break; case GMeshType::TStreamType::TInt: case GMeshType::TStreamType::TUnsignedInt: { for (int index = 0; index < count; ++index) { int& destinationValue = *(int*)(in_pDestination + in_vertexDataOffset + (sizeof(int) * index)); const int originalValue = *(int*)(in_pSource + in_vertexDataOffset + (sizeof(int) * index)); const int morphValue = *(int*)(in_pMorphSource + (sizeof(int) * index)); destinationValue += GMath::Lerp(in_weight, 0, morphValue - originalValue); } } break; } return; } static void LocalApplyMorphVertexStream( GMeshVertexData& inout_vertexData, const unsigned char* const in_pSource, const float in_weight, const int in_elementCount, const int* const in_arrayElement, const GMeshModifierMorphTargetStream& in_streamLoad, const int in_streamLoadIndex, const GMesh& in_meshLoad, const int in_streamIndex ) { const GMeshStreamInfo& streamInfoLoad = in_meshLoad.GetArrayStreamInfo()[in_streamIndex]; const int vertexDataOffset = (in_meshLoad.GetVertexByteStride() * in_arrayElement[0]) + streamInfoLoad.GetVertexDataByteOffset(); const int vertexDataSize = GMeshType::GetSize(streamInfoLoad.GetType()) * streamInfoLoad.GetCount(); unsigned char* const pDestination = (unsigned char* const)inout_vertexData.GetData(); unsigned char* const pMorphSource = ((unsigned char*)in_streamLoad.GetStreamData()) + (vertexDataSize * in_streamLoadIndex); LocalMorphValue( pDestination, in_pSource, vertexDataOffset, vertexDataSize, in_weight, pMorphSource, streamInfoLoad ); //apply duplicates for (int index = 1; index < in_elementCount; ++index) { const int duplicateDataOffset = (in_meshLoad.GetVertexByteStride() * in_arrayElement[index]) + streamInfoLoad.GetVertexDataByteOffset(); memcpy(pDestination + duplicateDataOffset, pDestination + vertexDataOffset, vertexDataSize); } return; } static void LocalApplyStream( GMeshVertexData& inout_vertexData, const int in_flagWrittenStreams, const int in_streamIndex, const GMesh& in_meshLoad, const GSkeletonInstance& in_skeletonInstance, const TArrayInt& in_arraySkeletonMorphTargetIndex, const GMeshModifierMorph& in_morphLoad, unsigned char* const in_scratchPad = 0 ) { const unsigned char* pSource = 0; const bool streamWritten = (0 != (in_flagWrittenStreams & (1 << in_streamIndex))); if (streamWritten) { pSource = in_scratchPad; } else { pSource = (unsigned char*)in_meshLoad.GetVertexData(); } const int targetCount = (int)in_arraySkeletonMorphTargetIndex.size(); for (int targetIndex = 0; targetIndex < targetCount; ++targetIndex) { const float weight = in_skeletonInstance.GetMorphTargetWeight(in_arraySkeletonMorphTargetIndex[targetIndex]); if (!weight) { continue; } const GMeshModifierMorphTarget& targetLoad = in_morphLoad.GetArrayTarget()[targetIndex]; const GMeshModifierMorphTargetStream& streamLoad = targetLoad.GetArrayStream()[in_streamIndex]; const int duplicateTableOffsetCount = streamLoad.GetArrayDuplicateTableOffsetCount(); if (!duplicateTableOffsetCount) { continue; } const int* const arrayDuplicateTableOffset = streamLoad.GetArrayDuplicateTableOffset(); const int* const duplicateTable = targetLoad.GetDuplicateTable(); for (int duplicateTableOffsetIndex = 0; duplicateTableOffsetIndex < duplicateTableOffsetCount; ++duplicateTableOffsetIndex) { const int offset = arrayDuplicateTableOffset[duplicateTableOffsetIndex]; const int elementCount = duplicateTable[offset]; LocalApplyMorphVertexStream( inout_vertexData, pSource, weight, elementCount, &duplicateTable[offset + 1], streamLoad, duplicateTableOffsetIndex, in_meshLoad, in_streamIndex ); } } return; } //static public methods /*static*/ GMeshInstanceModifierMorph::TPointerRenderMeshInstanceModifierMorph GMeshInstanceModifierMorph::Factory( const GMesh& in_meshLoad, const int in_modifierIndex ) { TPointerRenderMeshInstanceModifierMorph pointer; const GMeshModifierMorph& modifierMorphLoad = in_meshLoad.GetArrayModifier()[in_modifierIndex].GetMorph(); pointer.reset(new GMeshInstanceModifierMorph( modifierMorphLoad.GetArrayTargetCount(), in_modifierIndex )); return pointer; } //constructor GMeshInstanceModifierMorph::GMeshInstanceModifierMorph( const int in_arrayMorphTargetCount, const int in_modifierIndex ) : GMeshInstanceModifier() , mModifierIndex(in_modifierIndex) , mSkeletonInstance() , mArraySkeletonMorphTargetIndex() { mArraySkeletonMorphTargetIndex.resize(in_arrayMorphTargetCount); for (int index = 0; index < in_arrayMorphTargetCount; ++index) { mArraySkeletonMorphTargetIndex[index] = GCOMMON_INVALID_INDEX; } return; } GMeshInstanceModifierMorph::~GMeshInstanceModifierMorph() { return; } //implement GMeshInstanceModifier /*virtual*/ void GMeshInstanceModifierMorph::OnTickApplyModifier( GMeshVertexData& inout_vertexData, int& inout_flagWrittenStreams, const float in_timeDelta, const GMesh& in_meshLoad, GSceneNode& in_sceneNode ) { const GMeshModifierMorph& modifierMorphLoad = in_meshLoad.GetArrayModifier()[mModifierIndex].GetMorph(); TPointerSkeletonInstance pointerSkeletonInstance = mSkeletonInstance.lock(); if (!pointerSkeletonInstance) { return; } const GSkeletonInstance& skeletonInstance = *pointerSkeletonInstance; const int streamToWriteFlag = LocalGetStreamsToWrite( in_meshLoad.GetStreamInfoCount(), mArraySkeletonMorphTargetIndex, skeletonInstance, modifierMorphLoad ); if (!streamToWriteFlag) { //nothing to do here, move along return; } const GMeshModifierMorph& morphLoad = in_meshLoad.GetArrayModifier()[mModifierIndex].GetMorph(); if (0 != (streamToWriteFlag & inout_flagWrittenStreams)) { //we need to make a copy of inout_vertexData else source will be overwritten // rather than muck about with element_count * stream_count copies, just copy it all const int size = in_meshLoad.GetVertexDataByteSize(); GScratchPadLock<unsigned char> scatchpad(size); unsigned char* const pScatchpad = scatchpad.GetMemory(); memcpy(pScatchpad, inout_vertexData.GetData(), size); for (int index = 0; index < in_meshLoad.GetStreamInfoCount(); ++index) { if (0 == (streamToWriteFlag & (1 << index))) { continue; } LocalApplyStream( inout_vertexData, inout_flagWrittenStreams, index, in_meshLoad, skeletonInstance, mArraySkeletonMorphTargetIndex, morphLoad, pScatchpad ); } } else { for (int index = 0; index < in_meshLoad.GetStreamInfoCount(); ++index) { if (0 == (streamToWriteFlag & (1 << index))) { continue; } LocalApplyStream( inout_vertexData, inout_flagWrittenStreams, index, in_meshLoad, skeletonInstance, mArraySkeletonMorphTargetIndex, morphLoad, 0 ); } } inout_flagWrittenStreams |= streamToWriteFlag; return; } //public accessors void GMeshInstanceModifierMorph::SetSkeletonInstance( TPointerSkeletonInstance& inout_skeletonInstance, const GMesh& in_meshLoad ) { mSkeletonInstance = inout_skeletonInstance; if (inout_skeletonInstance) { const GMeshModifierMorph& morphLoad = in_meshLoad.GetArrayModifier()[mModifierIndex].GetMorph(); for (int index = 0; index < (int)morphLoad.GetArrayTargetCount(); ++index) { mArraySkeletonMorphTargetIndex[index] = inout_skeletonInstance->GetMorphTargetIndex(morphLoad.GetArrayTarget()[index].GetTargetName()); } } return; }
28.775676
138
0.758148
[ "vector" ]
a9aab56faf97356c9fcc208ffd26088cbd0593c1
2,703
hpp
C++
source/plc/include/document/NEAREST_INTEGER.hpp
dlin172/Plange
4b36a1225b2263bc8d38a6d1cc9b50c3d4b58e04
[ "BSD-3-Clause" ]
null
null
null
source/plc/include/document/NEAREST_INTEGER.hpp
dlin172/Plange
4b36a1225b2263bc8d38a6d1cc9b50c3d4b58e04
[ "BSD-3-Clause" ]
null
null
null
source/plc/include/document/NEAREST_INTEGER.hpp
dlin172/Plange
4b36a1225b2263bc8d38a6d1cc9b50c3d4b58e04
[ "BSD-3-Clause" ]
null
null
null
// This file was generated using Parlex's cpp_generator #ifndef INCLUDED_NEAREST_INTEGER_HPP #define INCLUDED_NEAREST_INTEGER_HPP #include <optional> #include <variant> #include <vector> #include "erased.hpp" #include "parlex/detail/abstract_syntax_tree.hpp" #include "parlex/detail/builtins.hpp" #include "parlex/detail/document.hpp" #include "plange_grammar.hpp" namespace plc { struct EXPRESSION; struct IC; struct NEAREST_INTEGER_1_t { parlex::detail::document::text<literal_0xE20x8C0x8A_t> dontCare0; std::vector<erased<IC>> field_1; erased<EXPRESSION> field_2; std::vector<erased<IC>> field_3; parlex::detail::document::text<literal_0xE20x8C0x89_t> dontCare4; explicit NEAREST_INTEGER_1_t( parlex::detail::document::text<literal_0xE20x8C0x8A_t> && dontCare0, std::vector<erased<IC>> && field_1, erased<EXPRESSION> && field_2, std::vector<erased<IC>> && field_3, parlex::detail::document::text<literal_0xE20x8C0x89_t> && dontCare4) : dontCare0(std::move(dontCare0)), field_1(std::move(field_1)), field_2(std::move(field_2)), field_3(std::move(field_3)), dontCare4(std::move(dontCare4)) {} NEAREST_INTEGER_1_t(NEAREST_INTEGER_1_t const & other) = default; NEAREST_INTEGER_1_t(NEAREST_INTEGER_1_t && move) = default; static NEAREST_INTEGER_1_t build(parlex::detail::node const * b, parlex::detail::document::walk & w); }; struct NEAREST_INTEGER_2_t { parlex::detail::document::text<literal_0x7C__t> dontCare0; std::vector<erased<IC>> field_1; erased<EXPRESSION> field_2; std::vector<erased<IC>> field_3; parlex::detail::document::text<literal_0x270x7C_t> dontCare4; explicit NEAREST_INTEGER_2_t( parlex::detail::document::text<literal_0x7C__t> && dontCare0, std::vector<erased<IC>> && field_1, erased<EXPRESSION> && field_2, std::vector<erased<IC>> && field_3, parlex::detail::document::text<literal_0x270x7C_t> && dontCare4) : dontCare0(std::move(dontCare0)), field_1(std::move(field_1)), field_2(std::move(field_2)), field_3(std::move(field_3)), dontCare4(std::move(dontCare4)) {} NEAREST_INTEGER_2_t(NEAREST_INTEGER_2_t const & other) = default; NEAREST_INTEGER_2_t(NEAREST_INTEGER_2_t && move) = default; static NEAREST_INTEGER_2_t build(parlex::detail::node const * b, parlex::detail::document::walk & w); }; typedef std::variant< NEAREST_INTEGER_1_t, NEAREST_INTEGER_2_t > NEAREST_INTEGER_base; struct NEAREST_INTEGER: NEAREST_INTEGER_base { static NEAREST_INTEGER build(parlex::detail::ast_node const & n); explicit NEAREST_INTEGER(NEAREST_INTEGER_base const & value) : NEAREST_INTEGER_base(value) {} static parlex::detail::state_machine const & state_machine(); }; } // namespace plc #endif //INCLUDED_NEAREST_INTEGER_HPP
32.963415
399
0.764706
[ "vector" ]
a9b1ef2c07fa1db7a7ab6a6a822e92d9c0510a38
4,645
cpp
C++
source/main-wav-player.cpp
zealotnt/gr-peach-2017-peach-board
2ad8cebcd9f776502265d65651b212c7e3248038
[ "MIT" ]
null
null
null
source/main-wav-player.cpp
zealotnt/gr-peach-2017-peach-board
2ad8cebcd9f776502265d65651b212c7e3248038
[ "MIT" ]
null
null
null
source/main-wav-player.cpp
zealotnt/gr-peach-2017-peach-board
2ad8cebcd9f776502265d65651b212c7e3248038
[ "MIT" ]
null
null
null
/* * @Author: zealotnt * @Date: 2017-09-27 10:45:02 * @Last Modified by: Tran Tam * @Last Modified time: 2017-09-27 10:47:06 */ #include <string> #include <vector> #include <map> #include "mbed.h" #include "http_request.h" #include "http_parser.h" #include "http_response.h" #include "http_request_builder.h" #include "http_response_parser.h" #include "http_parsed_url.h" #include "mbedtls/platform.h" #include "mbedtls/ssl.h" #include "mbedtls/entropy.h" #include "mbedtls/ctr_drbg.h" #include "mbedtls/error.h" #include "mbedtls/sha1.h" #include "TLV320_RBSP.h" #include "FATFileSystem.h" #include "USBHostMSD.h" #include "usb_host_setting.h" #include "dec_wav.h" #include "grUtility.h" #include "grHwSetup.h" static void callback_audio_write_end(void * p_data, int32_t result, void * p_app_data) { if (result < 0) { printf("audio write callback error %d\n", result); } } int main_wav_player() { printf("main_wav_player\r\n"); rbsp_data_conf_t audio_write_async_ctl = {&callback_audio_write_end, NULL}; FILE * fp = NULL; DIR * d = NULL; char file_path[sizeof(FLD_PATH) + FILE_NAME_LEN]; int buff_index = 0; size_t audio_data_size; dec_wav wav_file; TLV320_RBSP *audio = grAudio(); grEnableUSB1(); grEnableAudio(); grSetupUsb(); while(1) { // in a loop, append a file // if the device is disconnected, we try to connect it again while(1) { if (fp == NULL) { // file search if (d == NULL) { d = opendir(FLD_PATH); } struct dirent * p; while ((p = readdir(d)) != NULL) { size_t len = strlen(p->d_name); if ((len > 4) && (len < FILE_NAME_LEN) && (memcmp(&p->d_name[len - 4], ".wav", 4) == 0)) { strcpy(file_path, FLD_PATH); strcat(file_path, p->d_name); printf("Opening path: \"%s\"\r\n", file_path); fp = fopen(file_path, "r"); if (wav_file.AnalyzeHeder(title_buf, artist_buf, album_buf, TEXT_SIZE, fp) == false) { fclose(fp); fp = NULL; } else if ((wav_file.GetChannel() != 2) || (audio->format(wav_file.GetBlockSize()) == false) || (audio->frequency(wav_file.GetSamplingRate()) == false)) { printf("Error File :%s\n", p->d_name); printf("Audio Info :%dch, %dbit, %dHz\n", wav_file.GetChannel(), wav_file.GetBlockSize(), wav_file.GetSamplingRate()); printf("\n"); fclose(fp); fp = NULL; } else { printf("File :%s\n", p->d_name); printf("Audio Info :%dch, %dbit, %dHz\n", wav_file.GetChannel(), wav_file.GetBlockSize(), wav_file.GetSamplingRate()); printf("Title :%s\n", title_buf); printf("Artist :%s\n", artist_buf); printf("Album :%s\n", album_buf); printf("\n"); break; } } } if (p == NULL) { closedir(d); d = NULL; } } else { // file read uint8_t * p_buf = audio_write_buff[buff_index]; audio_data_size = wav_file.GetNextData(p_buf, AUDIO_WRITE_BUFF_SIZE); if (audio_data_size > 0) { audio->write(p_buf, audio_data_size, &audio_write_async_ctl); buff_index++; if (buff_index >= AUDIO_WRITE_BUFF_NUM) { buff_index = 0; } } // file close if (audio_data_size < AUDIO_WRITE_BUFF_SIZE) { fclose(fp); fp = NULL; Thread::wait(500); } } } // close check if (fp != NULL) { fclose(fp); fp = NULL; } if (d != NULL) { closedir(d); d = NULL; } } }
34.154412
93
0.453175
[ "vector" ]
a9b3a327cab2618e54ab9fedaceec78886a11f02
50,933
cpp
C++
proofs/signatures/signatures.cpp
FabianWolff/cvc4-debian
e38afe6cb10bdb79f0bae398b9605e4deae7578f
[ "BSL-1.0" ]
null
null
null
proofs/signatures/signatures.cpp
FabianWolff/cvc4-debian
e38afe6cb10bdb79f0bae398b9605e4deae7578f
[ "BSL-1.0" ]
null
null
null
proofs/signatures/signatures.cpp
FabianWolff/cvc4-debian
e38afe6cb10bdb79f0bae398b9605e4deae7578f
[ "BSL-1.0" ]
null
null
null
namespace CVC4 { namespace proof { extern const char *const plf_signatures; const char *const plf_signatures = "\ (declare bool type)\n\ (declare tt bool)\n\ (declare ff bool)\n\ \n\ (declare var type)\n\ \n\ (declare lit type)\n\ (declare pos (! x var lit))\n\ (declare neg (! x var lit))\n\ \n\ (declare clause type)\n\ (declare cln clause)\n\ (declare clc (! x lit (! c clause clause)))\n\ \n\ ; constructs for general clauses for R, Q, satlem\n\ \n\ (declare concat_cl (! c1 clause (! c2 clause clause)))\n\ (declare clr (! l lit (! c clause clause)))\n\ \n\ ; code to check resolutions\n\ \n\ (program append ((c1 clause) (c2 clause)) clause\n\ (match c1 (cln c2) ((clc l c1') (clc l (append c1' c2)))))\n\ \n\ ; we use marks as follows:\n\ ; -- mark 1 to record if we are supposed to remove a positive occurrence of the variable.\n\ ; -- mark 2 to record if we are supposed to remove a negative occurrence of the variable.\n\ ; -- mark 3 if we did indeed remove the variable positively\n\ ; -- mark 4 if we did indeed remove the variable negatively\n\ (program simplify_clause ((c clause)) clause\n\ (match c\n\ (cln cln)\n\ ((clc l c1)\n\ (match l\n\ ; Set mark 1 on v if it is not set, to indicate we should remove it.\n\ ; After processing the rest of the clause, set mark 3 if we were already\n\ ; supposed to remove v (so if mark 1 was set when we began). Clear mark3\n\ ; if we were not supposed to be removing v when we began this call.\n\ ((pos v)\n\ (let m (ifmarked v tt (do (markvar v) ff))\n\ (let c' (simplify_clause c1)\n\ (match m\n\ (tt (do (ifmarked3 v v (markvar3 v)) c'))\n\ (ff (do (ifmarked3 v (markvar3 v) v) (markvar v) (clc l c')))))))\n\ ; the same as the code for tt, but using different marks.\n\ ((neg v)\n\ (let m (ifmarked2 v tt (do (markvar2 v) ff))\n\ (let c' (simplify_clause c1)\n\ (match m\n\ (tt (do (ifmarked4 v v (markvar4 v)) c'))\n\ (ff (do (ifmarked4 v (markvar4 v) v) (markvar2 v) (clc l c')))))))))\n\ ((concat_cl c1 c2) (append (simplify_clause c1) (simplify_clause c2)))\n\ ((clr l c1)\n\ (match l\n\ ; set mark 1 to indicate we should remove v, and fail if\n\ ; mark 3 is not set after processing the rest of the clause\n\ ; (we will set mark 3 if we remove a positive occurrence of v).\n\ ((pos v)\n\ (let m (ifmarked v tt (do (markvar v) ff))\n\ (let m3 (ifmarked3 v (do (markvar3 v) tt) ff)\n\ (let c' (simplify_clause c1)\n\ (ifmarked3 v (do (match m3 (tt v) (ff (markvar3 v)))\n\ (match m (tt v) (ff (markvar v))) c')\n\ (fail clause))))))\n\ ; same as the tt case, but with different marks.\n\ ((neg v)\n\ (let m2 (ifmarked2 v tt (do (markvar2 v) ff))\n\ (let m4 (ifmarked4 v (do (markvar4 v) tt) ff)\n\ (let c' (simplify_clause c1)\n\ (ifmarked4 v (do (match m4 (tt v) (ff (markvar4 v)))\n\ (match m2 (tt v) (ff (markvar2 v))) c')\n\ (fail clause))))))\n\ ))))\n\ \n\ \n\ ; resolution proofs\n\ \n\ (declare holds (! c clause type))\n\ \n\ (declare R (! c1 clause (! c2 clause\n\ (! u1 (holds c1)\n\ (! u2 (holds c2)\n\ (! n var\n\ (holds (concat_cl (clr (pos n) c1)\n\ (clr (neg n) c2)))))))))\n\ \n\ (declare Q (! c1 clause (! c2 clause\n\ (! u1 (holds c1)\n\ (! u2 (holds c2)\n\ (! n var\n\ (holds (concat_cl (clr (neg n) c1)\n\ (clr (pos n) c2)))))))))\n\ \n\ (declare satlem_simplify\n\ (! c1 clause\n\ (! c2 clause\n\ (! c3 clause\n\ (! u1 (holds c1)\n\ (! r (^ (simplify_clause c1) c2)\n\ (! u2 (! x (holds c2) (holds c3))\n\ (holds c3))))))))\n\ \n\ (declare satlem\n\ (! c clause\n\ (! c2 clause\n\ (! u (holds c)\n\ (! u2 (! v (holds c) (holds c2))\n\ (holds c2))))))\n\ \n\ ; A little example to demonstrate simplify_clause.\n\ ; It can handle nested clr's of both polarities,\n\ ; and correctly cleans up marks when it leaves a\n\ ; clr or clc scope. Uncomment and run with\n\ ; --show-runs to see it in action.\n\ ;\n\ ; (check\n\ ; (% v1 var\n\ ; (% u1 (holds (concat_cl (clr (neg v1) (clr (pos v1) (clc (pos v1) (clr (pos v1) (clc (pos v1) (clc (neg v1) cln))))))\n\ ; (clc (pos v1) (clc (pos v1) cln))))\n\ ; (satlem _ _ _ u1 (\\ x x))))))\n\ \n\ \n\ ;(check\n\ ; (% v1 var\n\ ; (% u1 (holds (clr (neg v1) (concat_cl (clc (neg v1) cln)\n\ ; (clr (neg v1) (clc (neg v1) cln)))))\n\ ; (satlem _ _ _ u1 (\\ x x))))))\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;\n\ ; SMT syntax and semantics (not theory-specific)\n\ ;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ; depends on sat.plf\n\ \n\ (declare formula type)\n\ (declare th_holds (! f formula type))\n\ \n\ ; standard logic definitions\n\ (declare true formula)\n\ (declare false formula)\n\ \n\ (define formula_op1\n\ (! f formula\n\ formula))\n\ \n\ (define formula_op2\n\ (! f1 formula\n\ (! f2 formula\n\ formula)))\n\ \n\ (define formula_op3\n\ (! f1 formula\n\ (! f2 formula\n\ (! f3 formula\n\ formula))))\n\ \n\ (declare not formula_op1)\n\ (declare and formula_op2)\n\ (declare or formula_op2)\n\ (declare impl formula_op2)\n\ (declare iff formula_op2)\n\ (declare xor formula_op2)\n\ (declare ifte formula_op3)\n\ \n\ ; terms\n\ (declare sort type)\n\ (declare term (! t sort type)) ; declared terms in formula\n\ \n\ ; standard definitions for =, ite, let and flet\n\ (declare = (! s sort\n\ (! x (term s)\n\ (! y (term s)\n\ formula))))\n\ (declare ite (! s sort\n\ (! f formula\n\ (! t1 (term s)\n\ (! t2 (term s)\n\ (term s))))))\n\ (declare let (! s sort\n\ (! t (term s)\n\ (! f (! v (term s) formula)\n\ formula))))\n\ (declare flet (! f1 formula\n\ (! f2 (! v formula formula)\n\ formula)))\n\ \n\ ; We view applications of predicates as terms of sort \"Bool\".\n\ ; Such terms can be injected as atomic formulas using \"p_app\".\n\ (declare Bool sort) ; the special sort for predicates\n\ (declare p_app (! x (term Bool) formula)) ; propositional application of term\n\ \n\ ; boolean terms\n\ (declare t_true (term Bool))\n\ (declare t_false (term Bool))\n\ (declare t_t_neq_f\n\ (th_holds (not (= Bool t_true t_false))))\n\ (declare pred_eq_t\n\ (! x (term Bool)\n\ (! u (th_holds (p_app x))\n\ (th_holds (= Bool x t_true)))))\n\ (declare pred_eq_f\n\ (! x (term Bool)\n\ (! u (th_holds (not (p_app x)))\n\ (th_holds (= Bool x t_false)))))\n\ \n\ (declare f_to_b\n\ (! f formula\n\ (term Bool)))\n\ \n\ (declare true_preds_equal\n\ (! x1 (term Bool)\n\ (! x2 (term Bool)\n\ (! u1 (th_holds (p_app x1))\n\ (! u2 (th_holds (p_app x2))\n\ (th_holds (= Bool x1 x2)))))))\n\ \n\ (declare false_preds_equal\n\ (! x1 (term Bool)\n\ (! x2 (term Bool)\n\ (! u1 (th_holds (not (p_app x1)))\n\ (! u2 (th_holds (not (p_app x2)))\n\ (th_holds (= Bool x1 x2)))))))\n\ \n\ (declare pred_refl_pos\n\ (! x1 (term Bool)\n\ (! u1 (th_holds (p_app x1))\n\ (th_holds (= Bool x1 x1)))))\n\ \n\ (declare pred_refl_neg\n\ (! x1 (term Bool)\n\ (! u1 (th_holds (not (p_app x1)))\n\ (th_holds (= Bool x1 x1)))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;\n\ ; CNF Clausification\n\ ;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ ; binding between an LF var and an (atomic) formula\n\ \n\ (declare atom (! v var (! p formula type)))\n\ \n\ ; binding between two LF vars\n\ (declare bvatom (! sat_v var (! bv_v var type)))\n\ \n\ (declare decl_atom\n\ (! f formula\n\ (! u (! v var\n\ (! a (atom v f)\n\ (holds cln)))\n\ (holds cln))))\n\ \n\ ;; declare atom enhanced with mapping\n\ ;; between SAT prop variable and BVSAT prop variable\n\ (declare decl_bvatom\n\ (! f formula\n\ (! u (! v var\n\ (! bv_v var\n\ (! a (atom v f)\n\ (! bva (atom bv_v f)\n\ (! vbv (bvatom v bv_v)\n\ (holds cln))))))\n\ (holds cln))))\n\ \n\ \n\ ; clausify a formula directly\n\ (declare clausify_form\n\ (! f formula\n\ (! v var\n\ (! a (atom v f)\n\ (! u (th_holds f)\n\ (holds (clc (pos v) cln)))))))\n\ \n\ (declare clausify_form_not\n\ (! f formula\n\ (! v var\n\ (! a (atom v f)\n\ (! u (th_holds (not f))\n\ (holds (clc (neg v) cln)))))))\n\ \n\ (declare clausify_false\n\ (! u (th_holds false)\n\ (holds cln)))\n\ \n\ (declare th_let_pf\n\ (! f formula\n\ (! u (th_holds f)\n\ (! u2 (! v (th_holds f) (holds cln))\n\ (holds cln)))))\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;\n\ ; Natural deduction rules : used for CNF\n\ ;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ ;; for eager bit-blasting\n\ (declare iff_symm\n\ (! f formula\n\ (th_holds (iff f f))))\n\ \n\ \n\ ;; contradiction\n\ \n\ (declare contra\n\ (! f formula\n\ (! r1 (th_holds f)\n\ (! r2 (th_holds (not f))\n\ (th_holds false)))))\n\ \n\ ; truth\n\ (declare truth (th_holds true))\n\ \n\ ;; not not\n\ \n\ (declare not_not_intro\n\ (! f formula\n\ (! u (th_holds f)\n\ (th_holds (not (not f))))))\n\ \n\ (declare not_not_elim\n\ (! f formula\n\ (! u (th_holds (not (not f)))\n\ (th_holds f))))\n\ \n\ ;; or elimination\n\ \n\ (declare or_elim_1\n\ (! f1 formula\n\ (! f2 formula\n\ (! u1 (th_holds (not f1))\n\ (! u2 (th_holds (or f1 f2))\n\ (th_holds f2))))))\n\ \n\ (declare or_elim_2\n\ (! f1 formula\n\ (! f2 formula\n\ (! u1 (th_holds (not f2))\n\ (! u2 (th_holds (or f1 f2))\n\ (th_holds f1))))))\n\ \n\ (declare not_or_elim\n\ (! f1 formula\n\ (! f2 formula\n\ (! u2 (th_holds (not (or f1 f2)))\n\ (th_holds (and (not f1) (not f2)))))))\n\ \n\ ;; and elimination\n\ \n\ (declare and_elim_1\n\ (! f1 formula\n\ (! f2 formula\n\ (! u (th_holds (and f1 f2))\n\ (th_holds f1)))))\n\ \n\ (declare and_elim_2\n\ (! f1 formula\n\ (! f2 formula\n\ (! u (th_holds (and f1 f2))\n\ (th_holds f2)))))\n\ \n\ (declare not_and_elim\n\ (! f1 formula\n\ (! f2 formula\n\ (! u2 (th_holds (not (and f1 f2)))\n\ (th_holds (or (not f1) (not f2)))))))\n\ \n\ ;; impl elimination\n\ \n\ (declare impl_intro (! f1 formula\n\ (! f2 formula\n\ (! i1 (! u (th_holds f1)\n\ (th_holds f2))\n\ (th_holds (impl f1 f2))))))\n\ \n\ (declare impl_elim\n\ (! f1 formula\n\ (! f2 formula\n\ (! u2 (th_holds (impl f1 f2))\n\ (th_holds (or (not f1) f2))))))\n\ \n\ (declare not_impl_elim\n\ (! f1 formula\n\ (! f2 formula\n\ (! u (th_holds (not (impl f1 f2)))\n\ (th_holds (and f1 (not f2)))))))\n\ \n\ ;; iff elimination\n\ \n\ (declare iff_elim_1\n\ (! f1 formula\n\ (! f2 formula\n\ (! u1 (th_holds (iff f1 f2))\n\ (th_holds (or (not f1) f2))))))\n\ \n\ (declare iff_elim_2\n\ (! f1 formula\n\ (! f2 formula\n\ (! u1 (th_holds (iff f1 f2))\n\ (th_holds (or f1 (not f2)))))))\n\ \n\ (declare not_iff_elim\n\ (! f1 formula\n\ (! f2 formula\n\ (! u2 (th_holds (not (iff f1 f2)))\n\ (th_holds (iff f1 (not f2)))))))\n\ \n\ ; xor elimination\n\ \n\ (declare xor_elim_1\n\ (! f1 formula\n\ (! f2 formula\n\ (! u1 (th_holds (xor f1 f2))\n\ (th_holds (or (not f1) (not f2)))))))\n\ \n\ (declare xor_elim_2\n\ (! f1 formula\n\ (! f2 formula\n\ (! u1 (th_holds (xor f1 f2))\n\ (th_holds (or f1 f2))))))\n\ \n\ (declare not_xor_elim\n\ (! f1 formula\n\ (! f2 formula\n\ (! u2 (th_holds (not (xor f1 f2)))\n\ (th_holds (iff f1 f2))))))\n\ \n\ ;; ite elimination\n\ \n\ (declare ite_elim_1\n\ (! a formula\n\ (! b formula\n\ (! c formula\n\ (! u2 (th_holds (ifte a b c))\n\ (th_holds (or (not a) b)))))))\n\ \n\ (declare ite_elim_2\n\ (! a formula\n\ (! b formula\n\ (! c formula\n\ (! u2 (th_holds (ifte a b c))\n\ (th_holds (or a c)))))))\n\ \n\ (declare ite_elim_3\n\ (! a formula\n\ (! b formula\n\ (! c formula\n\ (! u2 (th_holds (ifte a b c))\n\ (th_holds (or b c)))))))\n\ \n\ (declare not_ite_elim_1\n\ (! a formula\n\ (! b formula\n\ (! c formula\n\ (! u2 (th_holds (not (ifte a b c)))\n\ (th_holds (or (not a) (not b))))))))\n\ \n\ (declare not_ite_elim_2\n\ (! a formula\n\ (! b formula\n\ (! c formula\n\ (! u2 (th_holds (not (ifte a b c)))\n\ (th_holds (or a (not c))))))))\n\ \n\ (declare not_ite_elim_3\n\ (! a formula\n\ (! b formula\n\ (! c formula\n\ (! u2 (th_holds (not (ifte a b c)))\n\ (th_holds (or (not b) (not c))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;\n\ ; For theory lemmas\n\ ; - make a series of assumptions and then derive a contradiction (or false)\n\ ; - then the assumptions yield a formula like \"v1 -> v2 -> ... -> vn -> false\"\n\ ; - In CNF, it becomes a clause: \"~v1, ~v2, ..., ~vn\"\n\ ;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (declare ast\n\ (! v var\n\ (! f formula\n\ (! C clause\n\ (! r (atom v f) ;this is specified\n\ (! u (! o (th_holds f)\n\ (holds C))\n\ (holds (clc (neg v) C))))))))\n\ \n\ (declare asf\n\ (! v var\n\ (! f formula\n\ (! C clause\n\ (! r (atom v f)\n\ (! u (! o (th_holds (not f))\n\ (holds C))\n\ (holds (clc (pos v) C))))))))\n\ \n\ ;; Bitvector lemma constructors to assume\n\ ;; the unit clause containing the assumptions\n\ ;; it also requires the mapping between bv_v and v\n\ ;; The resolution proof proving false will use bv_v as the definition clauses use bv_v\n\ ;; but the Problem clauses in the main SAT solver will use v so the learned clause is in terms of v\n\ (declare bv_asf\n\ (! v var\n\ (! bv_v var\n\ (! f formula\n\ (! C clause\n\ (! r (atom v f) ;; passed in\n\ (! x (bvatom v bv_v) ; establishes the equivalence of v to bv_\n\ (! u (! o (holds (clc (neg bv_v) cln)) ;; l binding to be used in proof\n\ (holds C))\n\ (holds (clc (pos v) C))))))))))\n\ \n\ (declare bv_ast\n\ (! v var\n\ (! bv_v var\n\ (! f formula\n\ (! C clause\n\ (! r (atom v f) ; this is specified\n\ (! x (bvatom v bv_v) ; establishes the equivalence of v to bv_v\n\ (! u (! o (holds (clc (pos bv_v) cln))\n\ (holds C))\n\ (holds (clc (neg v) C))))))))))\n\ \n\ \n\ ;; Example:\n\ ;;\n\ ;; Given theory literals (F1....Fn), and an input formula A of the form (th_holds (or F1 (or F2 .... (or F{n-1} Fn))))).\n\ ;;\n\ ;; We introduce atoms (a1,...,an) to map boolean literals (v1,...,vn) top literals (F1,...,Fn).\n\ ;; Do this at the beginning of the proof:\n\ ;;\n\ ;; (decl_atom F1 (\\ v1 (\\ a1\n\ ;; (decl_atom F2 (\\ v2 (\\ a2\n\ ;; ....\n\ ;; (decl_atom Fn (\\ vn (\\ an\n\ ;;\n\ ;; A is then clausified by the following proof:\n\ ;;\n\ ;;(satlem _ _\n\ ;;(asf _ _ _ a1 (\\ l1\n\ ;;(asf _ _ _ a2 (\\ l2\n\ ;;...\n\ ;;(asf _ _ _ an (\\ ln\n\ ;;(clausify_false\n\ ;;\n\ ;; (contra _\n\ ;; (or_elim_1 _ _ l{n-1}\n\ ;; ...\n\ ;; (or_elim_1 _ _ l2\n\ ;; (or_elim_1 _ _ l1 A))))) ln)\n\ ;;\n\ ;;))))))) (\\ C\n\ ;;\n\ ;; We now have the free variable C, which should be the clause (v1 V ... V vn).\n\ ;;\n\ ;; Polarity of literals should be considered, say we have A of the form (th_holds (or (not F1) (or F2 (not F3)))).\n\ ;; Where necessary, we use \"ast\" instead of \"asf\", introduce negations by \"not_not_intro\" for pattern matching, and flip\n\ ;; the arguments of contra:\n\ ;;\n\ ;;(satlem _ _\n\ ;;(ast _ _ _ a1 (\\ l1\n\ ;;(asf _ _ _ a2 (\\ l2\n\ ;;(ast _ _ _ a3 (\\ l3\n\ ;;(clausify_false\n\ ;;\n\ ;; (contra _ l3\n\ ;; (or_elim_1 _ _ l2\n\ ;; (or_elim_1 _ _ (not_not_intro l1) A))))\n\ ;;\n\ ;;))))))) (\\ C\n\ ;;\n\ ;; C should be the clause (~v1 V v2 V ~v3 )\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;\n\ ; Theory of Equality and Congruence Closure\n\ ;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ; depends on : smt.plf\n\ \n\ ; sorts :\n\ \n\ (declare arrow (! s1 sort (! s2 sort sort))) ; function constructor\n\ \n\ ; functions :\n\ \n\ (declare apply (! s1 sort\n\ (! s2 sort\n\ (! t1 (term (arrow s1 s2))\n\ (! t2 (term s1)\n\ (term s2))))))\n\ \n\ \n\ ; inference rules :\n\ \n\ (declare trust (th_holds false)) ; temporary\n\ (declare trust_f (! f formula (th_holds f))) ; temporary\n\ \n\ (declare refl\n\ (! s sort\n\ (! t (term s)\n\ (th_holds (= s t t)))))\n\ \n\ (declare symm (! s sort\n\ (! x (term s)\n\ (! y (term s)\n\ (! u (th_holds (= _ x y))\n\ (th_holds (= _ y x)))))))\n\ \n\ (declare trans (! s sort\n\ (! x (term s)\n\ (! y (term s)\n\ (! z (term s)\n\ (! u (th_holds (= _ x y))\n\ (! u (th_holds (= _ y z))\n\ (th_holds (= _ x z)))))))))\n\ \n\ (declare negsymm (! s sort\n\ (! x (term s)\n\ (! y (term s)\n\ (! u (th_holds (not (= _ x y)))\n\ (th_holds (not (= _ y x))))))))\n\ \n\ (declare negtrans1 (! s sort\n\ (! x (term s)\n\ (! y (term s)\n\ (! z (term s)\n\ (! u (th_holds (not (= _ x y)))\n\ (! u (th_holds (= _ y z))\n\ (th_holds (not (= _ x z))))))))))\n\ \n\ (declare negtrans2 (! s sort\n\ (! x (term s)\n\ (! y (term s)\n\ (! z (term s)\n\ (! u (th_holds (= _ x y))\n\ (! u (th_holds (not (= _ y z)))\n\ (th_holds (not (= _ x z))))))))))\n\ \n\ (declare cong (! s1 sort\n\ (! s2 sort\n\ (! a1 (term (arrow s1 s2))\n\ (! b1 (term (arrow s1 s2))\n\ (! a2 (term s1)\n\ (! b2 (term s1)\n\ (! u1 (th_holds (= _ a1 b1))\n\ (! u2 (th_holds (= _ a2 b2))\n\ (th_holds (= _ (apply _ _ a1 a2) (apply _ _ b1 b2))))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ; Examples\n\ \n\ ; an example of \"(p1 or p2(0)) and t1=t2(1)\"\n\ ;(! p1 (term Bool)\n\ ;(! p2 (term (arrow Int Bool))\n\ ;(! t1 (term Int)\n\ ;(! t2 (term (arrow Int Int))\n\ ;(! F (th_holds (and (or (p_app p1) (p_app (apply _ _ p2 0)))\n\ ; (= _ t1 (apply _ _ t2 1))))\n\ ; ...\n\ \n\ ; another example of \"p3(a,b)\"\n\ ;(! a (term Int)\n\ ;(! b (term Int)\n\ ;(! p3 (term (arrow Int (arrow Int Bool))) ; arrow is right assoc.\n\ ;(! F (th_holds (p_app (apply _ _ (apply _ _ p3 a) b))) ; apply is left assoc.\n\ ; ...\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;\n\ ; Theory of Arrays\n\ ;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ; depends on : th_base.plf\n\ \n\ ; sorts\n\ \n\ (declare Array (! s1 sort (! s2 sort sort))) ; s1 is index, s2 is element\n\ \n\ ; functions\n\ (declare write (! s1 sort\n\ (! s2 sort\n\ (term (arrow (Array s1 s2)\n\ (arrow s1\n\ (arrow s2 (Array s1 s2))))))))\n\ \n\ (declare read (! s1 sort\n\ (! s2 sort\n\ (term (arrow (Array s1 s2)\n\ (arrow s1 s2))))))\n\ \n\ ; inference rules\n\ \n\ ; read( a[i] = b, i ) == b\n\ (declare row1 (! s1 sort\n\ (! s2 sort\n\ (! t1 (term (Array s1 s2))\n\ (! t2 (term s1)\n\ (! t3 (term s2)\n\ (th_holds (= _\n\ (apply _ _ (apply _ _ (read s1 s2) (apply _ _ (apply _ _ (apply _ _ (write s1 s2) t1) t2) t3)) t2) t3))))))))\n\ \n\ ; read( a[i] = b, j ) == read( a, j ) if i != j\n\ (declare row (! s1 sort\n\ (! s2 sort\n\ (! t2 (term s1)\n\ (! t3 (term s1)\n\ (! t1 (term (Array s1 s2))\n\ (! t4 (term s2)\n\ (! u (th_holds (not (= _ t2 t3)))\n\ (th_holds (= _ (apply _ _ (apply _ _ (read s1 s2) (apply _ _ (apply _ _ (apply _ _ (write s1 s2) t1) t2) t4)) t3)\n\ (apply _ _ (apply _ _ (read s1 s2) t1) t3)))))))))))\n\ \n\ ; i == j if read( a, j ) != read( a[i] = b, j )\n\ (declare negativerow (! s1 sort\n\ (! s2 sort\n\ (! t2 (term s1)\n\ (! t3 (term s1)\n\ (! t1 (term (Array s1 s2))\n\ (! t4 (term s2)\n\ (! u (th_holds (not (= _\n\ (apply _ _ (apply _ _ (read s1 s2) (apply _ _ (apply _ _ (apply _ _ (write s1 s2) t1) t2) t4)) t3)\n\ (apply _ _ (apply _ _ (read s1 s2) t1) t3))))\n\ (th_holds (= _ t2 t3))))))))))\n\ \n\ (declare ext (! s1 sort\n\ (! s2 sort\n\ (! t1 (term (Array s1 s2))\n\ (! t2 (term (Array s1 s2))\n\ (! u1 (! k (term s1)\n\ (! u2 (th_holds (or (= _ t1 t2) (not (= _ (apply _ _ (apply _ _ (read s1 s2) t1) k) (apply _ _ (apply _ _ (read s1 s2) t2) k)))))\n\ (holds cln)))\n\ (holds cln)))))))\n\ ;;;; TEMPORARY:\n\ \n\ (declare trust-bad (th_holds false))\n\ \n\ ; helper stuff\n\ (program mpz_sub ((x mpz) (y mpz)) mpz\n\ (mp_add x (mp_mul (~1) y)))\n\ \n\ (program mp_ispos ((x mpz)) formula\n\ (mp_ifneg x false true))\n\ \n\ (program mpz_eq ((x mpz) (y mpz)) formula\n\ (mp_ifzero (mpz_sub x y) true false))\n\ \n\ (program mpz_lt ((x mpz) (y mpz)) formula\n\ (mp_ifneg (mpz_sub x y) true false))\n\ \n\ (program mpz_lte ((x mpz) (y mpz)) formula\n\ (mp_ifneg (mpz_sub x y) true (mpz_eq x y)))\n\ \n\ (program mpz_ ((x mpz) (y mpz)) formula\n\ (mp_ifzero (mpz_sub x y) true false))\n\ \n\ \n\ ; \"bitvec\" is a term of type \"sort\"\n\ ; (declare BitVec sort)\n\ (declare BitVec (!n mpz sort))\n\ \n\ ; bit type\n\ (declare bit type)\n\ (declare b0 bit)\n\ (declare b1 bit)\n\ \n\ ; bit vector type used for constants\n\ (declare bv type)\n\ (declare bvn bv)\n\ (declare bvc (! b bit (! v bv bv)))\n\ \n\ ; calculate the length of a bitvector\n\ ;; (program bv_len ((v bv)) mpz\n\ ;; (match v\n\ ;; (bvn 0)\n\ ;; ((bvc b v') (mp_add (bv_len v') 1))))\n\ \n\ \n\ ; a bv constant term\n\ (declare a_bv\n\ (! n mpz\n\ (! v bv\n\ (term (BitVec n)))))\n\ \n\ (program bv_constants_are_disequal ((x bv) (y bv)) formula\n\ (match x\n\ (bvn (fail formula))\n\ ((bvc bx x')\n\ (match y\n\ (bvn (fail formula))\n\ ((bvc by y') (match bx\n\ (b0 (match by (b0 (bv_constants_are_disequal x' y')) (b1 (true))))\n\ (b1 (match by (b0 (true)) (b1 (bv_constants_are_disequal x' y'))))\n\ ))\n\ ))\n\ ))\n\ \n\ (declare bv_disequal_constants\n\ (! n mpz\n\ (! x bv\n\ (! y bv\n\ (! c (^ (bv_constants_are_disequal x y) true)\n\ (th_holds (not (= (BitVec n) (a_bv n x) (a_bv n y)))))))))\n\ \n\ ; a bv variable\n\ (declare var_bv type)\n\ ; a bv variable term\n\ (declare a_var_bv\n\ (! n mpz\n\ (! v var_bv\n\ (term (BitVec n)))))\n\ \n\ ; bit vector binary operators\n\ (define bvop2\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (term (BitVec n))))))\n\ \n\ (declare bvand bvop2)\n\ (declare bvor bvop2)\n\ (declare bvor bvop2)\n\ (declare bvxor bvop2)\n\ (declare bvnand bvop2)\n\ (declare bvnor bvop2)\n\ (declare bvxnor bvop2)\n\ (declare bvmul bvop2)\n\ (declare bvadd bvop2)\n\ (declare bvsub bvop2)\n\ (declare bvudiv bvop2)\n\ (declare bvurem bvop2)\n\ (declare bvsdiv bvop2)\n\ (declare bvsrem bvop2)\n\ (declare bvsmod bvop2)\n\ (declare bvshl bvop2)\n\ (declare bvlshr bvop2)\n\ (declare bvashr bvop2)\n\ (declare concat bvop2)\n\ \n\ ; bit vector unary operators\n\ (define bvop1\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (term (BitVec n)))))\n\ \n\ \n\ (declare bvneg bvop1)\n\ (declare bvnot bvop1)\n\ (declare rotate_left bvop1)\n\ (declare rotate_right bvop1)\n\ \n\ (declare bvcomp\n\ (! n mpz\n\ (! t1 (term (BitVec n))\n\ (! t2 (term (BitVec n))\n\ (term (BitVec 1))))))\n\ \n\ \n\ (declare concat\n\ (! n mpz\n\ (! m mpz\n\ (! m' mpz\n\ (! t1 (term (BitVec m))\n\ (! t2 (term (BitVec m'))\n\ (term (BitVec n))))))))\n\ \n\ ;; side-condition fails in signature only??\n\ ;; (! s (^ (mp_add m m') n)\n\ \n\ ;; (declare repeat bvopp)\n\ \n\ (declare extract\n\ (! n mpz\n\ (! i mpz\n\ (! j mpz\n\ (! m mpz\n\ (! t2 (term (BitVec m))\n\ (term (BitVec n))))))))\n\ \n\ (declare zero_extend\n\ (! n mpz\n\ (! i mpz\n\ (! m mpz\n\ (! t2 (term (BitVec m))\n\ (term (BitVec n)))))))\n\ \n\ (declare sign_extend\n\ (! n mpz\n\ (! i mpz\n\ (! m mpz\n\ (! t2 (term (BitVec m))\n\ (term (BitVec n)))))))\n\ \n\ (declare repeat\n\ (! n mpz\n\ (! i mpz\n\ (! m mpz\n\ (! t2 (term (BitVec m))\n\ (term (BitVec n)))))))\n\ \n\ \n\ \n\ ;; TODO: add checks for valid typing for these operators\n\ ;; (! c1 (^ (mpz_lte i j)\n\ ;; (! c2 (^ (mpz_lt i n) true)\n\ ;; (! c3 (^ (mp_ifneg i false true) true)\n\ ;; (! c4 (^ (mp_ifneg j false true) true)\n\ ;; (! s (^ (mp_add (mpz_sub i j) 1) m)\n\ \n\ \n\ ; bit vector predicates\n\ (define bvpred\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ formula))))\n\ \n\ (declare bvult bvpred)\n\ (declare bvule bvpred)\n\ (declare bvugt bvpred)\n\ (declare bvuge bvpred)\n\ (declare bvslt bvpred)\n\ (declare bvsle bvpred)\n\ (declare bvsgt bvpred)\n\ (declare bvsge bvpred)\n\ ; bit blasted terms as list of formulas\n\ (declare bblt type)\n\ (declare bbltn bblt)\n\ (declare bbltc (! f formula (! v bblt bblt)))\n\ \n\ ; calculate the length of a bit-blasted term\n\ (program bblt_len ((v bblt)) mpz\n\ (match v\n\ (bbltn 0)\n\ ((bbltc b v') (mp_add (bblt_len v') 1))))\n\ \n\ \n\ ; (bblast_term x y) means term y corresponds to bit level interpretation x\n\ (declare bblast_term\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y bblt\n\ type))))\n\ \n\ ; FIXME: for unsupported bit-blast terms\n\ (declare trust_bblast_term\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y bblt\n\ (bblast_term n x y)))))\n\ \n\ \n\ ; Binds a symbol to the bblast_term to be used later on.\n\ (declare decl_bblast\n\ (! n mpz\n\ (! b bblt\n\ (! t (term (BitVec n))\n\ (! bb (bblast_term n t b)\n\ (! s (^ (bblt_len b) n)\n\ (! u (! v (bblast_term n t b) (holds cln))\n\ (holds cln))))))))\n\ \n\ (declare decl_bblast_with_alias\n\ (! n mpz\n\ (! b bblt\n\ (! t (term (BitVec n))\n\ (! a (term (BitVec n))\n\ (! bb (bblast_term n t b)\n\ (! e (th_holds (= _ t a))\n\ (! s (^ (bblt_len b) n)\n\ (! u (! v (bblast_term n a b) (holds cln))\n\ (holds cln))))))))))\n\ \n\ ; a predicate to represent the n^th bit of a bitvector term\n\ (declare bitof\n\ (! x var_bv\n\ (! n mpz formula)))\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;;\n\ ;; BITBLASTING RULES\n\ ;;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST CONSTANT\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_const ((v bv) (n mpz)) bblt\n\ (mp_ifneg n (match v (bvn bbltn)\n\ (default (fail bblt)))\n\ (match v ((bvc b v') (bbltc (match b (b0 false) (b1 true)) (bblast_const v' (mp_add n (~ 1)))))\n\ (default (fail bblt)))))\n\ \n\ (declare bv_bbl_const (! n mpz\n\ (! f bblt\n\ (! v bv\n\ (! c (^ (bblast_const v (mp_add n (~ 1))) f)\n\ (bblast_term n (a_bv n v) f))))))\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST VARIABLE\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_var ((x var_bv) (n mpz)) bblt\n\ (mp_ifneg n bbltn\n\ (bbltc (bitof x n) (bblast_var x (mp_add n (~ 1))))))\n\ \n\ (declare bv_bbl_var (! n mpz\n\ (! x var_bv\n\ (! f bblt\n\ (! c (^ (bblast_var x (mp_add n (~ 1))) f)\n\ (bblast_term n (a_var_bv n x) f))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST CONCAT\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_concat ((x bblt) (y bblt)) bblt\n\ (match x\n\ (bbltn (match y ((bbltc by y') (bbltc by (bblast_concat x y')))\n\ (bbltn bbltn)))\n\ ((bbltc bx x') (bbltc bx (bblast_concat x' y)))))\n\ \n\ (declare bv_bbl_concat (! n mpz\n\ (! m mpz\n\ (! m1 mpz\n\ (! x (term (BitVec m))\n\ (! y (term (BitVec m1))\n\ (! xb bblt\n\ (! yb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term m x xb)\n\ (! ybb (bblast_term m1 y yb)\n\ (! c (^ (bblast_concat xb yb ) rb)\n\ (bblast_term n (concat n m m1 x y) rb)))))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST EXTRACT\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_extract_rec ((x bblt) (i mpz) (j mpz) (n mpz)) bblt\n\ (match x\n\ ((bbltc bx x') (mp_ifneg (mpz_sub (mpz_sub j n) 1)\n\ (mp_ifneg (mpz_sub (mpz_sub n i) 1)\n\ (bbltc bx (bblast_extract_rec x' i j (mpz_sub n 1)))\n\ (bblast_extract_rec x' i j (mpz_sub n 1)))\n\ \n\ bbltn))\n\ (bbltn bbltn)))\n\ \n\ (program bblast_extract ((x bblt) (i mpz) (j mpz) (n mpz)) bblt\n\ (bblast_extract_rec x i j (mpz_sub n 1)))\n\ \n\ (declare bv_bbl_extract (! n mpz\n\ (! i mpz\n\ (! j mpz\n\ (! m mpz\n\ (! x (term (BitVec m))\n\ (! xb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term m x xb)\n\ (! c ( ^ (bblast_extract xb i j m) rb)\n\ (bblast_term n (extract n i j m x) rb)))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST ZERO/SIGN EXTEND\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program extend_rec ((x bblt) (i mpz) (b formula)) bblt\n\ (mp_ifneg i x\n\ (bbltc b (extend_rec x (mpz_sub i 1) b)))))\n\ \n\ (program bblast_zextend ((x bblt) (i mpz)) bblt\n\ (extend_rec x (mpz_sub i 1) false))\n\ \n\ (declare bv_bbl_zero_extend (! n mpz\n\ (! k mpz\n\ (! m mpz\n\ (! x (term (BitVec m))\n\ (! xb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term m x xb)\n\ (! c ( ^ (bblast_zextend xb k m) rb)\n\ (bblast_term n (zero_extend n k m x) rb))))))))))\n\ \n\ (program bblast_sextend ((x bblt) (i mpz)) bblt\n\ (match x (bbltn (fail bblt))\n\ ((bbltc xb x') (extend_rec x (mpz_sub i 1) xb))))\n\ \n\ (declare bv_bbl_sign_extend (! n mpz\n\ (! k mpz\n\ (! m mpz\n\ (! x (term (BitVec m))\n\ (! xb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term m x xb)\n\ (! c ( ^ (bblast_sextend xb k m) rb)\n\ (bblast_term n (sign_extend n k m x) rb))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVAND\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_bvand ((x bblt) (y bblt)) bblt\n\ (match x\n\ (bbltn (match y (bbltn bbltn) (default (fail bblt))))\n\ ((bbltc bx x') (match y\n\ (bbltn (fail bblt))\n\ ((bbltc by y') (bbltc (and bx by) (bblast_bvand x' y')))))))\n\ \n\ (declare bv_bbl_bvand (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! xb bblt\n\ (! yb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! ybb (bblast_term n y yb)\n\ (! c (^ (bblast_bvand xb yb ) rb)\n\ (bblast_term n (bvand n x y) rb)))))))))))\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVNOT\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_bvnot ((x bblt)) bblt\n\ (match x\n\ (bbltn bbltn)\n\ ((bbltc bx x') (bbltc (not bx) (bblast_bvnot x')))))\n\ \n\ (declare bv_bbl_bvnot (! n mpz\n\ (! x (term (BitVec n))\n\ (! xb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! c (^ (bblast_bvnot xb ) rb)\n\ (bblast_term n (bvnot n x) rb))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVOR\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_bvor ((x bblt) (y bblt)) bblt\n\ (match x\n\ (bbltn (match y (bbltn bbltn) (default (fail bblt))))\n\ ((bbltc bx x') (match y\n\ (bbltn (fail bblt))\n\ ((bbltc by y') (bbltc (or bx by) (bblast_bvor x' y')))))))\n\ \n\ (declare bv_bbl_bvor (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! xb bblt\n\ (! yb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! ybb (bblast_term n y yb)\n\ (! c (^ (bblast_bvor xb yb ) rb)\n\ (bblast_term n (bvor n x y) rb)))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVXOR\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_bvxor ((x bblt) (y bblt)) bblt\n\ (match x\n\ (bbltn (match y (bbltn bbltn) (default (fail bblt))))\n\ ((bbltc bx x') (match y\n\ (bbltn (fail bblt))\n\ ((bbltc by y') (bbltc (xor bx by) (bblast_bvxor x' y')))))))\n\ \n\ (declare bv_bbl_bvxor (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! xb bblt\n\ (! yb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! ybb (bblast_term n y yb)\n\ (! c (^ (bblast_bvxor xb yb ) rb)\n\ (bblast_term n (bvxor n x y) rb)))))))))))\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVADD\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ ;; return the carry bit after adding x y\n\ ;; FIXME: not the most efficient thing in the world\n\ (program bblast_bvadd_carry ((a bblt) (b bblt) (carry formula)) formula\n\ (match a\n\ ( bbltn (match b (bbltn carry) (default (fail formula))))\n\ ((bbltc ai a') (match b\n\ (bbltn (fail formula))\n\ ((bbltc bi b') (or (and ai bi) (and (xor ai bi) (bblast_bvadd_carry a' b' carry))))))))\n\ \n\ ;; ripple carry adder where carry is the initial carry bit\n\ (program bblast_bvadd ((a bblt) (b bblt) (carry formula)) bblt\n\ (match a\n\ ( bbltn (match b (bbltn bbltn) (default (fail bblt))))\n\ ((bbltc ai a') (match b\n\ (bbltn (fail bblt))\n\ ((bbltc bi b') (bbltc (xor (xor ai bi) (bblast_bvadd_carry a' b' carry))\n\ (bblast_bvadd a' b' carry)))))))\n\ \n\ \n\ (program reverse_help ((x bblt) (acc bblt)) bblt\n\ (match x\n\ (bbltn acc)\n\ ((bbltc xi x') (reverse_help x' (bbltc xi acc)))))\n\ \n\ \n\ (program reverseb ((x bblt)) bblt\n\ (reverse_help x bbltn))\n\ \n\ \n\ ; AJR: use this version?\n\ ;(program bblast_bvadd_2h ((a bblt) (b bblt) (carry formula)) bblt\n\ ;(match a\n\ ; ( bbltn (match b (bbltn bbltn) (default (fail bblt))))\n\ ; ((bbltc ai a') (match b\n\ ; (bbltn (fail bblt))\n\ ; ((bbltc bi b')\n\ ; (let carry' (or (and ai bi) (and (xor ai bi) carry))\n\ ; (bbltc (xor (xor ai bi) carry)\n\ ; (bblast_bvadd_2h a' b' carry'))))))))\n\ \n\ ;(program bblast_bvadd_2 ((a bblt) (b bblt) (carry formula)) bblt\n\ ;(let ar (reverseb a) ;; reverse a and b so that we can build the circuit\n\ ;(let br (reverseb b) ;; from the least significant bit up\n\ ;(let ret (bblast_bvadd_2h ar br carry)\n\ ; (reverseb ret)))))\n\ \n\ (declare bv_bbl_bvadd (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! xb bblt\n\ (! yb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! ybb (bblast_term n y yb)\n\ (! c (^ (bblast_bvadd xb yb false) rb)\n\ (bblast_term n (bvadd n x y) rb)))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVNEG\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_zero ((n mpz)) bblt\n\ (mp_ifzero n bbltn\n\ (bbltc false (bblast_zero (mp_add n (~1))))))\n\ \n\ (program bblast_bvneg ((x bblt) (n mpz)) bblt\n\ (bblast_bvadd (bblast_bvnot x) (bblast_zero n) true))\n\ \n\ \n\ (declare bv_bbl_bvneg (! n mpz\n\ (! x (term (BitVec n))\n\ (! xb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! c (^ (bblast_bvneg xb n) rb)\n\ (bblast_term n (bvneg n x) rb))))))))\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVMUL\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ \n\ ;; shift add multiplier\n\ \n\ ;; (program concat ((a bblt) (b bblt)) bblt\n\ ;; (match a (bbltn b)\n\ ;; ((bbltc ai a') (bbltc ai (concat a' b)))))\n\ \n\ \n\ (program top_k_bits ((a bblt) (k mpz)) bblt\n\ (mp_ifzero k bbltn\n\ (match a (bbltn (fail bblt))\n\ ((bbltc ai a') (bbltc ai (top_k_bits a' (mpz_sub k 1)))))))\n\ \n\ (program bottom_k_bits ((a bblt) (k mpz)) bblt\n\ (reverseb (top_k_bits (reverseb a) k)))\n\ \n\ ;; assumes the least signigicant bit is at the beginning of the list\n\ (program k_bit ((a bblt) (k mpz)) formula\n\ (mp_ifneg k (fail formula)\n\ (match a (bbltn (fail formula))\n\ ((bbltc ai a') (mp_ifzero k ai (k_bit a' (mpz_sub k 1)))))))\n\ \n\ (program and_with_bit ((a bblt) (bt formula)) bblt\n\ (match a (bbltn bbltn)\n\ ((bbltc ai a') (bbltc (and bt ai) (and_with_bit a' bt)))))\n\ \n\ ;; a is going to be the current result\n\ ;; carry is going to be false initially\n\ ;; b is the and of a and b[k]\n\ ;; res is going to be bbltn initially\n\ (program mult_step_k_h ((a bblt) (b bblt) (res bblt) (carry formula) (k mpz)) bblt\n\ (match a\n\ (bbltn (match b (bbltn res) (default (fail bblt))))\n\ ((bbltc ai a')\n\ (match b (bbltn (fail bblt))\n\ ((bbltc bi b')\n\ (mp_ifneg (mpz_sub k 1)\n\ (let carry_out (or (and ai bi) (and (xor ai bi) carry))\n\ (let curr (xor (xor ai bi) carry)\n\ (mult_step_k_h a' b' (bbltc curr res) carry_out (mpz_sub k 1))))\n\ (mult_step_k_h a' b (bbltc ai res) carry (mpz_sub k 1))\n\ ))))))\n\ \n\ ;; assumes that a, b and res have already been reversed\n\ (program mult_step ((a bblt) (b bblt) (res bblt) (n mpz) (k mpz)) bblt\n\ (let k' (mpz_sub n k )\n\ (let ak (top_k_bits a k')\n\ (let b' (and_with_bit ak (k_bit b k))\n\ (mp_ifzero (mpz_sub k' 1)\n\ (mult_step_k_h res b' bbltn false k)\n\ (let res' (mult_step_k_h res b' bbltn false k)\n\ (mult_step a b (reverseb res') n (mp_add k 1))))))))\n\ \n\ \n\ (program bblast_bvmul ((a bblt) (b bblt) (n mpz)) bblt\n\ (let ar (reverseb a) ;; reverse a and b so that we can build the circuit\n\ (let br (reverseb b) ;; from the least significant bit up\n\ (let res (and_with_bit ar (k_bit br 0))\n\ (mp_ifzero (mpz_sub n 1) ;; if multiplying 1 bit numbers no need to call mult_step\n\ res\n\ (mult_step ar br res n 1))))))\n\ \n\ (declare bv_bbl_bvmul (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! xb bblt\n\ (! yb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! ybb (bblast_term n y yb)\n\ (! c (^ (bblast_bvmul xb yb n) rb)\n\ (bblast_term n (bvmul n x y) rb)))))))))))\n\ \n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST EQUALS\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ ; bit blast x = y\n\ ; for x,y of size n, it will return a conjuction (x.0 = y.0 ^ ( ... ^ (x.{n-1} = y.{n-1})))\n\ ; f is the accumulator formula that builds the equality in the right order\n\ (program bblast_eq_rec ((x bblt) (y bblt) (f formula)) formula\n\ (match x\n\ (bbltn (match y (bbltn f) (default (fail formula))))\n\ ((bbltc fx x') (match y\n\ (bbltn (fail formula))\n\ ((bbltc fy y') (bblast_eq_rec x' y' (and (iff fx fy) f)))))\n\ (default (fail formula))))\n\ \n\ (program bblast_eq ((x bblt) (y bblt)) formula\n\ (match x\n\ ((bbltc bx x') (match y ((bbltc by y') (bblast_eq_rec x' y' (iff bx by)))\n\ (default (fail formula))))\n\ (default (fail formula))))\n\ \n\ \n\ ;; TODO: a temporary bypass for rewrites that we don't support yet. As soon\n\ ;; as we do, remove this rule.\n\ \n\ (declare bv_bbl_=_false\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! bx bblt\n\ (! by bblt\n\ (! f formula\n\ (! bbx (bblast_term n x bx)\n\ (! bby (bblast_term n y by)\n\ (! c (^ (bblast_eq bx by) f)\n\ (th_holds (iff (= (BitVec n) x y) false))))))))))))\n\ \n\ (declare bv_bbl_=\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! bx bblt\n\ (! by bblt\n\ (! f formula\n\ (! bbx (bblast_term n x bx)\n\ (! bby (bblast_term n y by)\n\ (! c (^ (bblast_eq bx by) f)\n\ (th_holds (iff (= (BitVec n) x y) f))))))))))))\n\ \n\ (declare bv_bbl_=_swap\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! bx bblt\n\ (! by bblt\n\ (! f formula\n\ (! bbx (bblast_term n x bx)\n\ (! bby (bblast_term n y by)\n\ (! c (^ (bblast_eq by bx) f)\n\ (th_holds (iff (= (BitVec n) x y) f))))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVULT\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_bvult ((x bblt) (y bblt) (n mpz)) formula\n\ (match x\n\ ( bbltn (fail formula))\n\ ((bbltc xi x') (match y\n\ (bbltn (fail formula))\n\ ((bbltc yi y') (mp_ifzero n\n\ (and (not xi) yi)\n\ (or (and (iff xi yi) (bblast_bvult x' y' (mp_add n (~1)))) (and (not xi) yi))))))))\n\ \n\ (declare bv_bbl_bvult\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! bx bblt\n\ (! by bblt\n\ (! f formula\n\ (! bbx (bblast_term n x bx)\n\ (! bby (bblast_term n y by)\n\ (! c (^ (bblast_bvult bx by (mp_add n (~1))) f)\n\ (th_holds (iff (bvult n x y) f))))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVSLT\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_bvslt ((x bblt) (y bblt) (n mpz)) formula\n\ (match x\n\ ( bbltn (fail formula))\n\ ((bbltc xi x') (match y\n\ (bbltn (fail formula))\n\ ((bbltc yi y') (mp_ifzero (mpz_sub n 1)\n\ (and xi (not yi))\n\ (or (and (iff xi yi)\n\ (bblast_bvult x' y' (mpz_sub n 2)))\n\ (and xi (not yi)))))))))\n\ \n\ (declare bv_bbl_bvslt\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! bx bblt\n\ (! by bblt\n\ (! f formula\n\ (! bbx (bblast_term n x bx)\n\ (! bby (bblast_term n y by)\n\ (! c (^ (bblast_bvslt bx by n) f)\n\ (th_holds (iff (bvslt n x y) f))))))))))))\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;; BITBLAST BVCOMP\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ (program bblast_bvcomp ((x bblt) (y bblt) (n mpz)) bblt\n\ (match x ((bbltc bx x') (match y ((bbltc by y')\n\ (bbltc (bblast_eq_rec x' y' (iff bx by)) bbltn))\n\ (default (fail bblt))))\n\ (default (fail bblt))\n\ ))\n\ \n\ (declare bv_bbl_bvcomp (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (! xb bblt\n\ (! yb bblt\n\ (! rb bblt\n\ (! xbb (bblast_term n x xb)\n\ (! ybb (bblast_term n y yb)\n\ (! c (^ (bblast_bvcomp xb yb n) rb)\n\ (bblast_term 1 (bvcomp n x y) rb)))))))))))\n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;;\n\ ;; BITBLASTING CONNECTORS\n\ ;;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ \n\ ; bit-blasting connections\n\ \n\ (declare intro_assump_t\n\ (! f formula\n\ (! v var\n\ (! C clause\n\ (! h (th_holds f)\n\ (! a (atom v f)\n\ (! u (! unit (holds (clc (pos v) cln))\n\ (holds C))\n\ (holds C))))))))\n\ \n\ (declare intro_assump_f\n\ (! f formula\n\ (! v var\n\ (! C clause\n\ (! h (th_holds (not f))\n\ (! a (atom v f)\n\ (! u (! unit (holds (clc (neg v) cln))\n\ (holds C))\n\ (holds C))))))))\n\ \n\ \n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ ;;\n\ ;; REWRITE RULES\n\ ;;\n\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\ \n\ \n\ ; rewrite rule :\n\ ; x + y = y + x\n\ (declare bvadd_symm\n\ (! n mpz\n\ (! x (term (BitVec n))\n\ (! y (term (BitVec n))\n\ (th_holds (= (BitVec n) (bvadd _ x y) (bvadd _ y x)))))))\n\ \n\ ;; (declare bvcrazy_rewrite\n\ ;; (! n mpz\n\ ;; (! x (term (BitVec n))\n\ ;; (! y (term (BitVec n))\n\ ;; (! xn bv_poly\n\ ;; (! yn bv_poly\n\ ;; (! hxn (bv_normalizes x xn)\n\ ;; (! hyn (bv_normalizes y yn)\n\ ;; (! s (^ (rewrite_scc xn yn) true)\n\ ;; (! u (! x (term (BitVec n)) (holds cln))\n\ ;; (holds cln)))))))))))\n\ \n\ ;; (th_holds (= (BitVec n) (bvadd x y) (bvadd y x)))))))\n\ \n\ \n\ \n\ ; necessary?\n\ ;; (program calc_bvand ((a bv) (b bv)) bv\n\ ;; (match a\n\ ;; (bvn (match b (bvn bvn) (default (fail bv))))\n\ ;; ((bvc ba a') (match b\n\ ;; ((bvc bb b') (bvc (match ba (b0 b0) (b1 bb)) (calc_bvand a' b')))\n\ ;; (default (fail bv))))))\n\ \n\ ;; ; rewrite rule (w constants) :\n\ ;; ; a & b = c\n\ ;; (declare bvand_const (! c bv\n\ ;; (! a bv\n\ ;; (! b bv\n\ ;; (! u (^ (calc_bvand a b) c)\n\ ;; (th_holds (= BitVec (bvand (a_bv a) (a_bv b)) (a_bv c))))))))\n\ \n\ \n\ ;; making constant bit-vectors\n\ (program mk_ones ((n mpz)) bv\n\ (mp_ifzero n bvn (bvc b1 (mk_ones (mpz_sub n 1)))))\n\ \n\ (program mk_zero ((n mpz)) bv\n\ (mp_ifzero n bvn (bvc b0 (mk_ones (mpz_sub n 1)))))\n\ \n\ \n\ \n\ ;; (bvxnor a b) => (bvnot (bvxor a b))\n\ ;; (declare bvxnor_elim\n\ ;; (! n mpz\n\ ;; (! a (term (BitVec n))\n\ ;; (! b (term (BitVec n))\n\ ;; (! a' (term (BitVec n))\n\ ;; (! b' (term (BitVec n))\n\ ;; (! rwa (rw_term _ a a')\n\ ;; (! rwb (rw_term _ b b')\n\ ;; (rw_term n (bvxnor _ a b)\n\ ;; (bvnot _ (bvxor _ a' b')))))))))))\n\ \n\ \n\ \n\ ;; ;; (bvxor a 0) => a\n\ ;; (declare bvxor_zero\n\ ;; (! n mpz\n\ ;; (! zero_bits bv\n\ ;; (! sc (^ (mk_zero n) zero_bits)\n\ ;; (! a (term (BitVec n))\n\ ;; (! b (term (BitVec n))\n\ ;; (! a' (term (BitVec n))\n\ ;; (! rwa (rw_term _ a a')\n\ ;; (! rwb (rw_term _ b (a_bv _ zero_bits))\n\ ;; (rw_term _ (bvxor _ a b)\n\ ;; a'))))))))))\n\ \n\ ;; ;; (bvxor a 11) => (bvnot a)\n\ ;; (declare bvxor_one\n\ ;; (! n mpz\n\ ;; (! one_bits bv\n\ ;; (! sc (^ (mk_ones n) one_bits)\n\ ;; (! a (term (BitVec n))\n\ ;; (! b (term (BitVec n))\n\ ;; (! a' (term (BitVec n))\n\ ;; (! rwa (rw_term _ a a')\n\ ;; (! rwb (rw_term _ b (a_bv _ one_bits))\n\ ;; (rw_term _ (bvxor _ a b)\n\ ;; (bvnot _ a')))))))))))\n\ \n\ \n\ ;; ;; (bvnot (bvnot a)) => a\n\ ;; (declare bvnot_idemp\n\ ;; (! n mpz\n\ ;; (! a (term (BitVec n))\n\ ;; (! a' (term (BitVec n))\n\ ;; (! rwa (rw_term _ a a')\n\ ;; (rw_term _ (bvnot _ (bvnot _ a))\n\ ;; a'))))))\n\ ;\n\ ; Equality swap\n\ ;\n\ \n\ (declare rr_bv_eq\n\ (! n mpz\n\ (! t1 (term (BitVec n))\n\ (! t2 (term (BitVec n))\n\ (th_holds (iff (= (BitVec n) t2 t1) (= (BitVec n) t1 t2)))))))\n\ \n\ ;\n\ ; Additional rules...\n\ ;\n\ \n\ ;\n\ ; Default, if nothing else applied\n\ ;\n\ \n\ (declare rr_bv_default\n\ (! t1 formula\n\ (! t2 formula\n\ (th_holds (iff t1 t2))))))\n\ (declare Real sort)\n\ \n\ (define arithpred_Real (! x (term Real)\n\ (! y (term Real)\n\ formula)))\n\ \n\ (declare >_Real arithpred_Real)\n\ (declare >=_Real arithpred_Real)\n\ (declare <_Real arithpred_Real)\n\ (declare <=_Real arithpred_Real)\n\ \n\ (define arithterm_Real (! x (term Real)\n\ (! y (term Real)\n\ (term Real))))\n\ \n\ (declare +_Real arithterm_Real)\n\ (declare -_Real arithterm_Real)\n\ (declare *_Real arithterm_Real) ; is * ok to use?\n\ (declare /_Real arithterm_Real) ; is / ok to use?\n\ \n\ ; a constant term\n\ (declare a_real (! x mpq (term Real)))\n\ \n\ ; unary negation\n\ (declare u-_Real (! t (term Real) (term Real)))\n\ (declare Int sort)\n\ \n\ (define arithpred_Int (! x (term Int)\n\ (! y (term Int)\n\ formula)))\n\ \n\ (declare >_Int arithpred_Int)\n\ (declare >=_Int arithpred_Int)\n\ (declare <_Int arithpred_Int)\n\ (declare <=_Int arithpred_Int)\n\ \n\ (define arithterm_Int (! x (term Int)\n\ (! y (term Int)\n\ (term Int))))\n\ \n\ (declare +_Int arithterm_Int)\n\ (declare -_Int arithterm_Int)\n\ (declare *_Int arithterm_Int) ; is * ok to use?\n\ (declare /_Int arithterm_Int) ; is / ok to use?\n\ \n\ ; a constant term\n\ (declare a_int (! x mpz (term Int)))\n\ \n\ ; unary negation\n\ (declare u-_Int (! t (term Int) (term Int)))\n\ "; } /* CVC4::proof namespace */ } /* CVC4 namespace */
29.872727
151
0.482811
[ "vector" ]
a9b7233c9d8aabd5a94ed41277af0c99533c7640
3,897
cpp
C++
keyTransferClient/libcurlUtil/tests/LibcurlUtilsTester.cpp
jdbonior21/TASQC
bad514d556cc74136a15ea37dbfa8fc93e2aef55
[ "BSD-3-Clause" ]
5
2017-02-13T03:16:23.000Z
2019-05-21T15:19:44.000Z
keyTransferClient/libcurlUtil/tests/LibcurlUtilsTester.cpp
jdbonior21/TASQC
bad514d556cc74136a15ea37dbfa8fc93e2aef55
[ "BSD-3-Clause" ]
6
2017-05-30T14:53:57.000Z
2022-02-19T15:29:13.000Z
keyTransferClient/libcurlUtil/tests/LibcurlUtilsTester.cpp
jdbonior21/TASQC
bad514d556cc74136a15ea37dbfa8fc93e2aef55
[ "BSD-3-Clause" ]
5
2017-02-25T21:49:45.000Z
2020-12-13T02:45:49.000Z
/**---------------------------------------------------------------------------- Copyright (c) 2015-, UT-Battelle LLC All rights reserved. Authors: Jay Jay Billings, Phil Evans, Alex McCaskey Author Contact: Phil Evans, evanspg@ornl.gov 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 keytransclient 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. -----------------------------------------------------------------------------*/ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE UpdaterTester_testSuite #include <fstream> #include <sstream> #include <iostream> #include <LibcurlUtils.h> #include "TesterUtils.h" #include <memory> #include <boost/test/included/unit_test.hpp> using namespace std; using namespace tasqc; /** * A LibcurlUtilsPtr is a shared pointer object referring to a LibcurlUtils instance. */ typedef std::shared_ptr<LibcurlUtils> LibcurlUtilsPtr; struct TestStruct { /** * An instance of LibcurlUtilsPtr used for testing. */ LibcurlUtilsPtr libcurlUtilsPtr; /** * A standard template library map container keyed on TesterPropertyType. */ TesterPropertyMap testerPropertyMap; TestStruct() { //Construct a new LibcurlUtils instance. libcurlUtilsPtr = LibcurlUtilsPtr(new LibcurlUtils()); //Get the contents of updatertests.properties as a string. stringstream ss; ss << "max_number_of_posts=100\n"; ss << "max_post_time_interval=500\n"; ss << "url_path=http://localhost:8000/api/keys\n"; ss << "username=user\n"; ss << "password=secret\n"; string contents = ss.str(); //Create the tester property map. testerPropertyMap = TesterUtils::getTesterPropertyMap(contents); return; } ~TestStruct() {} }; BOOST_FIXTURE_TEST_SUITE(LibcurlUtilsTester_testSuite,TestStruct) /** * Checks the LibcurlUtils get() operation. */ BOOST_AUTO_TEST_CASE(checkGet) { //Create a string to hold the full url to the SampleText.txt file string urlFilePath = testerPropertyMap.at(URL_PATH); //Use libcurlUtils to get the contents of the file at urlPath. string urlContents = libcurlUtilsPtr->get(urlFilePath, testerPropertyMap.at(USER_NAME), testerPropertyMap.at(PASS_WORD)); // Verify that get() returns the "Failure" since no authentication was passed. BOOST_REQUIRE_EQUAL(urlContents,"Failure"); // Try to pull down a key using the proper URL. // FIXME! Temporary use of authKey=1. urlFilePath += "?authKey=1"; urlContents = libcurlUtilsPtr->get(urlFilePath, testerPropertyMap.at(USER_NAME), testerPropertyMap.at(PASS_WORD)); BOOST_REQUIRE(!urlContents.empty()); return; } BOOST_AUTO_TEST_SUITE_END()
33.594828
122
0.746728
[ "object" ]
a9b7521bc5c403ec35f980dd8fd200e15786b838
2,563
hpp
C++
cpp/shared/cpputils/cpputils/list.hpp
SiliconLabs/mltk
56b19518187e9d1c8a0d275de137fc9058984a1f
[ "Zlib" ]
null
null
null
cpp/shared/cpputils/cpputils/list.hpp
SiliconLabs/mltk
56b19518187e9d1c8a0d275de137fc9058984a1f
[ "Zlib" ]
1
2021-11-19T20:10:09.000Z
2021-11-19T20:10:09.000Z
cpp/shared/cpputils/cpputils/list.hpp
sldriedler/mltk
d82a60359cf875f542a2257f1bc7d8eb4bdaa204
[ "Zlib" ]
null
null
null
#pragma once #include <cstdint> #include "cpputils/helpers.hpp" namespace cpputils { /** * @brief List Iterator */ struct ListIterator { uint8_t *ptr; uint32_t entry_size; ListIterator(uint8_t *ptr, uint32_t entry_size) : ptr(ptr), entry_size(entry_size) { } bool operator!=(const ListIterator& rhs) { return ptr != rhs.ptr; } void* operator*() { return static_cast<void*>(ptr); } void operator++() { ptr += entry_size; } }; /** * @brief List object */ class List { public: List(uint32_t entry_size=sizeof(void*), uint32_t initial_capacity = 4); List(uint32_t entry_size, uint32_t max_capacity, void* buffer); ~List(); void initialize(uint32_t entry_size=sizeof(void*), uint32_t initial_capacity = 4); void initialize(uint32_t entry_size, uint32_t max_capacity, void* buffer); bool clone(List &other); bool append(const void* val, bool unique=false); bool prepend(const void* val, bool unique=false); bool remove(const void* val); bool remove(int i); void* get(int i) const; template<typename T> T* get(int i) const { return static_cast<T*>(get(i)); } void clear(void); bool contains(const void *val) const; constexpr void* list(void) const { return static_cast<void*>(head_); } void* operator [](int i) const { return get(i); } template<typename T> T* operator [](int i) const { return get<T>(i); } constexpr uint32_t size(void) const { return count_; } constexpr uint32_t capacity(void) const { return capacity_; } constexpr bool empty(void) const { return count_ == 0; } constexpr bool full(void) const { return count_ == capacity_; } ListIterator begin(void) const { return ListIterator(head_, entry_size_); } ListIterator end() const { return ListIterator((head_ == nullptr) ? nullptr : &head_[count_*entry_size_], entry_size_); } bool has_malloc_error() const { return has_malloc_error_; } protected: uint8_t *head_; uint32_t entry_size_; int32_t count_; uint32_t initial_capacity_; uint32_t capacity_; bool is_mutable_; bool has_malloc_error_; bool owns_buffer_; bool increase_size(uint32_t new_size); // Remove the copy constructors MAKE_CLASS_NON_ASSIGNABLE(List); }; } // namespace cpputils
16.861842
100
0.612563
[ "object" ]
a9bdfddb21fdbb2caf1c38a27da9355cf3edb93f
2,548
cpp
C++
Tudat/JsonInterface/Propagation/export.cpp
sebranchett/tudat
24e5f3cc85c250fcbed0aac37f026c1dd7fd6c44
[ "BSD-3-Clause" ]
null
null
null
Tudat/JsonInterface/Propagation/export.cpp
sebranchett/tudat
24e5f3cc85c250fcbed0aac37f026c1dd7fd6c44
[ "BSD-3-Clause" ]
null
null
null
Tudat/JsonInterface/Propagation/export.cpp
sebranchett/tudat
24e5f3cc85c250fcbed0aac37f026c1dd7fd6c44
[ "BSD-3-Clause" ]
null
null
null
/* Copyright (c) 2010-2019, Delft University of Technology * All rigths reserved * * This file is part of the Tudat. Redistribution and use in source and * binary forms, with or without modification, are permitted exclusively * under the terms of the Modified BSD license. You should have received * a copy of the license with this file. If not, please or visit: * http://tudat.tudelft.nl/LICENSE. * */ #include "Tudat/JsonInterface/Propagation/export.h" namespace tudat { namespace json_interface { //! Create a `json` object from a shared pointer to a `ExportSettings` object. void to_json( nlohmann::json& jsonObject, const std::shared_ptr< ExportSettings >& exportSettings ) { if ( ! exportSettings ) { return; } using K = Keys::Export; jsonObject[ K::file ] = exportSettings->outputFile_; jsonObject[ K::variables ] = exportSettings->variables_; assignIfNotEmpty( jsonObject, K::header, exportSettings->header_ ); jsonObject[ K::epochsInFirstColumn ] = exportSettings->epochsInFirstColumn_; jsonObject[ K::onlyInitialStep ] = exportSettings->onlyInitialStep_; jsonObject[ K::onlyFinalStep ] = exportSettings->onlyFinalStep_; jsonObject[ K::numericalPrecision ] = exportSettings->numericalPrecision_; jsonObject[ K::printVariableIndicesToTerminal ] = exportSettings->printVariableIndicesToTerminal_; } //! Create a shared pointer to a `ExportSettings` object from a `json` object. void from_json( const nlohmann::json& jsonObject, std::shared_ptr< ExportSettings >& exportSettings ) { using namespace propagators; using K = Keys::Export; exportSettings = std::make_shared< ExportSettings >( getValue< boost::filesystem::path >( jsonObject, K::file ), getValue< std::vector< std::shared_ptr< VariableSettings > > >( jsonObject, K::variables ) ); updateFromJSONIfDefined( exportSettings->header_, jsonObject, K::header ); updateFromJSONIfDefined( exportSettings->epochsInFirstColumn_, jsonObject, K::epochsInFirstColumn ); updateFromJSONIfDefined( exportSettings->onlyInitialStep_, jsonObject, K::onlyInitialStep ); updateFromJSONIfDefined( exportSettings->onlyFinalStep_, jsonObject, K::onlyFinalStep ); updateFromJSONIfDefined( exportSettings->numericalPrecision_, jsonObject, K::numericalPrecision ); updateFromJSONIfDefined( exportSettings->printVariableIndicesToTerminal_, jsonObject, K::printVariableIndicesToTerminal ); } } // namespace simulation_setup } // namespace tudat
42.466667
126
0.739011
[ "object", "vector" ]
a9c4fc6e536b91e3e91584ae316160a111abf363
24,143
cxx
C++
StRoot/StEmcPool/StPhotonDataMaker/StPhotonMaker.cxx
xiaohaijin/RHIC-STAR
a305cb0a6ac15c8165bd8f0d074d7075d5e58752
[ "MIT" ]
2
2018-12-24T19:37:00.000Z
2022-02-28T06:57:20.000Z
StRoot/StEmcPool/StPhotonDataMaker/StPhotonMaker.cxx
xiaohaijin/RHIC-STAR
a305cb0a6ac15c8165bd8f0d074d7075d5e58752
[ "MIT" ]
null
null
null
StRoot/StEmcPool/StPhotonDataMaker/StPhotonMaker.cxx
xiaohaijin/RHIC-STAR
a305cb0a6ac15c8165bd8f0d074d7075d5e58752
[ "MIT" ]
null
null
null
#include <TROOT.h> #include <TTree.h> #include <TH2F.h> #include <TVector3.h> #include <TFile.h> #include <TMath.h> #include <assert.h> #include <StEvent.h> #include <StEventTypes.h> #include <StEmcUtil/geometry/StEmcGeom.h> #include <StEmcUtil/projection/StEmcPosition.h> #include <StEmcUtil/database/StBemcTables.h> #include <StEvent/StEnumerations.h> #include <StEmcRawMaker/defines.h> #include <StEmcADCtoEMaker/StEmcADCtoEMaker.h> #include <StMcEvent/StMcEvent.hh> #include <StMcEvent/StMcVertex.hh> #include <StMcEvent/StMcTrack.hh> //pythia record #include <St_DataSet.h> #include <St_DataSetIter.h> #include <tables/St_g2t_event_Table.h> #include <tables/St_particle_Table.h> #include <tables/St_g2t_pythia_Table.h> #include <StDetectorDbMaker/StDetectorDbTriggerID.h> #include <St_db_Maker/St_db_Maker.h> #include <StEmcTriggerMaker/StEmcTriggerMaker.h> //MyEvent #include <StEmcPool/StPhotonCommon/MyEvent.h> #include <StEmcPool/StPhotonCommon/MyPoint.h> #include <StEmcPool/StPhotonCommon/MyMcTrack.h> #include "StPhotonMaker.h" ClassImp(StPhotonMaker) StPhotonMaker::StPhotonMaker(const char *name,const char *outputFile, const char *type,const char *coll,Bool_t debug):StMaker(name) { mFileName=outputFile; mMc=kFALSE; mEmbed=kFALSE; mReal=kFALSE; mPythia=kFALSE; mHijing=kFALSE; if(strcmp(type,"mc")==0) mMc=kTRUE; else if(strcmp(type,"embed")==0) mEmbed=kTRUE; else if(strcmp(type,"pythia")==0) mPythia=kTRUE; else if(strcmp(type,"hijing")==0) mHijing=kTRUE; else mReal=kTRUE; mDAU=kFALSE; mPP04=kFALSE; mPP05=kFALSE; if(strcmp(coll,"dAu")==0){ mDAU=kTRUE; mTrig[0]=2001; mTrig[1]=2003; mTrig[2]=2201; mTrig[3]=2202; } if(strcmp(coll,"pp04")==0){ mPP04=kTRUE; mTrig[0]=45010; mTrig[1]=10; mTrig[2]=45201; mTrig[3]=45202; } if(strcmp(coll,"pp05")==0){ mPP05=kTRUE; mTrig[0]=96011; mTrig[1]=-10000; mTrig[2]=96201; mTrig[3]=96211; } mDebug=debug; mBemcTables=new StBemcTables(); mEvent=new MyEvent(); } StPhotonMaker::~StPhotonMaker() { //destructor } Int_t StPhotonMaker::Init() { h_EvSum=new TH1F("h_EvSum","see code for details",22,-1.5,20.5); h_bsmdeAdc=new TH1F("h_bsmdeAdc","adc",1200,-0.5,1199.5); h_bsmdpAdc=new TH1F("h_bsmdpAdc","adc",1200,-0.5,1199.5); h_btowAdc=new TH1F("h_btowAdc","adc",1200,-0.5,1199.5); h_bsmdeEn=new TH1F("h_bsmdeEn","energy",55,-1.,10.); h_btowEn=new TH1F("h_btowEn","energy",55,-1.,10.); h_btowEnVsAdc=new TH2F("h_btowEnVsAdc","h_btowEnVsAdc",1200,-0.5,1199.5,100,0.,30.); mEventTree=new TTree("mEventTree","tree with my event structure"); mEventTree->Branch("branch","MyEvent",&mEvent); mN=0; mRunId=0; mRunPrev=0; mEventId=0; mTrigger=0; mDate=0; mTime=0; mPs_mb=0; mPs_mb2=0; mPs_ht1=0; mPs_ht2=0; return StMaker::Init(); } Int_t StPhotonMaker::Make() { mN++; if(mDebug) cout<<endl<<"#### processing event "<<mN<<endl<<endl; h_EvSum->Fill(1); StEmcGeom *bemcGeom=StEmcGeom::getEmcGeom("bemc"); StEvent *event=0; event = (StEvent*)GetInputDS("StEvent"); if(!event){ h_EvSum->Fill(2); if(mDebug) cout << "************ StMyPhotonMaker::Make() no event pointer!! *********" << endl; return kStOK; } //test bbc coincidence: //StL0Trigger *l0trig=(StL0Trigger*)event->l0Trigger(); //unsigned short dsmInput=l0trig->dsmInput(); //cout<<"testing dsm: "<<dsmInput<<endl; if(!mHijing && !mMc && !mPythia && mAdcMaker->isCorrupted()){ if(mDebug) cout<<"event corrupted!"<<endl; h_EvSum->Fill(-1); return kStOK; } mRunPrev=mRunId; if(!mMc){ mRunId=event->runId(); mEventId=event->id(); } else{ mEventId=mN; mRunId=0; } if(mDebug) cout<<"starting run: "<<mRunId<<" and event: "<<mEventId<<endl; if(mRunId!=mRunPrev&&mReal){ StDetectorDbTriggerID& DetDbTrigId = *(StDetectorDbTriggerID::instance()); for(UInt_t i=0;i<DetDbTrigId.getL0NumRows();i++){ if(mDebug) cout<<"prescales: "<<DetDbTrigId.getPsL0(i)<<endl<<endl; if(DetDbTrigId.getL0OfflineTrgId(i)==mTrig[0]) mPs_mb=DetDbTrigId.getPsL0(i); if(DetDbTrigId.getL0OfflineTrgId(i)==mTrig[1]) mPs_mb2=DetDbTrigId.getPsL0(i); if(DetDbTrigId.getL0OfflineTrgId(i)==mTrig[2]) mPs_ht1=DetDbTrigId.getPsL0(i); if(DetDbTrigId.getL0OfflineTrgId(i)==mTrig[3]) mPs_ht2=DetDbTrigId.getPsL0(i); } mBemcTables->loadTables((StMaker*)this); } mDate=(Int_t)mDbMaker->GetDateTime().GetDate(); mTime=(Int_t)mDbMaker->GetDateTime().GetTime(); //get trigger info Float_t mips=-1.; Float_t zdcEast=0.; Float_t zdcWest=0.; Float_t zdcVertex=0.; Float_t bbcEast=0.; Float_t bbcWest=0.; StTriggerDetectorCollection *trigDetColl=event->triggerDetectorCollection(); if(trigDetColl){ StCtbTriggerDetector &CTB=trigDetColl->ctb(); mips=CTB.mips(0); StZdcTriggerDetector &ZDC=trigDetColl->zdc(); zdcEast=ZDC.adcSum(east); zdcWest=ZDC.adcSum(west); zdcVertex=ZDC.vertexZ(); StBbcTriggerDetector &BBC=trigDetColl->bbc(); bbcEast=BBC.adcSumEast(); bbcWest=BBC.adcSumWest(); } //----- CREATE MyEvent ----- mEvent=new MyEvent(mRunId,mEventId,mDate,mTime); if(!mEvent){ if(mDebug) cout<<"couldn't create MyEvent* !!"<<endl; return kStErr; } //extract MC data: StPrimaryVertex *pVert=event->primaryVertex(); StMcVertex *mc_pVert=0; StMcEvent* mc_event=0; if(mPythia||mHijing){ mc_event=(StMcEvent*)GetInputDS("StMcEvent"); if(!mc_event){ h_EvSum->Fill(4); if(mDebug) cout<<"StPhotonMaker::Make() no McEvent"<<endl; return kStOK; } mc_pVert=mc_event->primaryVertex(); if(!mc_pVert){ h_EvSum->Fill(5); if(mDebug) cout<<"StPhotonMaker::Make() no mc vertex!"<<endl; return kStOK; } } if(mMc||mEmbed){ mc_event=(StMcEvent*)GetInputDS("StMcEvent"); if(!mc_event){ h_EvSum->Fill(4); if(mDebug) cout<<"StPhotonMaker::Make() no McEvent"<<endl; return kStOK; } mc_pVert=mc_event->primaryVertex(); if(!mc_pVert){ h_EvSum->Fill(5); if(mDebug) cout<<"StPhotonMaker::Make() no mc vertex!"<<endl; return kStOK; } //get generated particles: StPtrVecMcTrack& trcks=mc_pVert->daughters(); Int_t nDaughters=mc_pVert->numberOfDaughters(); if(mDebug) cout<<"number of MC part. from vertex: "<<nDaughters<<endl; if(nDaughters==1){ StMcTrackIterator it=trcks.begin(); Int_t pid=(*it)->particleDefinition()->pdgEncoding(); if(mDebug) cout<<"daughter pid: "<<pid<<endl; // pid=111 -> pi0; pid=221 -> eta; pid=22 -> gamma; pid=(-)2112 -> (anti-)proton; pid=130 -> kzero_L // if we're talking mc gammas form the vertex, then we can fill one of the two branches if(pid==22){ MyMcTrack *mytr=new MyMcTrack(); mytr->setId(pid); mytr->setEnergy((*it)->energy()); if((*it)->stopVertex()){ if((*it)->stopVertex()->daughters().size()){ mytr->setStopRadius((*it)->stopVertex()->position().perp()); if(mDebug) cout<<"radius: "<<mytr->stopRadius()<<endl; } else if(mDebug) cout<<"no size"<<endl; } else if(mDebug) cout<<"no stop"<<endl; mytr->setMomentum((*it)->momentum().x(),(*it)->momentum().y(),(*it)->momentum().z()); StThreeVectorF v; v.setX(bemcGeom->Radius()*cos((*it)->momentum().phi())); v.setY(bemcGeom->Radius()*sin((*it)->momentum().phi())); v.setZ(bemcGeom->Radius()/tan((*it)->momentum().theta())); v=v + mc_pVert->position(); mytr->setPosition(v.x(),v.y(),v.z()); //add generated mc particle to event mEvent->setMcTrack(mytr); delete mytr; } else if(pid==111||pid==221||pid==2112||pid==-2112||pid==211||pid==130){ MyMcTrack *mytr=new MyMcTrack(); mytr->setId(pid); mytr->setEnergy((*it)->energy()); if((*it)->stopVertex()){ if((*it)->stopVertex()->daughters().size()){ mytr->setStopRadius((*it)->stopVertex()->position().perp()); } } StThreeVectorF v; v.setX(bemcGeom->Radius()*cos((*it)->momentum().phi())); v.setY(bemcGeom->Radius()*sin((*it)->momentum().phi())); v.setZ(bemcGeom->Radius()/tan((*it)->momentum().theta())); v=v + mc_pVert->position(); mytr->setMomentum((*it)->momentum().x(),(*it)->momentum().y(),(*it)->momentum().z()); mytr->setPosition(v.x(),v.y(),v.z()); //add generated mc particle to event mEvent->setMcTrack(mytr); delete mytr; //and the daughters -> photons!! if((*it)->stopVertex()){ StMcVertex *sVert=(*it)->stopVertex(); StPtrVecMcTrack& gammaTracks=sVert->daughters(); for(StMcTrackIterator itd=gammaTracks.begin();itd!=gammaTracks.end();itd++){ Int_t pid2=(*itd)->particleDefinition()->pdgEncoding(); MyMcTrack *mytr2=new MyMcTrack(); mytr2->setId(pid2); mytr2->setEnergy((*itd)->energy()); if((*itd)->stopVertex()){ if((*itd)->stopVertex()->daughters().size()){ mytr2->setStopRadius((*it)->stopVertex()->position().perp()); } } StThreeVectorF vv; vv.setX(bemcGeom->Radius()*cos((*itd)->momentum().phi())); vv.setY(bemcGeom->Radius()*sin((*itd)->momentum().phi())); vv.setZ(bemcGeom->Radius()/tan((*itd)->momentum().theta())); vv=vv + mc_pVert->position(); mytr2->setMomentum((*itd)->momentum().x(),(*itd)->momentum().y(),(*itd)->momentum().z()); mytr2->setPosition(vv.x(),vv.y(),vv.z()); mEvent->addMcPhoton(mytr2); delete mytr2; } } } else cout<<"what kind of MC particle is this??? (shouldn't see this)"<<endl; } else if(mMc && nDaughters>1){ if(mDebug) cout<<"more than one particle per event"<<endl; StMcTrackIterator it=trcks.begin(); Int_t pid=(*it)->particleDefinition()->pdgEncoding(); if(mDebug) cout<<"daughter pid: "<<pid<<endl; if(pid==-2112 || pid==2112 || pid==221){ for(UInt_t i=0;i<trcks.size();i++){ Float_t neutronenergy=trcks[i]->energy(); MyMcTrack *myTR=new MyMcTrack(); myTR->setId(pid); myTR->setEnergy(neutronenergy); myTR->setMomentum(trcks[i]->momentum().x(),trcks[i]->momentum().y(),trcks[i]->momentum().z()); StThreeVectorF v; v.setX(bemcGeom->Radius()*cos(trcks[i]->momentum().phi())); v.setY(bemcGeom->Radius()*sin(trcks[i]->momentum().phi())); v.setZ(bemcGeom->Radius()/tan(trcks[i]->momentum().theta())); v=v + mc_pVert->position(); myTR->setPosition(v.x(),v.y(),v.z()); mEvent->addMcPion(myTR); delete myTR; } } } } if(!pVert&&!mc_pVert){ h_EvSum->Fill(6); if(mDebug) cout<<"StPhotonMaker::Make() no primary vertex"<<endl; return kStOK; } if(mPythia){ //get partonic pT (thanks Frank): TDataSet *gEvent=GetDataSet("geant"); TDataSetIter geantDstI(gEvent); //St_particle *particleTabPtr=(St_particle*)geantDstI("particle"); //particle_st* particleTable=particleTabPtr->GetTable(); //St_g2t_event *Pg2t_event=(St_g2t_event*)geantDstI("g2t_event"); //g2t_event_st *g2t_event1=Pg2t_event->GetTable(); //Get parontic pT,xb1,xb2 St_g2t_pythia *Pg2t_pythia=(St_g2t_pythia*)geantDstI("g2t_pythia"); if(Pg2t_pythia){ g2t_pythia_st *g2t_pythia1=Pg2t_pythia->GetTable(); if(g2t_pythia1){ float hard_p=g2t_pythia1->hard_p; mEvent->setPartonPt(hard_p); } } } if(mPythia||mHijing){ StPtrVecMcTrack& tracs=mc_event->tracks(); for(UInt_t i=0;i<tracs.size();i++){ //use geant id for pythia! if(tracs[i]->geantId()==7){ Float_t pionenergy=tracs[i]->energy(); MyMcTrack *myTR=new MyMcTrack(); myTR->setId(111); myTR->setEnergy(pionenergy); myTR->setMomentum(tracs[i]->momentum().x(),tracs[i]->momentum().y(),tracs[i]->momentum().z()); StThreeVectorF v; v.setX(bemcGeom->Radius()*cos(tracs[i]->momentum().phi())); v.setY(bemcGeom->Radius()*sin(tracs[i]->momentum().phi())); v.setZ(bemcGeom->Radius()/tan(tracs[i]->momentum().theta())); v=v + mc_pVert->position(); myTR->setPosition(v.x(),v.y(),v.z()); mEvent->addMcPion(myTR); delete myTR; } if(tracs[i]->geantId()==1){ Float_t photonenergy=tracs[i]->energy(); MyMcTrack *myTR=new MyMcTrack(); myTR->setId(22); //get parent id: //int parentid=-1; //if(tracs[i]->parent()){ // parentid=tracs[i]->parent()->geantId(); //} //if(parentid==7) parentid=111; //else if(parentid==17) parentid=221; //else parentid=0; //myTR->setParentId(parentid); myTR->setEnergy(photonenergy); myTR->setMomentum(tracs[i]->momentum().x(),tracs[i]->momentum().y(),tracs[i]->momentum().z()); StThreeVectorF v; v.setX(bemcGeom->Radius()*cos(tracs[i]->momentum().phi())); v.setY(bemcGeom->Radius()*sin(tracs[i]->momentum().phi())); v.setZ(bemcGeom->Radius()/tan(tracs[i]->momentum().theta())); v=v + mc_pVert->position(); myTR->setPosition(v.x(),v.y(),v.z()); mEvent->addMcPhoton(myTR); delete myTR; } } } if(!pVert&&mEmbed){ h_EvSum->Fill(7); if(mDebug) cout<<"StPhotonMaker::Make() no primary vertex ****"<<endl; return kStOK; } StThreeVectorF vPos,mc_vPos; if(mMc||mEmbed||mPythia||mHijing){ mc_vPos=mc_pVert->position(); if(mMc||mPythia) vPos=mc_vPos; } if(mEmbed||mReal||mHijing){ if(pVert) vPos=pVert->position(); } //get trig per event mTrigger=0; if(mReal&&event->triggerIdCollection()&&event->triggerIdCollection()->nominal()){ if(event->triggerIdCollection()->nominal()->isTrigger(mTrig[0])|| event->triggerIdCollection()->nominal()->isTrigger(mTrig[1])) mTrigger+=1; if(event->triggerIdCollection()->nominal()->isTrigger(mTrig[2])) mTrigger+=2; if(event->triggerIdCollection()->nominal()->isTrigger(mTrig[3])) mTrigger+=4; if(event->triggerIdCollection()->nominal()->isTrigger(2002)) mTrigger+=8; } StEmcTriggerMaker *triggermaker=dynamic_cast<StEmcTriggerMaker*>(GetMaker("bemctrigger")); assert(triggermaker); if(mMc||mEmbed){ mTrigger=1; if(mDate<20060001){ if(triggermaker->is2005HT1()) mTrigger+=2; if(triggermaker->is2005HT2()) mTrigger+=4; } else{ cout<<"check timestamp -> triggermaker"<<endl; assert(0); } } if(mPythia){ mTrigger=1; //get result from triggerMaker, 2005 for now: if(mDate<20050101) assert(0); if(triggermaker->is2005HT1()) mTrigger+=2; if(triggermaker->is2005HT2()) mTrigger+=4; } if(mHijing){ mTrigger=1; } if(mTrigger==0){ if(mDebug) cout<<"nothing more useless than an event with no trigger!"<<endl; return kStOK; } StEmcCollection *emcCol=(StEmcCollection*)event->emcCollection(); if(!emcCol){ if(mDebug) cout<<"no emccollection!!"<<endl; h_EvSum->Fill(8); return kStOK; } StEmcDetector *emcDet=(StEmcDetector*)emcCol->detector(kBarrelEmcTowerId); if(!emcDet){ if(mDebug) cout<<"no emcDet!!"<<endl; h_EvSum->Fill(9); return kStOK; } //get status of trigger tower Int_t hiTowId=-1; Int_t hiTowAdc=-1; Int_t hiTowStatus=-1; Float_t hiTowEnergy=0.; if(mTrigger>1 || mEmbed || mMc){ for(UInt_t m=1;m<=emcDet->numberOfModules();m++){ StEmcModule *emcMod=emcDet->module(m); if(!emcMod){ if(mDebug) cout<<"no emcMod for module "<<m<<endl; continue; } StSPtrVecEmcRawHit& modHits=emcMod->hits(); for(UInt_t h=0;h<modHits.size();h++){ Int_t adc=modHits[h]->adc(); Float_t nrg=modHits[h]->energy(); //h_btowAdc->Fill(adc); //h_btowEn->Fill(nrg); //h_btowEnVsAdc->Fill(adc,nrg); if(adc>hiTowAdc && nrg>0.){ hiTowAdc=adc; hiTowEnergy=nrg; bemcGeom->getId(m,modHits[h]->eta(),modHits[h]->sub(),hiTowId); } } } //get status if(hiTowId>0) mBemcTables->getStatus(BTOW,hiTowId,hiTowStatus); } StEmcDetector *bsmdeDet=(StEmcDetector*)emcCol->detector(kBarrelSmdEtaStripId); if(!bsmdeDet){ return kStOK; } StEmcDetector *bsmdpDet=(StEmcDetector*)emcCol->detector(kBarrelSmdPhiStripId); if(!bsmdpDet){ return kStOK; } for(UInt_t m2=1;m2<=bsmdeDet->numberOfModules();m2++){ StEmcModule *bsmdeMod=bsmdeDet->module(m2); StSPtrVecEmcRawHit& bsmdeHits=bsmdeMod->hits(); for(UInt_t h2=0;h2<bsmdeHits.size();h2++){ h_bsmdeAdc->Fill(bsmdeHits[h2]->adc()); } } for(UInt_t m2=1;m2<=bsmdpDet->numberOfModules();m2++){ StEmcModule *bsmdpMod=bsmdpDet->module(m2); StSPtrVecEmcRawHit& bsmdpHits=bsmdpMod->hits(); for(UInt_t h2=0;h2<bsmdpHits.size();h2++){ h_bsmdpAdc->Fill(bsmdpHits[h2]->adc()); } } StSPtrVecEmcPoint& barrelPoints=emcCol->barrelPoints(); Int_t nPrimTracks=0; Int_t nGoodPrimaries=0; Int_t nGoodPrimBarrel=0; Int_t nGoodGlobals=0; Float_t TpcPt=0.; Float_t TpcPtBarrelWest=0.; if(event->primaryVertex()){ nPrimTracks=pVert->numberOfDaughters(); StSPtrVecTrackNode& trackNode=event->trackNodes(); if(mDebug) cout<<"number of tracknodes: "<<trackNode.size()<<endl; for(UInt_t j=0;j<trackNode.size();j++){ StPrimaryTrack* track=static_cast<StPrimaryTrack*>(trackNode[j]->track(primary)); if(track && track->flag()>0 && track->geometry()){ //get DCA Double_t pathlength=track->geometry()->helix().pathLength(vPos,kFALSE); StThreeVectorD v=track->geometry()->helix().at(pathlength) - vPos; Float_t dca=v.mag(); //get number of fit points const StTrackFitTraits& fitTraits=track->fitTraits(); unsigned short numFitPoints=fitTraits.numberOfFitPoints(); if(numFitPoints>15&&dca<3.){ nGoodPrimaries++; Float_t tracEta=track->geometry()->momentum().pseudoRapidity(); if(tracEta>0.&&tracEta<1.){ nGoodPrimBarrel++; TpcPtBarrelWest+=track->geometry()->momentum().perp(); } TpcPt+=track->geometry()->momentum().perp(); } } StGlobalTrack* gtrack=static_cast<StGlobalTrack*>(trackNode[j]->track(global)); if(gtrack && gtrack->flag()>0 && gtrack->geometry()){ const StTrackFitTraits& fitTraitsG=gtrack->fitTraits(); unsigned short numFitPointsG=fitTraitsG.numberOfFitPoints(); if(numFitPointsG>15) nGoodGlobals++; } } } //FTPC tracks for centrality, copied from "StRoot/StEventUtilities/StuFtpcRefMult.hh" Int_t ftpcRefMultTracks=0; if(event->primaryVertex()){ const StSPtrVecPrimaryTrack& tracks=pVert->daughters(); for(StSPtrVecPrimaryTrackConstIterator iter = tracks.begin(); iter != tracks.end(); iter++){ StTrack* track = (*iter); if(!track->geometry()){ if(mDebug) cout<<"no track geometry! -> NEXT"<<endl; continue; } //check if possible FTPC tracks if(track->fitTraits().numberOfFitPoints()<6||(track->fitTraits().numberOfFitPoints()>11)) continue; //check eta range and FTPC east if(track->geometry()->momentum().pseudoRapidity()>-2.8||track->geometry()->momentum().pseudoRapidity()<=-3.8) continue; //check pt if(track->geometry()->momentum().perp()>=3.) continue; //finally, check dca, if a track satisfies gets inside the if, count it. StTrack *glt=track->node()->track(global); if(!glt){ if(mDebug) cout<<"no global track!"<<endl; continue; } if(!glt->geometry()){ if(mDebug) cout<<"no geom.!"<<endl; continue; } if(glt->geometry()->helix().distance(vPos)<3.) ftpcRefMultTracks++; } } //start reco tree here: StEmcPoint *pt=0; Float_t EnergyNeutral=0.; for(UInt_t i=0;i<barrelPoints.size();i++) { MyPoint *mypt=new MyPoint(); pt=(StEmcPoint*)barrelPoints[i]; Float_t dist=9999.; if(!calcDistanceTrackToPoint(pt,dist)){ cout<<"wrong bfield or no StEvent pointer (shouldn't see this)"<<endl; } if(pt->position().pseudoRapidity()>0.0)//only WEST EnergyNeutral+=pt->energy(); StPtrVecEmcCluster& etaClus=pt->cluster(kBarrelSmdEtaStripId); StPtrVecEmcCluster& phiClus=pt->cluster(kBarrelSmdPhiStripId); Int_t nEtaHits=0; Int_t nPhiHits=0; Float_t etaEnergy=0.; Float_t phiEnergy=0.; Float_t etaWidth=0.; Float_t phiWidth=0.; if(etaClus.size()>0){ StEmcCluster *clE=(StEmcCluster*)etaClus[0]; StPtrVecEmcRawHit& hE=clE->hit(); nEtaHits=hE.size(); etaEnergy=clE->energy(); etaWidth=clE->sigmaEta(); } if(phiClus.size()>0){ StEmcCluster *clP=(StEmcCluster*)phiClus[0]; StPtrVecEmcRawHit& hP=clP->hit(); nPhiHits=hP.size(); phiEnergy=clP->energy(); phiWidth=clP->sigmaPhi(); } mypt->setEnergy(pt->energy()); mypt->setQuality((Int_t)pt->quality()); mypt->setPosition(pt->position().x(),pt->position().y(),pt->position().z()); mypt->setDistanceToTrack(dist); mypt->setHitsEta(nEtaHits); mypt->setWidthEta(etaWidth); mypt->setEnergyEta(etaEnergy); mypt->setHitsPhi(nPhiHits); mypt->setWidthPhi(phiWidth); mypt->setEnergyPhi(phiEnergy); mEvent->addPoint(mypt); delete mypt; } //fill MyEvent mEvent->setPrescale(0,mPs_mb); mEvent->setPrescale(1,mPs_mb2); mEvent->setPrescale(2,mPs_ht1); mEvent->setPrescale(3,mPs_ht2); mEvent->setHighTowerAdc(hiTowAdc); mEvent->setHighTowerId(hiTowId); mEvent->setHighTowerStatus(hiTowStatus); mEvent->setHighTowerEnergy(hiTowEnergy); mEvent->setVertex(vPos.x(),vPos.y(),vPos.z()); mEvent->setTrigger(mTrigger); mEvent->setGoodPrimaries(nGoodPrimaries); mEvent->setGoodPrimBarrel(nGoodPrimBarrel); mEvent->setGoodGlobals(nGoodGlobals); mEvent->setRefMult(ftpcRefMultTracks); mEvent->setEnergyInBarrel(EnergyNeutral); mEvent->setMomentumInTpc(TpcPt); mEvent->setMomentumInTpcWest(TpcPtBarrelWest); mEvent->setCtbSum(mips); mEvent->setBbcSumEast(bbcEast); mEvent->setBbcSumWest(bbcWest); mEvent->setZdcSumEast(zdcEast); mEvent->setZdcSumWest(zdcWest); mEvent->setZdcVertexZ(zdcVertex); if(mHijing){ mEvent->setZdcVertexZ(mc_vPos.z()); } mEventTree->Fill(); return kStOK; } Int_t StPhotonMaker::Finish() { saveHistograms(); return kStOK; } void StPhotonMaker::saveHistograms() { if(mDebug) cout<<"************ saving histograms ****************"<<endl; TFile *hfile=(TFile*)gROOT->FindObject(mFileName); if(hfile) hfile->Close(); hfile=new TFile(mFileName,"RECREATE"); //hfile->SetCompressionLevel(1); //---- h_EvSum->Write(); h_bsmdeAdc->Write(); h_bsmdpAdc->Write(); //h_bsmdeEn->Write(); //h_btowAdc->Write(); //h_btowEn->Write(); //h_btowEnVsAdc->Write(); mEventTree->Write(); //---- hfile->Close(); } void StPhotonMaker::setDbMaker(St_db_Maker *dbM) { mDbMaker=dbM; } void StPhotonMaker::setAdcMaker(StEmcADCtoEMaker *adc) { mAdcMaker=adc; } Bool_t StPhotonMaker::calcDistanceTrackToPoint(StEmcPoint *point,Float_t &distanceToTrack) { StEvent *event = (StEvent*)this->GetInputDS("StEvent"); if(!event){ if(mDebug) cout<<"can't get Event pointer"<<endl; return kFALSE; } Double_t bFld=0.; StEventSummary* summary = event->summary(); if(summary){ bFld = summary->magneticField()/10.; // bFld in Tesla if(mDebug) cout<<"summary()->magneticField()="<<bFld<<"(Tesla)"<<endl; } if(TMath::Abs(bFld)<0.01&&!mMc){ if(mDebug) cout<<"wrong mBField!"<<endl; return kFALSE; } StEmcPosition* emcPosition = new StEmcPosition(); StThreeVectorD pos, mom; StSPtrVecTrackNode& trackNodes = event->trackNodes(); StTrack* track; distanceToTrack=999.; for (size_t nodeIndex=0; nodeIndex<trackNodes.size();nodeIndex++){ size_t numberOfTracksInNode=trackNodes[nodeIndex]->entries(global); for(size_t trackIndex=0; trackIndex<numberOfTracksInNode;trackIndex++){ track = trackNodes[nodeIndex]->track(primary,trackIndex); if (track && track->flag()>=0){ if(track->geometry()->momentum().mag()<.5) continue; StPhysicalHelixD helix=track->outerGeometry()->helix(); Bool_t projOK=emcPosition->projTrack(&pos,&mom,track,bFld,230.705,1); if(!projOK) continue; Float_t d=(pos - point->position()).mag();//in cm if(d<distanceToTrack&&d>0.) distanceToTrack=d; } } } delete emcPosition; return kTRUE; }
30.716285
115
0.648097
[ "geometry" ]
a9c79162056d9e28bd178396bde501f039a1793d
6,013
cc
C++
anc/stim_src_v1.3/src/benchmark_main.perf.cc
Strilanc/stim-paper
be41a2087f8adeff25ce28b67d3e3fa6d097aa36
[ "Apache-2.0" ]
1
2021-09-18T00:56:25.000Z
2021-09-18T00:56:25.000Z
anc/stim_src_v1.3/src/benchmark_main.perf.cc
Strilanc/stim-paper
be41a2087f8adeff25ce28b67d3e3fa6d097aa36
[ "Apache-2.0" ]
4
2021-03-08T16:31:24.000Z
2021-05-11T18:25:06.000Z
anc/stim_src_v1.3/src/benchmark_main.perf.cc
Strilanc/stim-paper
be41a2087f8adeff25ce28b67d3e3fa6d097aa36
[ "Apache-2.0" ]
null
null
null
// Copyright 2021 Google LLC // // 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 <cmath> #include <iostream> #include <sstream> #include "arg_parse.h" #include "benchmark_util.h" RegisteredBenchmark *running_benchmark = nullptr; std::vector<RegisteredBenchmark> all_registered_benchmarks{}; /// Describe quantity as an SI-prefixed value with two significant figures. std::string si2(double val) { std::string unit = ""; if (val < 1) { if (val < 1) { val *= 1000; unit = "m"; } if (val < 1) { val *= 1000; unit = "u"; } if (val < 1) { val *= 1000; unit = "n"; } if (val < 1) { val *= 1000; unit = "p"; } } else { if (val > 1000) { val /= 1000; unit = "k"; } if (val > 1000) { val /= 1000; unit = "M"; } if (val > 1000) { val /= 1000; unit = "G"; } if (val > 1000) { val /= 1000; unit = "T"; } } std::stringstream ss; if (1 <= val && val < 10) { ss << (size_t)val << '.' << ((size_t)(val * 10) % 10); } else if (10 <= val && val < 100) { ss << ' ' << (size_t)val; } else if (100 <= val && val < 1000) { ss << (size_t)(val / 10) * 10; } else { ss << val; } ss << ' ' << unit; return ss.str(); } static std::vector<const char *> known_arguments{"--only", "--target_seconds"}; void find_benchmarks(const std::string &filter, std::vector<RegisteredBenchmark> &out) { bool found = false; if (!filter.empty() && filter[filter.size() - 1] == '*') { std::string start = filter.substr(0, filter.size() - 1); for (const auto &benchmark : all_registered_benchmarks) { if (benchmark.name.substr(0, start.size()) == start) { out.push_back(benchmark); found = true; } } } else { for (const auto &benchmark : all_registered_benchmarks) { if (benchmark.name == filter) { out.push_back(benchmark); found = true; } } } if (!found) { std::cerr << "No benchmark matching filter '" << filter << "'. Available benchmarks are:\n"; for (auto &benchmark : all_registered_benchmarks) { std::cerr << " " << benchmark.name << "\n"; } exit(EXIT_FAILURE); } } double BENCHMARK_CONFIG_TARGET_SECONDS = 0.5; int main(int argc, const char **argv) { check_for_unknown_arguments(known_arguments, nullptr, argc, argv); const char *only = find_argument("--only", argc, argv); BENCHMARK_CONFIG_TARGET_SECONDS = find_float_argument("--target_seconds", 0.5, 0, 10000, argc, argv); std::vector<RegisteredBenchmark> chosen_benchmarks; if (only == nullptr) { chosen_benchmarks = all_registered_benchmarks; } else { std::string filter_text = only; std::vector<std::string> filters{}; size_t s = 0; for (size_t k = 0;; k++) { if (only[k] == ',' || only[k] == '\0') { filters.push_back(filter_text.substr(s, k - s)); s = k + 1; } if (only[k] == '\0') { break; } } if (filters.empty()) { std::cerr << "No filters specified.\n"; exit(EXIT_FAILURE); } for (const auto &filter : filters) { find_benchmarks(filter, chosen_benchmarks); } } for (auto &benchmark : chosen_benchmarks) { running_benchmark = &benchmark; benchmark.func(); for (const auto &result : benchmark.results) { double actual_seconds_per_rep = result.total_seconds / result.total_reps; if (result.goal_seconds != -1) { int deviation = (int)round((log(result.goal_seconds) - log(actual_seconds_per_rep)) / (log(10) / 10.0)); std::cout << "["; for (int k = -20; k <= 20; k++) { if ((k < deviation && k < 0) || (k > deviation && k > 0)) { std::cout << '.'; } else if (k == deviation) { std::cout << '*'; } else if (k == 0) { std::cout << '|'; } else if (deviation < 0) { std::cout << '<'; } else { std::cout << '>'; } } std::cout << "] "; std::cout << si2(actual_seconds_per_rep) << "s"; std::cout << " (vs " << si2(result.goal_seconds) << "s) "; } else { std::cout << si2(actual_seconds_per_rep) << "s "; } for (const auto &e : result.marginal_rates) { const auto &multiplier = e.second; const auto &unit = e.first; std::cout << "(" << si2(result.total_reps / result.total_seconds * multiplier) << unit << "/s) "; } std::cout << benchmark.name << "\n"; if (benchmark.results.empty()) { std::cerr << "`benchmark_go` was not called from BENCH(" << benchmark.name << ")"; exit(EXIT_FAILURE); } } } return 0; }
32.857923
120
0.488109
[ "vector" ]
a9cdffd8a0f2325064445571bcf2f8cee721e742
3,296
cc
C++
common/text/token_info.cc
gareth8118/verible
0b0011b50b7b9774b11d6e824ada0ff2f34ef6a4
[ "Apache-2.0" ]
1
2020-10-21T00:35:54.000Z
2020-10-21T00:35:54.000Z
common/text/token_info.cc
gareth8118/verible
0b0011b50b7b9774b11d6e824ada0ff2f34ef6a4
[ "Apache-2.0" ]
null
null
null
common/text/token_info.cc
gareth8118/verible
0b0011b50b7b9774b11d6e824ada0ff2f34ef6a4
[ "Apache-2.0" ]
null
null
null
// Copyright 2017-2020 The Verible Authors. // // 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 "common/text/token_info.h" #include <algorithm> #include <cstddef> #include <iterator> #include <sstream> // IWYU pragma: keep // for ostringstream #include <string> #include <vector> #include "absl/strings/string_view.h" #include "common/strings/rebase.h" #include "common/util/logging.h" #include "common/util/range.h" namespace verible { TokenInfo TokenInfo::EOFToken() { static constexpr absl::string_view null_text; return TokenInfo(TK_EOF, null_text); } TokenInfo TokenInfo::EOFToken(absl::string_view buffer) { return TokenInfo(TK_EOF, absl::string_view(buffer.end(), 0)); } bool TokenInfo::operator==(const TokenInfo& token) const { return token_enum == token.token_enum && (token_enum == TK_EOF || // All EOF tokens considered equal. BoundsEqual(text, token.text)); } TokenInfo::Context::Context(absl::string_view b) : base(b), // By default, just print the enum integer value, un-translated. token_enum_translator([](std::ostream& stream, int e) { stream << e; }) {} std::ostream& TokenInfo::ToStream(std::ostream& output_stream, const Context& context) const { output_stream << "(#"; context.token_enum_translator(output_stream, token_enum); output_stream << " @" << left(context.base) << '-' << right(context.base) << ": \"" << text << "\")"; const auto dist = std::distance(context.base.end(), text.end()); CHECK(IsSubRange(text, context.base)) << "text.end() is off by " << dist; return output_stream; } std::ostream& TokenInfo::ToStream(std::ostream& output_stream) const { return output_stream << "(#" << token_enum << ": \"" << text << "\")"; } std::string TokenInfo::ToString(const Context& context) const { std::ostringstream output_stream; ToStream(output_stream, context); return output_stream.str(); } std::string TokenInfo::ToString() const { std::ostringstream output_stream; ToStream(output_stream); return output_stream.str(); } void TokenInfo::RebaseStringView(absl::string_view new_text) { verible::RebaseStringView(&text, new_text); } void TokenInfo::Concatenate(std::string* out, std::vector<TokenInfo>* tokens) { ConcatenateTokenInfos(out, tokens->begin(), tokens->end()); } // Print human-readable token information. std::ostream& operator<<(std::ostream& stream, const TokenInfo& token) { // This will exclude any byte offset information because the base address // of the enclosing stream is not known to this function. return token.ToStream(stream); } std::ostream& operator<<(std::ostream& stream, const TokenWithContext& t) { return t.token.ToStream(stream, t.context); } } // namespace verible
33.632653
80
0.702973
[ "vector" ]
a9ce4418d7e97a040e63ad2de2690172abe078c2
2,840
cpp
C++
graph-source-code/96-D/538717.cpp
AmrARaouf/algorithm-detection
59f3028d2298804870b32729415d71eec6116557
[ "MIT" ]
null
null
null
graph-source-code/96-D/538717.cpp
AmrARaouf/algorithm-detection
59f3028d2298804870b32729415d71eec6116557
[ "MIT" ]
null
null
null
graph-source-code/96-D/538717.cpp
AmrARaouf/algorithm-detection
59f3028d2298804870b32729415d71eec6116557
[ "MIT" ]
null
null
null
//Language: MS C++ #include<iostream> #include<cmath> #include<vector> #include<set> #include<algorithm> #include<string> #include<string.h> using namespace std; #define y1 fjkdsghfasj #define y0 dkgfsddkjsf typedef long long ll; #define pb push_back #define mp make_pair const double pi=2*acos(0.0); #define FOR(i,a,b) for(i=a;i<=b;i++) set< pair<ll,int> >q; vector< pair<int,ll> > g[1001]; int x,y,i,j,n,m,s,t,v; ll D[1001][1001],uns[1001],U,w,T[1001],C[1001]; int main() { // freopen("input.txt","r",stdin); U=1000000000000000LL; cin>>n>>m; cin>>s>>t; FOR(i,1,m) { cin>>x>>y>>w; g[x].pb(mp(y,w)); g[y].pb(mp(x,w)); } FOR(i,1,n) FOR(j,1,n) if(i==j)D[i][j]=0;else D[i][j]=U; FOR(i,1,n) { FOR(j,1,n)uns[j]=U; q.clear(); uns[i]=0; q.insert(mp(0,i)); for(;;) { if(q.empty())break; v=q.begin()->second; q.erase(q.begin()); FOR(j,0,(int)g[v].size()-1) { int to; ll len; to=g[v][j].first; len=uns[v]+g[v][j].second; if(len<uns[to]) { q.erase(mp(uns[to],to)); uns[to]=len; q.insert(mp(uns[to],to)); } } } FOR(j,1,n) { D[i][j]=min(D[i][j],uns[j]); D[j][i]=min(D[j][i],uns[j]); } } FOR(i,1,n)cin>>T[i]>>C[i]; FOR(i,1,n) { g[i].clear(); FOR(j,1,n)if(i!=j && D[i][j]<=T[i]) { g[i].pb(mp(j,C[i])); } } FOR(i,1,n)uns[i]=U; q.clear(); uns[s]=0; q.insert(mp(0,s)); for(;;) { if(q.empty())break; v=q.begin()->second; q.erase(q.begin()); FOR(j,0,(int)g[v].size()-1) { int to; ll len; to=g[v][j].first; len=uns[v]+g[v][j].second; if(len<uns[to]) { q.erase(mp(uns[to],to)); uns[to]=len; q.insert(mp(uns[to],to)); } } } if(uns[t]>=10000000000000LL)cout<<"-1"<<endl;else cout<<uns[t]<<endl; }
22.539683
80
0.324296
[ "vector" ]
a9d4dabb089bba65853e7b45715374023f3f3074
1,388
cpp
C++
aws-cpp-sdk-redshift/source/model/ModifyClusterSubnetGroupRequest.cpp
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-redshift/source/model/ModifyClusterSubnetGroupRequest.cpp
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
1
2021-10-14T16:57:00.000Z
2021-10-18T10:47:24.000Z
aws-cpp-sdk-redshift/source/model/ModifyClusterSubnetGroupRequest.cpp
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-11-09T11:58:03.000Z
2021-11-09T11:58:03.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/redshift/model/ModifyClusterSubnetGroupRequest.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/memory/stl/AWSStringStream.h> using namespace Aws::Redshift::Model; using namespace Aws::Utils; ModifyClusterSubnetGroupRequest::ModifyClusterSubnetGroupRequest() : m_clusterSubnetGroupNameHasBeenSet(false), m_descriptionHasBeenSet(false), m_subnetIdsHasBeenSet(false) { } Aws::String ModifyClusterSubnetGroupRequest::SerializePayload() const { Aws::StringStream ss; ss << "Action=ModifyClusterSubnetGroup&"; if(m_clusterSubnetGroupNameHasBeenSet) { ss << "ClusterSubnetGroupName=" << StringUtils::URLEncode(m_clusterSubnetGroupName.c_str()) << "&"; } if(m_descriptionHasBeenSet) { ss << "Description=" << StringUtils::URLEncode(m_description.c_str()) << "&"; } if(m_subnetIdsHasBeenSet) { unsigned subnetIdsCount = 1; for(auto& item : m_subnetIds) { ss << "SubnetIds.member." << subnetIdsCount << "=" << StringUtils::URLEncode(item.c_str()) << "&"; subnetIdsCount++; } } ss << "Version=2012-12-01"; return ss.str(); } void ModifyClusterSubnetGroupRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const { uri.SetQueryString(SerializePayload()); }
25.703704
103
0.708213
[ "model" ]
a9d88ba649665d20885fd52fff0f8b998234fb16
8,636
cc
C++
src/act.cc
L1nkZ/raglib
bfd5a931017371311a95194d336d35f564308950
[ "MIT" ]
3
2022-03-04T03:55:11.000Z
2022-03-14T12:03:50.000Z
src/act.cc
L1nkZ/raglib
bfd5a931017371311a95194d336d35f564308950
[ "MIT" ]
null
null
null
src/act.cc
L1nkZ/raglib
bfd5a931017371311a95194d336d35f564308950
[ "MIT" ]
1
2022-03-04T03:55:14.000Z
2022-03-04T03:55:14.000Z
// This is a generated file! Please edit source .ksy file and use // kaitai-struct-compiler to rebuild #include "raglib/act.h" #include "kaitai/exceptions.h" namespace raglib { act_t::act_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, act_t* p__root) : kaitai::kstruct(p__io) { m__parent = p__parent; m__root = this; m_actions = 0; m_sound_files = 0; m_animation_speeds = 0; try { _read(); } catch (...) { _clean_up(); throw; } } void act_t::_read() { m_magic = m__io->read_bytes(2); if (!(magic() == std::string("\x41\x43", 2))) { throw kaitai::validation_not_equal_error<std::string>( std::string("\x41\x43", 2), magic(), _io(), std::string("/seq/0")); } m_version = m__io->read_u2le(); m_action_count = m__io->read_u2le(); { uint16_t _ = action_count(); if (!(_ <= 256)) { throw kaitai::validation_expr_error<uint16_t>(action_count(), _io(), std::string("/seq/2")); } } m_unknown = m__io->read_bytes(10); int l_actions = action_count(); m_actions = new std::vector<action_t*>(); m_actions->reserve(l_actions); for (int i = 0; i < l_actions; i++) { m_actions->push_back(new action_t(m__io, this, m__root)); } n_sound_file_count = true; if (version() >= 513) { n_sound_file_count = false; m_sound_file_count = m__io->read_s4le(); { int32_t _ = sound_file_count(); if (!(_ <= 256)) { throw kaitai::validation_expr_error<int32_t>(sound_file_count(), _io(), std::string("/seq/5")); } } } n_sound_files = true; if (version() >= 513) { n_sound_files = false; int l_sound_files = sound_file_count(); m_sound_files = new std::vector<std::string>(); m_sound_files->reserve(l_sound_files); for (int i = 0; i < l_sound_files; i++) { m_sound_files->push_back(m__io->read_bytes(40)); } } n_animation_speeds = true; if (version() >= 514) { n_animation_speeds = false; m_animation_speeds = new std::vector<float>(); { int i = 0; while (!m__io->is_eof()) { m_animation_speeds->push_back(m__io->read_f4le()); i++; } } } } act_t::~act_t() { _clean_up(); } void act_t::_clean_up() { if (m_actions) { for (std::vector<action_t*>::iterator it = m_actions->begin(); it != m_actions->end(); ++it) { delete *it; } delete m_actions; m_actions = 0; } if (!n_sound_file_count) { } if (!n_sound_files) { if (m_sound_files) { delete m_sound_files; m_sound_files = 0; } } if (!n_animation_speeds) { if (m_animation_speeds) { delete m_animation_speeds; m_animation_speeds = 0; } } } act_t::action_t::action_t(kaitai::kstream* p__io, act_t* p__parent, act_t* p__root) : kaitai::kstruct(p__io) { m__parent = p__parent; m__root = p__root; m_frames = 0; try { _read(); } catch (...) { _clean_up(); throw; } } void act_t::action_t::_read() { m_frame_count = m__io->read_u4le(); { uint32_t _ = frame_count(); if (!(_ <= 256)) { throw kaitai::validation_expr_error<uint32_t>( frame_count(), _io(), std::string("/types/action/seq/0")); } } int l_frames = frame_count(); m_frames = new std::vector<frame_t*>(); m_frames->reserve(l_frames); for (int i = 0; i < l_frames; i++) { m_frames->push_back(new frame_t(m__io, this, m__root)); } } act_t::action_t::~action_t() { _clean_up(); } void act_t::action_t::_clean_up() { if (m_frames) { for (std::vector<frame_t*>::iterator it = m_frames->begin(); it != m_frames->end(); ++it) { delete *it; } delete m_frames; m_frames = 0; } } act_t::frame_t::frame_t(kaitai::kstream* p__io, act_t::action_t* p__parent, act_t* p__root) : kaitai::kstruct(p__io) { m__parent = p__parent; m__root = p__root; m_layers = 0; m_anchors = 0; try { _read(); } catch (...) { _clean_up(); throw; } } void act_t::frame_t::_read() { m_unknown = m__io->read_bytes(32); m_layer_count = m__io->read_u4le(); { uint32_t _ = layer_count(); if (!(_ <= 256)) { throw kaitai::validation_expr_error<uint32_t>( layer_count(), _io(), std::string("/types/frame/seq/1")); } } int l_layers = layer_count(); m_layers = new std::vector<layer_t*>(); m_layers->reserve(l_layers); for (int i = 0; i < l_layers; i++) { m_layers->push_back(new layer_t(m__io, this, m__root)); } n_sound_id = true; if (_root()->version() >= 512) { n_sound_id = false; m_sound_id = m__io->read_s4le(); } n_anchor_count = true; if (_root()->version() >= 515) { n_anchor_count = false; m_anchor_count = m__io->read_s4le(); { int32_t _ = anchor_count(); if (!(_ <= 256)) { throw kaitai::validation_expr_error<int32_t>( anchor_count(), _io(), std::string("/types/frame/seq/4")); } } } n_anchors = true; if (_root()->version() >= 515) { n_anchors = false; int l_anchors = anchor_count(); m_anchors = new std::vector<anchor_t*>(); m_anchors->reserve(l_anchors); for (int i = 0; i < l_anchors; i++) { m_anchors->push_back(new anchor_t(m__io, this, m__root)); } } } act_t::frame_t::~frame_t() { _clean_up(); } void act_t::frame_t::_clean_up() { if (m_layers) { for (std::vector<layer_t*>::iterator it = m_layers->begin(); it != m_layers->end(); ++it) { delete *it; } delete m_layers; m_layers = 0; } if (!n_sound_id) { } if (!n_anchor_count) { } if (!n_anchors) { if (m_anchors) { for (std::vector<anchor_t*>::iterator it = m_anchors->begin(); it != m_anchors->end(); ++it) { delete *it; } delete m_anchors; m_anchors = 0; } } } act_t::layer_t::layer_t(kaitai::kstream* p__io, act_t::frame_t* p__parent, act_t* p__root) : kaitai::kstruct(p__io) { m__parent = p__parent; m__root = p__root; m_position = 0; m_color = 0; try { _read(); } catch (...) { _clean_up(); throw; } } void act_t::layer_t::_read() { int l_position = 2; m_position = new std::vector<int32_t>(); m_position->reserve(l_position); for (int i = 0; i < l_position; i++) { m_position->push_back(m__io->read_s4le()); } m_index = m__io->read_s4le(); m_is_mirror = m__io->read_s4le(); n_color = true; if (_root()->version() >= 512) { n_color = false; int l_color = 4; m_color = new std::vector<uint8_t>(); m_color->reserve(l_color); for (int i = 0; i < l_color; i++) { m_color->push_back(m__io->read_u1()); } } n_scale_x = true; if (_root()->version() >= 512) { n_scale_x = false; m_scale_x = m__io->read_f4le(); } n_scale_y = true; if (_root()->version() >= 516) { n_scale_y = false; m_scale_y = m__io->read_f4le(); } n_angle = true; if (_root()->version() >= 512) { n_angle = false; m_angle = m__io->read_s4le(); } n_spr_type = true; if (_root()->version() >= 512) { n_spr_type = false; m_spr_type = m__io->read_s4le(); } n_width = true; if (_root()->version() >= 517) { n_width = false; m_width = m__io->read_s4le(); } n_height = true; if (_root()->version() >= 517) { n_height = false; m_height = m__io->read_s4le(); } } act_t::layer_t::~layer_t() { _clean_up(); } void act_t::layer_t::_clean_up() { if (m_position) { delete m_position; m_position = 0; } if (!n_color) { if (m_color) { delete m_color; m_color = 0; } } if (!n_scale_x) { } if (!n_scale_y) { } if (!n_angle) { } if (!n_spr_type) { } if (!n_width) { } if (!n_height) { } } act_t::anchor_t::anchor_t(kaitai::kstream* p__io, act_t::frame_t* p__parent, act_t* p__root) : kaitai::kstruct(p__io) { m__parent = p__parent; m__root = p__root; m_offset = 0; try { _read(); } catch (...) { _clean_up(); throw; } } void act_t::anchor_t::_read() { m_unknown1 = m__io->read_bytes(4); int l_offset = 2; m_offset = new std::vector<int32_t>(); m_offset->reserve(l_offset); for (int i = 0; i < l_offset; i++) { m_offset->push_back(m__io->read_s4le()); } m_unknown2 = m__io->read_bytes(4); } act_t::anchor_t::~anchor_t() { _clean_up(); } void act_t::anchor_t::_clean_up() { if (m_offset) { delete m_offset; m_offset = 0; } } } // namespace raglib
23.090909
80
0.574572
[ "vector" ]
a9dbc2af30ab0596b1133d011abfc153e4b19faf
9,033
hpp
C++
performance_test/src/experiment_execution/analysis_result.hpp
Blast545/performance_test
7081dd3fae9d1bfe985a94858b6c96650fd1bb4b
[ "Apache-2.0" ]
6
2018-10-31T07:17:08.000Z
2021-11-08T11:18:37.000Z
performance_test/src/experiment_execution/analysis_result.hpp
pal-robotics-forks/performance_test
e2cdb99eb51524c0c70c43ccdba43eb3656ea56b
[ "Apache-2.0" ]
34
2018-10-17T18:15:48.000Z
2022-03-17T17:05:34.000Z
performance_test/src/experiment_execution/analysis_result.hpp
pal-robotics-forks/performance_test
e2cdb99eb51524c0c70c43ccdba43eb3656ea56b
[ "Apache-2.0" ]
4
2019-05-28T17:02:37.000Z
2022-03-02T18:55:31.000Z
// Copyright 2017 Apex.AI, 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. #ifndef EXPERIMENT_EXECUTION__ANALYSIS_RESULT_HPP_ #define EXPERIMENT_EXECUTION__ANALYSIS_RESULT_HPP_ #include <sys/time.h> #include <sys/resource.h> #include <chrono> #include <sstream> #include <string> #include "../utilities/statistics_tracker.hpp" #include "../utilities/cpu_usage_tracker.hpp" #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED #include <odb/core.hxx> #include "experiment_configuration.hpp" #endif namespace performance_test { /// Outstream operator for timeval to seconds (double). std::ostream & operator<<(std::ostream & stream, const timeval & e); #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED class RusageTracker { public: RusageTracker() {} explicit RusageTracker(const rusage & sys_usage) : m_ru_utime(std::chrono::seconds(sys_usage.ru_utime.tv_sec) + std::chrono::microseconds(sys_usage.ru_utime.tv_usec)), m_ru_stime(std::chrono::seconds(sys_usage.ru_stime.tv_sec) + std::chrono::microseconds(sys_usage.ru_stime.tv_usec)), m_ru_maxrss(sys_usage.ru_maxrss), m_ru_ixrss(sys_usage.ru_ixrss), m_ru_idrss(sys_usage.ru_idrss), m_ru_isrss(sys_usage.ru_isrss), m_ru_minflt(sys_usage.ru_minflt), m_ru_majflt(sys_usage.ru_majflt), m_ru_nswap(sys_usage.ru_nswap), m_ru_inblock(sys_usage.ru_inblock), m_ru_oublock(sys_usage.ru_oublock), m_ru_msgsnd(sys_usage.ru_msgsnd), m_ru_msgrcv(sys_usage.ru_msgrcv), m_ru_nsignals(sys_usage.ru_nsignals), m_ru_nvcsw(sys_usage.ru_nvcsw), m_ru_nivcsw(sys_usage.ru_nivcsw) {} private: friend class odb::access; std::chrono::nanoseconds m_ru_utime; std::chrono::nanoseconds m_ru_stime; uint64_t m_ru_maxrss; uint64_t m_ru_ixrss; uint64_t m_ru_idrss; uint64_t m_ru_isrss; uint64_t m_ru_minflt; uint64_t m_ru_majflt; uint64_t m_ru_nswap; uint64_t m_ru_inblock; uint64_t m_ru_oublock; uint64_t m_ru_msgsnd; uint64_t m_ru_msgrcv; uint64_t m_ru_nsignals; uint64_t m_ru_nvcsw; uint64_t m_ru_nivcsw; }; #pragma \ db map type(std::chrono::nanoseconds) as(std::chrono::nanoseconds::rep) to((?).count ()) \ from(std::chrono::nanoseconds (?)) #pragma db value(StatisticsTracker) definition #pragma db value(RusageTracker) definition // Instead of pragma db value(timeval) definition, use platform-independent odb_timeval #pragma db value struct odb_timeval { std::chrono::nanoseconds tv_sec; std::chrono::nanoseconds tv_usec; }; #pragma db map type(timeval) as(odb_timeval) \ to(odb_timeval{(?).tv_sec, (?).tv_usec}) \ from(timeval{(?).tv_sec, (?).tv_usec}) // Instead of pragma db value(rusage) definition, use platform-independent odb_rusage #pragma db value struct odb_rusage { struct odb_timeval ru_utime; struct odb_timeval ru_stime; __extension__ union { uint64_t ru_maxrss; uint64_t __ru_maxrss_word; }; __extension__ union { uint64_t ru_ixrss; uint64_t __ru_ixrss_word; }; __extension__ union { uint64_t ru_idrss; uint64_t __ru_idrss_word; }; __extension__ union { uint64_t ru_isrss; uint64_t __ru_isrss_word; }; __extension__ union { uint64_t ru_minflt; uint64_t __ru_minflt_word; }; __extension__ union { uint64_t ru_majflt; uint64_t __ru_majflt_word; }; __extension__ union { uint64_t ru_nswap; uint64_t __ru_nswap_word; }; __extension__ union { uint64_t ru_inblock; uint64_t __ru_inblock_word; }; __extension__ union { uint64_t ru_oublock; uint64_t __ru_oublock_word; }; __extension__ union { uint64_t ru_msgsnd; uint64_t __ru_msgsnd_word; }; __extension__ union { uint64_t ru_msgrcv; uint64_t __ru_msgrcv_word; }; __extension__ union { uint64_t ru_nsignals; uint64_t __ru_nsignals_word; }; __extension__ union { uint64_t ru_nvcsw; uint64_t __ru_nvcsw_word; }; __extension__ union { uint64_t ru_nivcsw; uint64_t __ru_nivcsw_word; }; }; #pragma db map type(rusage) as(odb_rusage) \ to(odb_rusage{ \ (?).ru_utime, \ (?).ru_stime, \ (?).ru_maxrss, \ (?).ru_ixrss, \ (?).ru_idrss, \ (?).ru_isrss, \ (?).ru_minflt, \ (?).ru_majflt, \ (?).ru_nswap, \ (?).ru_inblock, \ (?).ru_oublock, \ (?).ru_msgsnd, \ (?).ru_msgrcv, \ (?).ru_nsignals, \ (?).ru_nvcsw, \ (?).ru_nivcsw, \ (?).__ru_maxrss_word, \ (?).__ru_ixrss_word, \ (?).__ru_idrss_word, \ (?).__ru_isrss_word, \ (?).__ru_minflt_word, \ (?).__ru_majflt_word, \ (?).__ru_nswap_word, \ (?).__ru_inblock_word, \ (?).__ru_oublock_word, \ (?).__ru_msgsnd_word, \ (?).__ru_msgrcv_word, \ (?).__ru_nsignals_word, \ (?).__ru_nvcsw_word, \ (?).__ru_nivcsw_word \ }) \ from(rusage{ \ (?).ru_utime, \ (?).ru_stime, \ (?).ru_maxrss, \ (?).ru_ixrss, \ (?).ru_idrss, \ (?).ru_isrss, \ (?).ru_minflt, \ (?).ru_majflt, \ (?).ru_nswap, \ (?).ru_inblock, \ (?).ru_oublock, \ (?).ru_msgsnd, \ (?).ru_msgrcv, \ (?).ru_nsignals, \ (?).ru_nvcsw, \ (?).ru_nivcsw, \ (?).__ru_maxrss_word, \ (?).__ru_ixrss_word, \ (?).__ru_idrss_word, \ (?).__ru_isrss_word, \ (?).__ru_minflt_word, \ (?).__ru_majflt_word, \ (?).__ru_nswap_word, \ (?).__ru_inblock_word, \ (?).__ru_oublock_word, \ (?).__ru_msgsnd_word, \ (?).__ru_msgrcv_word, \ (?).__ru_nsignals_word, \ (?).__ru_nvcsw_word, \ (?).__ru_nivcsw_word \ }) #pragma db value(CpuInfo) definition /// Represents the results of an experiment iteration. #pragma db object pointer(std::shared_ptr) #endif class AnalysisResult { public: /** * \brief Constructs an result with the specified parameters. * \param experiment_start Time the experiment started. * \param loop_start Time the loop iteration started. * \param num_samples_received Number of samples received during the experiment iteration. * \param num_samples_sent Number of samples sent during the experiment iteration. * \param num_samples_lost Number of samples lost during the experiment iteration. * \param total_data_received Total data received during the experiment iteration in bytes. * \param latency Latency statistics of samples received. * \param pub_loop_time_reserve Loop time statistics of the publisher threads. * \param sub_loop_time_reserve Loop time statistics of the subscriber threads. */ AnalysisResult( const std::chrono::nanoseconds experiment_start, const std::chrono::nanoseconds loop_start, const uint64_t num_samples_received, const uint64_t num_samples_sent, const uint64_t num_samples_lost, const std::size_t total_data_received, StatisticsTracker latency, StatisticsTracker pub_loop_time_reserve, StatisticsTracker sub_loop_time_reserve, const CpuInfo cpu_info ); #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED AnalysisResult() {} #endif /** * \brief Returns a header for a CVS file containing the analysis result data as a string. * \param pretty_print If set, inserts additional tabs to format the output nicer. * \param st The data seperator. * \return A string containing the CVS header. */ static std::string csv_header(const bool pretty_print = false, std::string st = ","); /** * \brief Returns the data contained the analysis result as a string. * \param pretty_print If set, inserts additional tabs to format the output nicer. * \param st The data seperator. * \return A string with the contained data as CSV row. */ std::string to_csv_string(const bool pretty_print = false, std::string st = ",") const; #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED void set_configuration(const ExperimentConfiguration * ec) { m_configuration = ec; } #endif private: #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED friend class odb::access; #pragma db not_null const ExperimentConfiguration * m_configuration; #pragma db id auto uint64_t m_id; #endif const std::chrono::nanoseconds m_experiment_start = {}; const std::chrono::nanoseconds m_loop_start = {}; const uint64_t m_num_samples_received = {}; const uint64_t m_num_samples_sent = {}; const uint64_t m_num_samples_lost = {}; const std::size_t m_total_data_received = {}; StatisticsTracker m_latency; StatisticsTracker m_pub_loop_time_reserve; StatisticsTracker m_sub_loop_time_reserve; #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED RusageTracker m_sys_tracker; #pragma db transient #endif rusage m_sys_usage; const CpuInfo m_cpu_info; }; } // namespace performance_test #endif // EXPERIMENT_EXECUTION__ANALYSIS_RESULT_HPP_
29.423453
93
0.724233
[ "object" ]
a9dbece086e2e7d4e0b96296e1805143fd662ca7
2,227
cpp
C++
2020-12-13/celular.cpp
pufe/programa
7f79566597446e9e39222e6c15fa636c3dd472bb
[ "MIT" ]
2
2020-12-12T00:02:40.000Z
2021-04-21T19:49:59.000Z
2020-12-13/celular.cpp
pufe/programa
7f79566597446e9e39222e6c15fa636c3dd472bb
[ "MIT" ]
null
null
null
2020-12-13/celular.cpp
pufe/programa
7f79566597446e9e39222e6c15fa636c3dd472bb
[ "MIT" ]
null
null
null
#include <cstdio> #include <cstdint> #include <cmath> #include <vector> using namespace std; typedef long long int num; const num mod = 1300031; const int maxn = 230; struct matrix_t { int n; num v[maxn][maxn]; void zero() { for(int i=0; i<n; ++i) for(int j=0; j<n; ++j) v[i][j]=0; } void print() { for(int i=0; i<n; ++i) { for(int j=0; j<n; ++j) printf(" %lld", v[i][j]); printf("\n"); } printf("---\n"); } num sum() { num t = 0; for(int i=0; i<n; ++i) for(int j=0; j<n; ++j) t=(t+v[i][j])%mod; return t; } }; matrix_t r, m, aux; int index(int x, int y, int n) { int d = (n+1)/2; if (x >= d) x = n-x-1; if (y >= d) y = n-y-1; int a = min(x, y); int b = max(x, y); int k = b*(b+1)/2+a; return k; } void operator*=(matrix_t& a, matrix_t& b) { aux.n = a.n; for(int i=0; i<a.n; ++i) for(int j=0; j<b.n; ++j) { aux.v[i][j]=0; for(int k=0; k<a.n; ++k) { aux.v[i][j]+=(a.v[i][k]*b.v[k][j])%mod; aux.v[i][j]%=mod; } } for(int i=0; i<a.n; ++i) for(int j=0; j<a.n; ++j) a.v[i][j] = aux.v[i][j]; } void exponentiate(matrix_t& a, int p, int n) { r.n = a.n; r.zero(); for(int x=0; x<n; ++x) for(int y=0; y<n; ++y) { int i=index(x, y, n); r.v[i][i]++; } while(p>0) { if (p%2==1) r *= a; a *= a; p /= 2; } } int gcd(int a, int b) { //printf("gcd(%d %d)\n", a, b); if (b==0) return a; return gcd(b, a%b); } bool connected(int x1, int y1, int x2, int y2) { int dx = abs(x1-x2); int dy = abs(y1-y2); return gcd(dx, dy)==1; } void generate(int n) { int d = (n+1)/2; m.n = d*(d+1)/2; m.zero(); for(int x1=0; x1<d; ++x1) for(int y1=0; y1<=x1; ++y1) { int i1 = index(x1, y1, n); for(int x2=0; x2<n; ++x2) for(int y2=0; y2<n; ++y2) if (connected(x1, y1, x2, y2)) m.v[i1][index(x2,y2,n)]++; } } int main() { int n, p; while(true) { scanf(" %d %d", &n, &p); if (n==0 && p==0) break; generate(n); exponentiate(m, p-1, n); printf("%lld\n", r.sum()); } return 0; }
19.034188
49
0.434216
[ "vector" ]
a9e2b1d4812c3508ad84aa12f554d15ba935e2a2
2,661
hpp
C++
include/morphotree/attributes/boundingboxComputer.hpp
dennisjosesilva/morphotree
3be4ff7f36de65772ef273a61b0bc5916e2904d9
[ "MIT" ]
null
null
null
include/morphotree/attributes/boundingboxComputer.hpp
dennisjosesilva/morphotree
3be4ff7f36de65772ef273a61b0bc5916e2904d9
[ "MIT" ]
3
2022-03-23T19:16:08.000Z
2022-03-28T00:40:19.000Z
include/morphotree/attributes/boundingboxComputer.hpp
dennisjosesilva/morphotree
3be4ff7f36de65772ef273a61b0bc5916e2904d9
[ "MIT" ]
null
null
null
#pragma once #include "morphotree/core/alias.hpp" #include "morphotree/core/point.hpp" #include "morphotree/core/box.hpp" #include "morphotree/attributes/attributeComputer.hpp" #include <limits> namespace morphotree { template<class ValueType> class BoundingBoxComputer : public AttributeComputer<Box, ValueType> { public: using AttrType = Box; using TreeType = typename AttributeComputer<Box, ValueType>::TreeType; using NodePtr = typename TreeType::NodePtr; BoundingBoxComputer(Box domain); std::vector<AttrType> initAttributes(const TreeType &tree); void computeInitialValue(std::vector<AttrType> &attr, NodePtr node); void mergeToParent(std::vector<AttrType> &attr, NodePtr node, NodePtr parent); private: Box domain_; }; // ======================= [ IMPLEMENTATION ] ================================================ template<class ValueType> BoundingBoxComputer<ValueType>::BoundingBoxComputer(Box domain) :domain_{domain} {} template<class ValueType> std::vector<typename BoundingBoxComputer<ValueType>::AttrType> BoundingBoxComputer<ValueType>::initAttributes(const TreeType &tree) { std::vector<AttrType> attr(tree.numberOfNodes(), Box()); tree.tranverse([&attr, this](NodePtr node) { int32 xmin = std::numeric_limits<int32>::max(); int32 ymin = std::numeric_limits<int32>::max(); int32 xmax = std::numeric_limits<int32>::min(); int32 ymax = std::numeric_limits<int32>::min(); for (uint32 pidx : node->cnps()) { I32Point p = domain_.indexToPoint(pidx); if (xmax < p.x()) xmax = p.x(); if (xmin > p.x()) xmin = p.x(); if (ymax < p.y()) ymax = p.y(); if (ymin > p.y()) ymin = p.y(); } attr[node->id()] = Box::fromCorners(I32Point{xmin, ymin}, I32Point{xmax, ymax}); }); return attr; } template<class ValueType> void BoundingBoxComputer<ValueType>::computeInitialValue(std::vector<AttrType> &attr, NodePtr node) { } template<class ValueType> void BoundingBoxComputer<ValueType>::mergeToParent(std::vector<AttrType> &attr, NodePtr node, NodePtr parent) { int32 left = attr[parent->id()].left(); int32 top = attr[parent->id()].top(); int32 right = attr[parent->id()].right(); int32 bottom = attr[parent->id()].bottom(); Box bb = attr[node->id()]; if (bb.left() < left) left = bb.left(); if (bb.right() > right) right = bb.right(); if (bb.top() < top) top = bb.top(); if (bb.bottom() > bottom) bottom = bb.bottom(); attr[parent->id()] = Box::fromCorners(I32Point{left, top}, I32Point{right, bottom}); } }
30.238636
96
0.636979
[ "vector" ]
a9e4e6608f23a83b1f69b1734fc18c8c61e36a9b
2,397
cpp
C++
rgb_pcl_streaming/src/main_multithread.cpp
conix-center/VolumetricStreaming
ec85c6dba23d65cc6f36742d9ddcaf168ee6b45c
[ "BSD-3-Clause" ]
null
null
null
rgb_pcl_streaming/src/main_multithread.cpp
conix-center/VolumetricStreaming
ec85c6dba23d65cc6f36742d9ddcaf168ee6b45c
[ "BSD-3-Clause" ]
null
null
null
rgb_pcl_streaming/src/main_multithread.cpp
conix-center/VolumetricStreaming
ec85c6dba23d65cc6f36742d9ddcaf168ee6b45c
[ "BSD-3-Clause" ]
null
null
null
#include <fstream> #include <iomanip> #include <iostream> #include <vector> #include <thread> #include <mutex> #include <math.h> #include <chrono> #include "ouster/client.h" #include "ouster/lidar_scan.h" #include "ouster/types.h" #include "pcl_camera_fusion.h" #include <pcl/io/pcd_io.h> #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/visualization/pcl_visualizer.h> #include <pcl/common/transforms.h> #include <pcl/common/impl/transforms.hpp> #include <pcl/filters/voxel_grid.h> #include <opencv2/core.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> #define VIDEO_DEVICE_ID 0 using namespace ouster; int main(int argc, char* argv[]) { if (argc != 3) { std::cerr << "Usage: rgb_pcl_streaming <sensor_hostname_1> <sensor_hostname_2>" << std::endl; return EXIT_FAILURE; } // Camera Init cv::VideoCapture cap; cap.open(VIDEO_DEVICE_ID); if (!cap.isOpened()) { std::cerr << "Failed to open capture device." << std::endl; return 1; } std::cout << "Camera opened successfully" << std::endl; cv::Mat frame; const std::string sensor_hostname_1 = argv[1]; const std::string sensor_hostname_2 = argv[2]; const std::string data_destination = ""; pcl::PointCloud<pcl::PointXYZRGB>::Ptr point_cloud_1(new pcl::PointCloud<pcl::PointXYZRGB>); pcl::PointCloud<pcl::PointXYZRGB>::Ptr point_cloud_2(new pcl::PointCloud<pcl::PointXYZRGB>); // pcl::PointCloud<pcl::PointXYZRGB>::Ptr transformed_cloud(new pcl::PointCloud<pcl::PointXYZRGB>); // pcl::PointCloud<pcl::PointXYZRGB>::Ptr voxel_cloud(new pcl::PointCloud<pcl::PointXYZRGB>); // float resolution = 0.05f; // pcl::octree::OctreePointCloudChangeDetector<pcl::PointXYZRGB> octree(resolution); // Multithreading starts here // std::thread lidar_scan(get_full_scan, handle, &scan, pf, batch_to_scan, w, h, column_window_length, lut, point_cloud, transformed_cloud, voxel_cloud, &octree); std::thread lidar_scan_1(get_full_scan, sensor_hostname_1, data_destination, point_cloud_1, 1); std::thread lidar_scan_2(get_full_scan, sensor_hostname_2, data_destination, point_cloud_2, 2); // std::thread camera_capture(cam_capture_frame, cap, &frame); // visualizer(voxel_cloud, cap, frame); visualizer(point_cloud_1, point_cloud_2, cap, frame); return EXIT_SUCCESS; }
32.835616
166
0.711306
[ "vector" ]
a9e933eb0b3d7485dd007b23aa20faaebd8a7fb3
42,701
cpp
C++
fprime-zmq/zmq/src/zmq.cpp
genemerewether/fprime
fcdd071b5ddffe54ade098ca5d451903daba9eed
[ "Apache-2.0" ]
5
2019-10-22T03:41:02.000Z
2022-01-16T12:48:31.000Z
fprime-zmq/zmq/src/zmq.cpp
JPLOpenSource/fprime-sw-Rel1.0
18364596c24fa369c938ef8758e5aa945ecc6a9b
[ "Apache-2.0" ]
27
2019-02-07T17:58:58.000Z
2019-08-13T00:46:24.000Z
fprime-zmq/zmq/src/zmq.cpp
JPLOpenSource/fprime-sw-Rel1.0
18364596c24fa369c938ef8758e5aa945ecc6a9b
[ "Apache-2.0" ]
3
2019-01-01T18:44:37.000Z
2019-08-01T01:19:39.000Z
/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ // "Tell them I was a writer. // A maker of software. // A humanist. A father. // And many things. // But above all, a writer. // Thank You. :)" // - Pieter Hintjens #include "precompiled.hpp" #define ZMQ_TYPE_UNSAFE #include "macros.hpp" #include "poller.hpp" // On AIX platform, poll.h has to be included first to get consistent // definition of pollfd structure (AIX uses 'reqevents' and 'retnevents' // instead of 'events' and 'revents' and defines macros to map from POSIX-y // names to AIX-specific names). #if defined ZMQ_POLL_BASED_ON_POLL && !defined ZMQ_HAVE_WINDOWS #include <poll.h> #endif // TODO: determine if this is an issue, since zmq.h is being loaded from pch. // zmq.h must be included *after* poll.h for AIX to build properly //#include "../include/zmq.h" #if !defined ZMQ_HAVE_WINDOWS #include <unistd.h> #endif // XSI vector I/O #if defined ZMQ_HAVE_UIO #include <sys/uio.h> #else struct iovec { void *iov_base; size_t iov_len; }; #endif #include <string.h> #include <stdlib.h> #include <new> #include <climits> #include "proxy.hpp" #include "socket_base.hpp" #include "stdint.hpp" #include "config.hpp" #include "likely.hpp" #include "clock.hpp" #include "ctx.hpp" #include "err.hpp" #include "msg.hpp" #include "fd.hpp" #include "metadata.hpp" #include "signaler.hpp" #include "socket_poller.hpp" #include "timers.hpp" #if defined ZMQ_HAVE_OPENPGM #define __PGM_WININT_H__ #include <pgm/pgm.h> #endif // Compile time check whether msg_t fits into zmq_msg_t. typedef char check_msg_t_size [sizeof (zmq::msg_t) == sizeof (zmq_msg_t) ? 1 : -1]; void zmq_version (int *major_, int *minor_, int *patch_) { *major_ = ZMQ_VERSION_MAJOR; *minor_ = ZMQ_VERSION_MINOR; *patch_ = ZMQ_VERSION_PATCH; } const char *zmq_strerror (int errnum_) { return zmq::errno_to_string (errnum_); } int zmq_errno (void) { return errno; } // New context API void *zmq_ctx_new (void) { #if defined ZMQ_HAVE_OPENPGM // Init PGM transport. Ensure threading and timer are enabled. Find PGM // protocol ID. Note that if you want to use gettimeofday and sleep for // openPGM timing, set environment variables PGM_TIMER to "GTOD" and // PGM_SLEEP to "USLEEP". pgm_error_t *pgm_error = NULL; const bool ok = pgm_init (&pgm_error); if (ok != TRUE) { // Invalid parameters don't set pgm_error_t zmq_assert (pgm_error != NULL); if (pgm_error->domain == PGM_ERROR_DOMAIN_TIME && ( pgm_error->code == PGM_ERROR_FAILED)) { // Failed to access RTC or HPET device. pgm_error_free (pgm_error); errno = EINVAL; return NULL; } // PGM_ERROR_DOMAIN_ENGINE: WSAStartup errors or missing WSARecvMsg. zmq_assert (false); } #endif #ifdef ZMQ_HAVE_WINDOWS // Intialise Windows sockets. Note that WSAStartup can be called multiple // times given that WSACleanup will be called for each WSAStartup. // We do this before the ctx constructor since its embedded mailbox_t // object needs Winsock to be up and running. WORD version_requested = MAKEWORD (2, 2); WSADATA wsa_data; int rc = WSAStartup (version_requested, &wsa_data); zmq_assert (rc == 0); zmq_assert (LOBYTE (wsa_data.wVersion) == 2 && HIBYTE (wsa_data.wVersion) == 2); #endif // Create 0MQ context. zmq::ctx_t *ctx = new (std::nothrow) zmq::ctx_t; alloc_assert (ctx); return ctx; } int zmq_ctx_term (void *ctx_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } int rc = ((zmq::ctx_t *) ctx_)->terminate (); int en = errno; // Shut down only if termination was not interrupted by a signal. if (!rc || en != EINTR) { #ifdef ZMQ_HAVE_WINDOWS // On Windows, uninitialise socket layer. rc = WSACleanup (); wsa_assert (rc != SOCKET_ERROR); #endif #if defined ZMQ_HAVE_OPENPGM // Shut down the OpenPGM library. if (pgm_shutdown () != TRUE) zmq_assert (false); #endif } errno = en; return rc; } int zmq_ctx_shutdown (void *ctx_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::ctx_t *) ctx_)->shutdown (); } int zmq_ctx_set (void *ctx_, int option_, int optval_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::ctx_t *) ctx_)->set (option_, optval_); } int zmq_ctx_get (void *ctx_, int option_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::ctx_t *) ctx_)->get (option_); } // Stable/legacy context API void *zmq_init (int io_threads_) { if (io_threads_ >= 0) { void *ctx = zmq_ctx_new (); zmq_ctx_set (ctx, ZMQ_IO_THREADS, io_threads_); return ctx; } errno = EINVAL; return NULL; } int zmq_term (void *ctx_) { return zmq_ctx_term (ctx_); } int zmq_ctx_destroy (void *ctx_) { return zmq_ctx_term (ctx_); } // Sockets void *zmq_socket (void *ctx_, int type_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return NULL; } zmq::ctx_t *ctx = (zmq::ctx_t *) ctx_; zmq::socket_base_t *s = ctx->create_socket (type_); return (void *) s; } int zmq_close (void *s_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } ((zmq::socket_base_t*) s_)->close (); return 0; } int zmq_setsockopt (void *s_, int option_, const void *optval_, size_t optvallen_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s->setsockopt (option_, optval_, optvallen_); return result; } int zmq_getsockopt (void *s_, int option_, void *optval_, size_t *optvallen_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s->getsockopt (option_, optval_, optvallen_); return result; } int zmq_socket_monitor (void *s_, const char *addr_, int events_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s->monitor (addr_, events_); return result; } int zmq_join (void *s_, const char* group_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s->join (group_); return result; } int zmq_leave (void *s_, const char* group_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s->leave (group_); return result; } int zmq_bind (void *s_, const char *addr_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s->bind (addr_); return result; } int zmq_connect (void *s_, const char *addr_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s->connect (addr_); return result; } int zmq_unbind (void *s_, const char *addr_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; return s->term_endpoint (addr_); } int zmq_disconnect (void *s_, const char *addr_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; return s->term_endpoint (addr_); } // Sending functions. static inline int s_sendmsg (zmq::socket_base_t *s_, zmq_msg_t *msg_, int flags_) { size_t sz = zmq_msg_size (msg_); int rc = s_->send ((zmq::msg_t *) msg_, flags_); if (unlikely (rc < 0)) return -1; // This is what I'd like to do, my C++ fu is too weak -- PH 2016/02/09 // int max_msgsz = s_->parent->get (ZMQ_MAX_MSGSZ); size_t max_msgsz = INT_MAX; // Truncate returned size to INT_MAX to avoid overflow to negative values return (int) (sz < max_msgsz? sz: max_msgsz); } /* To be deprecated once zmq_msg_send() is stable */ int zmq_sendmsg (void *s_, zmq_msg_t *msg_, int flags_) { return zmq_msg_send (msg_, s_, flags_); } int zmq_send (void *s_, const void *buf_, size_t len_, int flags_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq_msg_t msg; if (zmq_msg_init_size (&msg, len_)) return -1; // We explicitly allow a send from NULL, size zero if (len_) { assert (buf_); memcpy (zmq_msg_data (&msg), buf_, len_); } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int rc = s_sendmsg (s, &msg, flags_); if (unlikely (rc < 0)) { int err = errno; int rc2 = zmq_msg_close (&msg); errno_assert (rc2 == 0); errno = err; return -1; } // Note the optimisation here. We don't close the msg object as it is // empty anyway. This may change when implementation of zmq_msg_t changes. return rc; } int zmq_send_const (void *s_, const void *buf_, size_t len_, int flags_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq_msg_t msg; int rc = zmq_msg_init_data (&msg, (void *)buf_, len_, NULL, NULL); if (rc != 0) return -1; zmq::socket_base_t *s = (zmq::socket_base_t *) s_; rc = s_sendmsg (s, &msg, flags_); if (unlikely (rc < 0)) { int err = errno; int rc2 = zmq_msg_close (&msg); errno_assert (rc2 == 0); errno = err; return -1; } // Note the optimisation here. We don't close the msg object as it is // empty anyway. This may change when implementation of zmq_msg_t changes. return rc; } // Send multiple messages. // TODO: this function has no man page // // If flag bit ZMQ_SNDMORE is set the vector is treated as // a single multi-part message, i.e. the last message has // ZMQ_SNDMORE bit switched off. // int zmq_sendiov (void *s_, iovec *a_, size_t count_, int flags_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } if (unlikely (count_ <= 0 || !a_)) { errno = EINVAL; return -1; } int rc = 0; zmq_msg_t msg; zmq::socket_base_t *s = (zmq::socket_base_t *) s_; for (size_t i = 0; i < count_; ++i) { rc = zmq_msg_init_size (&msg, a_[i].iov_len); if (rc != 0) { rc = -1; break; } memcpy (zmq_msg_data (&msg), a_[i].iov_base, a_[i].iov_len); if (i == count_ - 1) flags_ = flags_ & ~ZMQ_SNDMORE; rc = s_sendmsg (s, &msg, flags_); if (unlikely (rc < 0)) { int err = errno; int rc2 = zmq_msg_close (&msg); errno_assert (rc2 == 0); errno = err; rc = -1; break; } } return rc; } // Receiving functions. static int s_recvmsg (zmq::socket_base_t *s_, zmq_msg_t *msg_, int flags_) { int rc = s_->recv ((zmq::msg_t *) msg_, flags_); if (unlikely (rc < 0)) return -1; // Truncate returned size to INT_MAX to avoid overflow to negative values size_t sz = zmq_msg_size (msg_); return (int) (sz < INT_MAX? sz: INT_MAX); } /* To be deprecated once zmq_msg_recv() is stable */ int zmq_recvmsg (void *s_, zmq_msg_t *msg_, int flags_) { return zmq_msg_recv (msg_, s_, flags_); } int zmq_recv (void *s_, void *buf_, size_t len_, int flags_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq_msg_t msg; int rc = zmq_msg_init (&msg); errno_assert (rc == 0); zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int nbytes = s_recvmsg (s, &msg, flags_); if (unlikely (nbytes < 0)) { int err = errno; rc = zmq_msg_close (&msg); errno_assert (rc == 0); errno = err; return -1; } // An oversized message is silently truncated. size_t to_copy = size_t (nbytes) < len_ ? size_t (nbytes) : len_; // We explicitly allow a null buffer argument if len is zero if (to_copy) { assert (buf_); memcpy (buf_, zmq_msg_data (&msg), to_copy); } rc = zmq_msg_close (&msg); errno_assert (rc == 0); return nbytes; } // Receive a multi-part message // // Receives up to *count_ parts of a multi-part message. // Sets *count_ to the actual number of parts read. // ZMQ_RCVMORE is set to indicate if a complete multi-part message was read. // Returns number of message parts read, or -1 on error. // // Note: even if -1 is returned, some parts of the message // may have been read. Therefore the client must consult // *count_ to retrieve message parts successfully read, // even if -1 is returned. // // The iov_base* buffers of each iovec *a_ filled in by this // function may be freed using free(). // TODO: this function has no man page // int zmq_recviov (void *s_, iovec *a_, size_t *count_, int flags_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } if (unlikely (!count_ || *count_ <= 0 || !a_)) { errno = EINVAL; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; size_t count = *count_; int nread = 0; bool recvmore = true; *count_ = 0; for (size_t i = 0; recvmore && i < count; ++i) { zmq_msg_t msg; int rc = zmq_msg_init (&msg); errno_assert (rc == 0); int nbytes = s_recvmsg (s, &msg, flags_); if (unlikely (nbytes < 0)) { int err = errno; rc = zmq_msg_close (&msg); errno_assert (rc == 0); errno = err; nread = -1; break; } a_[i].iov_len = zmq_msg_size (&msg); a_[i].iov_base = static_cast<char *> (malloc(a_[i].iov_len)); if (unlikely (!a_[i].iov_base)) { errno = ENOMEM; return -1; } memcpy(a_[i].iov_base,static_cast<char *> (zmq_msg_data (&msg)), a_[i].iov_len); // Assume zmq_socket ZMQ_RVCMORE is properly set. zmq::msg_t* p_msg = reinterpret_cast<zmq::msg_t*>(&msg); recvmore = p_msg->flags() & zmq::msg_t::more; rc = zmq_msg_close(&msg); errno_assert (rc == 0); ++*count_; ++nread; } return nread; } // Message manipulators. int zmq_msg_init (zmq_msg_t *msg_) { return ((zmq::msg_t*) msg_)->init (); } int zmq_msg_init_size (zmq_msg_t *msg_, size_t size_) { return ((zmq::msg_t*) msg_)->init_size (size_); } int zmq_msg_init_data (zmq_msg_t *msg_, void *data_, size_t size_, zmq_free_fn *ffn_, void *hint_) { return ((zmq::msg_t*) msg_)->init_data (data_, size_, ffn_, hint_); } int zmq_msg_send (zmq_msg_t *msg_, void *s_, int flags_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s_sendmsg (s, msg_, flags_); return result; } int zmq_msg_recv (zmq_msg_t *msg_, void *s_, int flags_) { if (!s_ || !((zmq::socket_base_t*) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *s = (zmq::socket_base_t *) s_; int result = s_recvmsg (s, msg_, flags_); return result; } int zmq_msg_close (zmq_msg_t *msg_) { return ((zmq::msg_t*) msg_)->close (); } int zmq_msg_move (zmq_msg_t *dest_, zmq_msg_t *src_) { return ((zmq::msg_t*) dest_)->move (*(zmq::msg_t*) src_); } int zmq_msg_copy (zmq_msg_t *dest_, zmq_msg_t *src_) { return ((zmq::msg_t*) dest_)->copy (*(zmq::msg_t*) src_); } void *zmq_msg_data (zmq_msg_t *msg_) { return ((zmq::msg_t*) msg_)->data (); } size_t zmq_msg_size (zmq_msg_t *msg_) { return ((zmq::msg_t*) msg_)->size (); } int zmq_msg_more (zmq_msg_t *msg_) { return zmq_msg_get (msg_, ZMQ_MORE); } int zmq_msg_get (zmq_msg_t *msg_, int property_) { const char* fd_string; switch (property_) { case ZMQ_MORE: return (((zmq::msg_t*) msg_)->flags () & zmq::msg_t::more)? 1: 0; case ZMQ_SRCFD: fd_string = zmq_msg_gets(msg_, "__fd"); if (fd_string == NULL) return (int)-1; return atoi(fd_string); case ZMQ_SHARED: return (((zmq::msg_t*) msg_)->is_cmsg ()) || (((zmq::msg_t*) msg_)->flags () & zmq::msg_t::shared)? 1: 0; default: errno = EINVAL; return -1; } } int zmq_msg_set (zmq_msg_t *, int, int) { // No properties supported at present errno = EINVAL; return -1; } int zmq_msg_set_routing_id (zmq_msg_t *msg_, uint32_t routing_id_) { return ((zmq::msg_t *) msg_)->set_routing_id (routing_id_); } uint32_t zmq_msg_routing_id (zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->get_routing_id (); } int zmq_msg_set_group (zmq_msg_t *msg_, const char *group_) { return ((zmq::msg_t *) msg_)->set_group (group_); } const char *zmq_msg_group (zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->group (); } // Get message metadata string const char *zmq_msg_gets (zmq_msg_t *msg_, const char *property_) { zmq::metadata_t *metadata = ((zmq::msg_t *) msg_)->metadata (); const char *value = NULL; if (metadata) value = metadata->get (std::string (property_)); if (value) return value; else { errno = EINVAL; return NULL; } } // Polling. #if defined ZMQ_HAVE_POLLER inline int zmq_poller_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) { // implement zmq_poll on top of zmq_poller int rc; zmq_poller_event_t *events; events = new zmq_poller_event_t[nitems_]; alloc_assert(events); void *poller = zmq_poller_new (); alloc_assert(poller); bool repeat_items = false; // Register sockets with poller for (int i = 0; i < nitems_; i++) { items_[i].revents = 0; bool modify = false; short e = items_[i].events; if (items_[i].socket) { // Poll item is a 0MQ socket. for (int j = 0; j < i; ++j) { // Check for repeat entries if (items_[j].socket == items_[i].socket) { repeat_items = true; modify = true; e |= items_[j].events; } } if (modify) { rc = zmq_poller_modify (poller, items_[i].socket, e); } else { rc = zmq_poller_add (poller, items_[i].socket, NULL, e); } if (rc < 0) { zmq_poller_destroy (&poller); delete [] events; return rc; } } else { // Poll item is a raw file descriptor. for (int j = 0; j < i; ++j) { // Check for repeat entries if (!items_[j].socket && items_[j].fd == items_[i].fd) { repeat_items = true; modify = true; e |= items_[j].events; } } if (modify) { rc = zmq_poller_modify_fd (poller, items_[i].fd, e); } else { rc = zmq_poller_add_fd (poller, items_[i].fd, NULL, e); } if (rc < 0) { zmq_poller_destroy (&poller); delete [] events; return rc; } } } // Wait for events rc = zmq_poller_wait_all (poller, events, nitems_, timeout_); if (rc < 0) { zmq_poller_destroy (&poller); delete [] events; if (zmq_errno() == ETIMEDOUT) { return 0; } return rc; } // Transform poller events into zmq_pollitem events. // items_ contains all items, while events only contains fired events. // If no sockets are repeated (likely), the two are still co-ordered, so step through the items // checking for matches only on the first event. // If there are repeat items, they cannot be assumed to be co-ordered, // so each pollitem must check fired events from the beginning. int j_start = 0, found_events = rc; for (int i = 0; i < nitems_; i++) { for (int j = j_start; j < found_events; ++j) { if ( (items_[i].socket && items_[i].socket == events[j].socket) || (!(items_[i].socket || events[j].socket) && items_[i].fd == events[j].fd) ) { items_[i].revents = events[j].events & items_[i].events; if (!repeat_items) { // no repeats, we can ignore events we've already seen j_start++; } break; } if (!repeat_items) { // no repeats, never have to look at j > j_start break; } } } // Cleanup zmq_poller_destroy (&poller); delete [] events; return rc; } #endif // ZMQ_HAVE_POLLER int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) { // TODO: the function implementation can just call zmq_pollfd_poll with // pollfd as NULL, however pollfd is not yet stable. #if defined ZMQ_HAVE_POLLER // if poller is present, use that. return zmq_poller_poll(items_, nitems_, timeout_); #else #if defined ZMQ_POLL_BASED_ON_POLL if (unlikely (nitems_ < 0)) { errno = EINVAL; return -1; } if (unlikely (nitems_ == 0)) { if (timeout_ == 0) return 0; #if defined ZMQ_HAVE_WINDOWS Sleep (timeout_ > 0 ? timeout_ : INFINITE); return 0; #elif defined ZMQ_HAVE_ANDROID usleep (timeout_ * 1000); return 0; #else return usleep (timeout_ * 1000); #endif } if (!items_) { errno = EFAULT; return -1; } zmq::clock_t clock; uint64_t now = 0; uint64_t end = 0; pollfd spollfds[ZMQ_POLLITEMS_DFLT]; pollfd *pollfds = spollfds; if (nitems_ > ZMQ_POLLITEMS_DFLT) { pollfds = (pollfd*) malloc (nitems_ * sizeof (pollfd)); alloc_assert (pollfds); } // Build pollset for poll () system call. for (int i = 0; i != nitems_; i++) { // If the poll item is a 0MQ socket, we poll on the file descriptor // retrieved by the ZMQ_FD socket option. if (items_ [i].socket) { size_t zmq_fd_size = sizeof (zmq::fd_t); if (zmq_getsockopt (items_ [i].socket, ZMQ_FD, &pollfds [i].fd, &zmq_fd_size) == -1) { if (pollfds != spollfds) free (pollfds); return -1; } pollfds [i].events = items_ [i].events ? POLLIN : 0; } // Else, the poll item is a raw file descriptor. Just convert the // events to normal POLLIN/POLLOUT for poll (). else { pollfds [i].fd = items_ [i].fd; pollfds [i].events = (items_ [i].events & ZMQ_POLLIN ? POLLIN : 0) | (items_ [i].events & ZMQ_POLLOUT ? POLLOUT : 0) | (items_ [i].events & ZMQ_POLLPRI ? POLLPRI : 0); } } bool first_pass = true; int nevents = 0; while (true) { // Compute the timeout for the subsequent poll. int timeout; if (first_pass) timeout = 0; else if (timeout_ < 0) timeout = -1; else timeout = end - now; // Wait for events. { int rc = poll (pollfds, nitems_, timeout); if (rc == -1 && errno == EINTR) { if (pollfds != spollfds) free (pollfds); return -1; } errno_assert (rc >= 0); } // Check for the events. for (int i = 0; i != nitems_; i++) { items_ [i].revents = 0; // The poll item is a 0MQ socket. Retrieve pending events // using the ZMQ_EVENTS socket option. if (items_ [i].socket) { size_t zmq_events_size = sizeof (uint32_t); uint32_t zmq_events; if (zmq_getsockopt (items_ [i].socket, ZMQ_EVENTS, &zmq_events, &zmq_events_size) == -1) { if (pollfds != spollfds) free (pollfds); return -1; } if ((items_ [i].events & ZMQ_POLLOUT) && (zmq_events & ZMQ_POLLOUT)) items_ [i].revents |= ZMQ_POLLOUT; if ((items_ [i].events & ZMQ_POLLIN) && (zmq_events & ZMQ_POLLIN)) items_ [i].revents |= ZMQ_POLLIN; } // Else, the poll item is a raw file descriptor, simply convert // the events to zmq_pollitem_t-style format. else { if (pollfds [i].revents & POLLIN) items_ [i].revents |= ZMQ_POLLIN; if (pollfds [i].revents & POLLOUT) items_ [i].revents |= ZMQ_POLLOUT; if (pollfds [i].revents & POLLPRI) items_ [i].revents |= ZMQ_POLLPRI; if (pollfds [i].revents & ~(POLLIN | POLLOUT | POLLPRI)) items_ [i].revents |= ZMQ_POLLERR; } if (items_ [i].revents) nevents++; } // If timeout is zero, exit immediately whether there are events or not. if (timeout_ == 0) break; // If there are events to return, we can exit immediately. if (nevents) break; // At this point we are meant to wait for events but there are none. // If timeout is infinite we can just loop until we get some events. if (timeout_ < 0) { if (first_pass) first_pass = false; continue; } // The timeout is finite and there are no events. In the first pass // we get a timestamp of when the polling have begun. (We assume that // first pass have taken negligible time). We also compute the time // when the polling should time out. if (first_pass) { now = clock.now_ms (); end = now + timeout_; if (now == end) break; first_pass = false; continue; } // Find out whether timeout have expired. now = clock.now_ms (); if (now >= end) break; } if (pollfds != spollfds) free (pollfds); return nevents; #elif defined ZMQ_POLL_BASED_ON_SELECT if (unlikely (nitems_ < 0)) { errno = EINVAL; return -1; } if (unlikely (nitems_ == 0)) { if (timeout_ == 0) return 0; #if defined ZMQ_HAVE_WINDOWS Sleep (timeout_ > 0 ? timeout_ : INFINITE); return 0; #else return usleep (timeout_ * 1000); #endif } zmq::clock_t clock; uint64_t now = 0; uint64_t end = 0; // Ensure we do not attempt to select () on more than FD_SETSIZE // file descriptors. zmq_assert (nitems_ <= FD_SETSIZE); fd_set pollset_in = { 0 }; fd_set pollset_out = { 0 }; fd_set pollset_err = { 0 }; zmq::fd_t maxfd = 0; // Build the fd_sets for passing to select (). for (int i = 0; i != nitems_; i++) { // If the poll item is a 0MQ socket we are interested in input on the // notification file descriptor retrieved by the ZMQ_FD socket option. if (items_ [i].socket) { size_t zmq_fd_size = sizeof (zmq::fd_t); zmq::fd_t notify_fd; if (zmq_getsockopt (items_ [i].socket, ZMQ_FD, &notify_fd, &zmq_fd_size) == -1) return -1; if (items_ [i].events) { FD_SET (notify_fd, &pollset_in); if (maxfd < notify_fd) maxfd = notify_fd; } } // Else, the poll item is a raw file descriptor. Convert the poll item // events to the appropriate fd_sets. else { if (items_ [i].events & ZMQ_POLLIN) FD_SET (items_ [i].fd, &pollset_in); if (items_ [i].events & ZMQ_POLLOUT) FD_SET (items_ [i].fd, &pollset_out); if (items_ [i].events & ZMQ_POLLERR) FD_SET (items_ [i].fd, &pollset_err); if (maxfd < items_ [i].fd) maxfd = items_ [i].fd; } } bool first_pass = true; int nevents = 0; fd_set inset, outset, errset; while (true) { // Compute the timeout for the subsequent poll. timeval timeout; timeval *ptimeout; if (first_pass) { timeout.tv_sec = 0; timeout.tv_usec = 0; ptimeout = &timeout; } else if (timeout_ < 0) ptimeout = NULL; else { timeout.tv_sec = (long) ((end - now) / 1000); timeout.tv_usec = (long) ((end - now) % 1000 * 1000); ptimeout = &timeout; } // Wait for events. Ignore interrupts if there's infinite timeout. while (true) { memcpy (&inset, &pollset_in, sizeof (fd_set)); memcpy (&outset, &pollset_out, sizeof (fd_set)); memcpy (&errset, &pollset_err, sizeof (fd_set)); #if defined ZMQ_HAVE_WINDOWS int rc = select (0, &inset, &outset, &errset, ptimeout); if (unlikely (rc == SOCKET_ERROR)) { errno = zmq::wsa_error_to_errno (WSAGetLastError ()); wsa_assert (errno == ENOTSOCK); return -1; } #else int rc = select (maxfd + 1, &inset, &outset, &errset, ptimeout); if (unlikely (rc == -1)) { errno_assert (errno == EINTR || errno == EBADF); return -1; } #endif break; } // Check for the events. for (int i = 0; i != nitems_; i++) { items_ [i].revents = 0; // The poll item is a 0MQ socket. Retrieve pending events // using the ZMQ_EVENTS socket option. if (items_ [i].socket) { size_t zmq_events_size = sizeof (uint32_t); uint32_t zmq_events; if (zmq_getsockopt (items_ [i].socket, ZMQ_EVENTS, &zmq_events, &zmq_events_size) == -1) return -1; if ((items_ [i].events & ZMQ_POLLOUT) && (zmq_events & ZMQ_POLLOUT)) items_ [i].revents |= ZMQ_POLLOUT; if ((items_ [i].events & ZMQ_POLLIN) && (zmq_events & ZMQ_POLLIN)) items_ [i].revents |= ZMQ_POLLIN; } // Else, the poll item is a raw file descriptor, simply convert // the events to zmq_pollitem_t-style format. else { if (FD_ISSET (items_ [i].fd, &inset)) items_ [i].revents |= ZMQ_POLLIN; if (FD_ISSET (items_ [i].fd, &outset)) items_ [i].revents |= ZMQ_POLLOUT; if (FD_ISSET (items_ [i].fd, &errset)) items_ [i].revents |= ZMQ_POLLERR; } if (items_ [i].revents) nevents++; } // If timeout is zero, exit immediately whether there are events or not. if (timeout_ == 0) break; // If there are events to return, we can exit immediately. if (nevents) break; // At this point we are meant to wait for events but there are none. // If timeout is infinite we can just loop until we get some events. if (timeout_ < 0) { if (first_pass) first_pass = false; continue; } // The timeout is finite and there are no events. In the first pass // we get a timestamp of when the polling have begun. (We assume that // first pass have taken negligible time). We also compute the time // when the polling should time out. if (first_pass) { now = clock.now_ms (); end = now + timeout_; if (now == end) break; first_pass = false; continue; } // Find out whether timeout have expired. now = clock.now_ms (); if (now >= end) break; } return nevents; #else // Exotic platforms that support neither poll() nor select(). errno = ENOTSUP; return -1; #endif #endif // ZMQ_HAVE_POLLER } // The poller functionality void *zmq_poller_new (void) { zmq::socket_poller_t *poller = new (std::nothrow) zmq::socket_poller_t; alloc_assert (poller); return poller; } int zmq_poller_destroy (void **poller_p_) { void *poller; if (!poller_p_ || !(poller = *poller_p_) || !((zmq::socket_poller_t*) poller)->check_tag ()) { errno = EFAULT; return -1; } delete ((zmq::socket_poller_t*) poller); *poller_p_ = NULL; return 0; } int zmq_poller_add (void *poller_, void *s_, void *user_data_, short events_) { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!s_ || !((zmq::socket_base_t*)s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *socket = (zmq::socket_base_t*)s_; return ((zmq::socket_poller_t*)poller_)->add (socket, user_data_, events_); } #if defined _WIN32 int zmq_poller_add_fd (void *poller_, SOCKET fd_, void *user_data_, short events_) #else int zmq_poller_add_fd (void *poller_, int fd_, void *user_data_, short events_) #endif { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::socket_poller_t*)poller_)->add_fd (fd_, user_data_, events_); } int zmq_poller_modify (void *poller_, void *s_, short events_) { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!s_ || !((zmq::socket_base_t*)s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *socket = (zmq::socket_base_t*)s_; return ((zmq::socket_poller_t*)poller_)->modify (socket, events_); } #if defined _WIN32 int zmq_poller_modify_fd (void *poller_, SOCKET fd_, short events_) #else int zmq_poller_modify_fd (void *poller_, int fd_, short events_) #endif { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::socket_poller_t*)poller_)->modify_fd (fd_, events_); } int zmq_poller_remove (void *poller_, void *s_) { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!s_ || !((zmq::socket_base_t*)s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *socket = (zmq::socket_base_t*)s_; return ((zmq::socket_poller_t*)poller_)->remove (socket); } #if defined _WIN32 int zmq_poller_remove_fd (void *poller_, SOCKET fd_) #else int zmq_poller_remove_fd (void *poller_, int fd_) #endif { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::socket_poller_t*)poller_)->remove_fd (fd_); } int zmq_poller_wait (void *poller_, zmq_poller_event_t *event, long timeout_) { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } zmq_assert (event != NULL); int rc = zmq_poller_wait_all(poller_, event, 1, timeout_); if (rc < 0) { memset (event, 0, sizeof(zmq_poller_event_t)); } // wait_all returns number of events, but we return 0 for any success return rc >= 0 ? 0 : rc; } int zmq_poller_wait_all (void *poller_, zmq_poller_event_t *events, int n_events, long timeout_) { if (!poller_ || !((zmq::socket_poller_t*)poller_)->check_tag ()) { errno = EFAULT; return -1; } if (n_events < 0) { errno = EINVAL; return -1; } zmq_assert (events != NULL); int rc = ((zmq::socket_poller_t*)poller_)->wait ((zmq::socket_poller_t::event_t *)events, n_events, timeout_); return rc; } // Timers void *zmq_timers_new (void) { zmq::timers_t *timers = new (std::nothrow) zmq::timers_t; alloc_assert (timers); return timers; } int zmq_timers_destroy (void **timers_p_) { void *timers = *timers_p_; if (!timers || !((zmq::timers_t *) timers)->check_tag ()) { errno = EFAULT; return -1; } delete ((zmq::timers_t *) timers); *timers_p_ = NULL; return 0; } int zmq_timers_add (void *timers_, size_t interval_, zmq_timer_fn handler_, void *arg_) { if (!timers_ || !((zmq::timers_t*)timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t*)timers_)->add (interval_, handler_, arg_); } int zmq_timers_cancel (void *timers_, int timer_id_) { if (!timers_ || !((zmq::timers_t*)timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t*)timers_)->cancel (timer_id_); } int zmq_timers_set_interval (void *timers_, int timer_id_, size_t interval_) { if (!timers_ || !((zmq::timers_t*)timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t*)timers_)->set_interval (timer_id_, interval_); } int zmq_timers_reset (void *timers_, int timer_id_) { if (!timers_ || !((zmq::timers_t*)timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t*)timers_)->reset (timer_id_); } long zmq_timers_timeout (void *timers_) { if (!timers_ || !((zmq::timers_t*)timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t*)timers_)->timeout (); } int zmq_timers_execute (void *timers_) { if (!timers_ || !((zmq::timers_t*)timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t*)timers_)->execute (); } // The proxy functionality int zmq_proxy (void *frontend_, void *backend_, void *capture_) { if (!frontend_ || !backend_) { errno = EFAULT; return -1; } return zmq::proxy ( (zmq::socket_base_t*) frontend_, (zmq::socket_base_t*) backend_, (zmq::socket_base_t*) capture_); } int zmq_proxy_steerable (void *frontend_, void *backend_, void *capture_, void *control_) { if (!frontend_ || !backend_) { errno = EFAULT; return -1; } return zmq::proxy ( (zmq::socket_base_t*) frontend_, (zmq::socket_base_t*) backend_, (zmq::socket_base_t*) capture_, (zmq::socket_base_t*) control_); } // The deprecated device functionality int zmq_device (int /* type */, void *frontend_, void *backend_) { return zmq::proxy ( (zmq::socket_base_t*) frontend_, (zmq::socket_base_t*) backend_, NULL); } // Probe library capabilities; for now, reports on transport and security int zmq_has (const char *capability) { #if !defined (ZMQ_HAVE_WINDOWS) && !defined (ZMQ_HAVE_OPENVMS) if (strcmp (capability, "ipc") == 0) return true; #endif #if defined (ZMQ_HAVE_OPENPGM) if (strcmp (capability, "pgm") == 0) return true; #endif #if defined (ZMQ_HAVE_TIPC) if (strcmp (capability, "tipc") == 0) return true; #endif #if defined (ZMQ_HAVE_NORM) if (strcmp (capability, "norm") == 0) return true; #endif #if defined (ZMQ_HAVE_CURVE) if (strcmp (capability, "curve") == 0) return true; #endif #if defined (HAVE_LIBGSSAPI_KRB5) if (strcmp (capability, "gssapi") == 0) return true; #endif #if defined (ZMQ_HAVE_VMCI) if (strcmp (capability, "vmci") == 0) return true; #endif // Whatever the application asked for, we don't have return false; }
28.037426
114
0.569003
[ "object", "vector", "transform" ]
a9ee2c84ba7193cb24d7c996f7bf784505c5ca32
4,713
cc
C++
src/sim/ticked_object.cc
hyu-iot/gem5
aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5
[ "BSD-3-Clause" ]
765
2015-01-14T16:17:04.000Z
2022-03-28T07:46:28.000Z
src/sim/ticked_object.cc
hyu-iot/gem5
aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5
[ "BSD-3-Clause" ]
148
2018-07-20T00:58:36.000Z
2021-11-16T01:52:33.000Z
src/sim/ticked_object.cc
hyu-iot/gem5
aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5
[ "BSD-3-Clause" ]
807
2015-01-06T09:55:38.000Z
2022-03-30T10:23:36.000Z
/* * Copyright (c) 2013-2014, 2017 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall * not be construed as granting a license to any other intellectual * property including but not limited to intellectual property relating * to a hardware implementation of the functionality of the software * licensed hereunder. You may use the software subject to the license * terms below provided that you ensure that this notice is replicated * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * * 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 holders 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 "sim/ticked_object.hh" #include "params/TickedObject.hh" #include "sim/clocked_object.hh" #include "sim/serialize.hh" namespace gem5 { Ticked::Ticked(ClockedObject &object_, statistics::Scalar *imported_num_cycles, Event::Priority priority) : object(object_), event([this]{ processClockEvent(); }, object_.name(), false, priority), running(false), lastStopped(0), /* Allocate numCycles if an external stat wasn't passed in */ numCyclesLocal((imported_num_cycles ? NULL : new statistics::Scalar)), numCycles((imported_num_cycles ? *imported_num_cycles : *numCyclesLocal)) { } void Ticked::processClockEvent() { ++tickCycles; ++numCycles; countCycles(Cycles(1)); evaluate(); if (running) object.schedule(event, object.clockEdge(Cycles(1))); } void Ticked::regStats() { if (numCyclesLocal) { numCycles .name(object.name() + ".totalTickCycles") .desc("Number of cycles that the object ticked or was stopped"); } tickCycles .name(object.name() + ".tickCycles") .desc("Number of cycles that the object actually ticked"); idleCycles .name(object.name() + ".idleCycles") .desc("Total number of cycles that the object has spent stopped"); idleCycles = numCycles - tickCycles; } void Ticked::serialize(CheckpointOut &cp) const { uint64_t lastStoppedUint = lastStopped; paramOut(cp, "lastStopped", lastStoppedUint); } void Ticked::unserialize(CheckpointIn &cp) { uint64_t lastStoppedUint = 0; /* lastStopped is optional on checkpoint restore as this object may be * being restored from one which has a common base (and so possibly * many common checkpointed values) but where Ticked is used in the * checkpointed object but not this one. * An example would be a CPU model using Ticked restores from a * simple CPU without without Ticked */ optParamIn(cp, "lastStopped", lastStoppedUint); lastStopped = Cycles(lastStoppedUint); } TickedObject::TickedObject(const TickedObjectParams &params, Event::Priority priority) : ClockedObject(params), /* Make numCycles in Ticked */ Ticked(*this, NULL, priority) { } void TickedObject::regStats() { Ticked::regStats(); ClockedObject::regStats(); } void TickedObject::serialize(CheckpointOut &cp) const { Ticked::serialize(cp); ClockedObject::serialize(cp); } void TickedObject::unserialize(CheckpointIn &cp) { Ticked::unserialize(cp); ClockedObject::unserialize(cp); } } // namespace gem5
33.425532
76
0.728835
[ "object", "model" ]
a9ee460e3eeef5fc2c90e178f6987f62220287ed
632
cpp
C++
acmicpcnet/9084.cpp
irresi/algostudy
489739d641d6e36bbedf86be6391d1db27456585
[ "MIT" ]
null
null
null
acmicpcnet/9084.cpp
irresi/algostudy
489739d641d6e36bbedf86be6391d1db27456585
[ "MIT" ]
null
null
null
acmicpcnet/9084.cpp
irresi/algostudy
489739d641d6e36bbedf86be6391d1db27456585
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(),(x).end() #define sync() {ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);} //do not use int n,m; vector<int> v; int main() { sync(); int tc,num,i; cin>>tc; while(tc--) { v.clear(); cin>>n; for(i=1; i<=n; i++) { cin>>num; v.push_back(num); } cin>>m; vector<int> d(10001+m,0); d[0]=1; for(int topl : v) { for(i=0; i<=m; i++)if(d[i]){ d[i+topl]+=d[i]; } } cout<<d[m]<<'\n'; } return 0; }
20.387097
83
0.416139
[ "vector" ]
a9f23d9b358560a144003ffb65c839924e2055d9
1,497
cpp
C++
Source/Ducky/ducky/graphics/layer/skyboxLayer.cpp
zdavid112z/SandyCity
7c2356a75f2d7a98611def2316dd299ac9644209
[ "MIT" ]
null
null
null
Source/Ducky/ducky/graphics/layer/skyboxLayer.cpp
zdavid112z/SandyCity
7c2356a75f2d7a98611def2316dd299ac9644209
[ "MIT" ]
null
null
null
Source/Ducky/ducky/graphics/layer/skyboxLayer.cpp
zdavid112z/SandyCity
7c2356a75f2d7a98611def2316dd299ac9644209
[ "MIT" ]
null
null
null
#include "ducky_pch.h" #include "skyboxLayer.h" namespace ducky { namespace graphics { SkyboxLayer::SkyboxLayer() : Layer(GetLayerName(), 10) { m_Shader = new Shader("assets/shaders/skybox.vert", "assets/shaders/skybox.frag"); io::ModelData md; md.numVertices = 4; md.vertices = new io::Vertex[4]; md.vertices[0].position = glm::vec3(-1, -1, 1); md.vertices[1].position = glm::vec3( 1, -1, 1); md.vertices[2].position = glm::vec3( 1, 1, 1); md.vertices[3].position = glm::vec3(-1, 1, 1); md.numIndices = 4; md.indices = new uint32[4]; md.indices[0] = 3; md.indices[1] = 0; md.indices[2] = 2; md.indices[3] = 1; m_Cube = new Mesh(md); BufferDesc bd; bd.data = nullptr; bd.dynamic = true; bd.size = sizeof(SkyboxUniformBuffer); bd.type = BUFFER_UNIFORM; m_UniformBuffer = new Buffer(bd); } SkyboxLayer::~SkyboxLayer() { delete m_Cube; delete m_Shader; delete m_UniformBuffer; } void SkyboxLayer::Render(LightSetup* ls) { if (m_Camera == nullptr || m_SkyboxTexture == nullptr) return; glDisable(GL_DEPTH_TEST); m_Shader->Bind(); m_BufferData.invViewMatrix = glm::inverse(m_Camera->GetViewMatrix()); m_BufferData.invProjectionMatrix = glm::inverse(m_Camera->GetProjectionMatrix()); m_UniformBuffer->SetData(&m_BufferData, 0, sizeof(SkyboxUniformBuffer)); m_Shader->SetUniformBuffer("SkyboxUniformBuffer", m_UniformBuffer); m_SkyboxTexture->Bind(); m_Cube->RenderStrips(); glEnable(GL_DEPTH_TEST); } } }
26.732143
84
0.683367
[ "mesh", "render" ]
a9f4b807df818f255c75b625c9cad6f69c872315
8,830
cpp
C++
threshsign/src/bls/relic/BlsNumTypes.cpp
MaggieQi/concord-bft
8db0cfbec988e691ce592901124bee6617d64be4
[ "Apache-2.0" ]
null
null
null
threshsign/src/bls/relic/BlsNumTypes.cpp
MaggieQi/concord-bft
8db0cfbec988e691ce592901124bee6617d64be4
[ "Apache-2.0" ]
null
null
null
threshsign/src/bls/relic/BlsNumTypes.cpp
MaggieQi/concord-bft
8db0cfbec988e691ce592901124bee6617d64be4
[ "Apache-2.0" ]
1
2021-05-18T02:12:33.000Z
2021-05-18T02:12:33.000Z
// Concord // // Copyright (c) 2018 VMware, Inc. All Rights Reserved. // // This product is licensed to you under the Apache 2.0 license (the "License"). // You may not use this product except in compliance with the Apache 2.0 License. // // This product may include a number of subcomponents with separate copyright // notices and license terms. Your use of these subcomponents is subject to the // terms and conditions of the subcomponent's license, as noted in the // LICENSE file. #include "threshsign/Configuration.h" #include "threshsign/bls/relic/BlsNumTypes.h" #include "Timer.h" #include "Utils.h" #include "AutoBuf.h" #include "XAssert.h" #include "Logger.hpp" using std::endl; namespace BLS { namespace Relic { template<class T> static std::string toStringHelper(const T& num) { int size = num.getByteCount(); AutoByteBuf buf(size); num.toBytes(buf, size); return Utils::bin2hex(buf, size); } template<class T> static void fromStringHelper(T& num, const std::string& str) { if(str.size() % 2) { throw std::runtime_error("Cannot deserialize G1 elliptic curve point from odd-sized hexadecimal string"); } AutoByteBuf buf(static_cast<int>(str.size()/2)); int bufSize = static_cast<int>(str.size()/2); Utils::hex2bin(str, buf, bufSize); num.fromBytes(buf, bufSize); } /** * BNT */ BNT::BNT(int d) : BNT() { assertGreaterThanOrEqual(d, 0); assertGreaterThanOrEqual(sizeof(dig_t), sizeof(d)); bn_set_dig(n, static_cast<dig_t>(d)); } void BNT::toBytes(unsigned char * buf, int capacity) const { int size = getByteCount(); if(capacity < size) { LOG_ERROR(GL, "Expected buffer of size " << size << " bytes for serializing BNT object. You provided " << capacity << " bytes"); throw std::logic_error("Buffer not large enough for serializing BNT"); } memset(buf, 0, static_cast<size_t>(capacity)); bn_write_bin(buf, capacity, n); } std::string BNT::toString(int base) const { int size = bn_size_str(n, base); AutoCharBuf buf(size); //bn_write_str(reinterpret_cast<unsigned char*>(buf.getBuf()), size, n, base); bn_write_str(buf.getBuf(), size, n, base); std::string str(buf); return str; } void BNT::fromString(const std::string& str, int base) { bn_read_str(n, str.c_str(), static_cast<int>(str.size()), base); } BNT& BNT::FastModuloMonty(const BNT& m, const BNT& u) { //loginfo << "Using BN_MOD = MONTY" << std::endl; // RELIC API quirk: Need to convert 'n' to Montgomery form BNT montyN; bn_mod_monty_conv(montyN, n, m); bn_mod(n, montyN, m, u); return *this; } BNT& BNT::FastModuloBarrett(const BNT& m, const BNT& u) { bn_mod_barrt(n, n, m, u); return *this; } BNT& BNT::FastModuloPmers(const BNT& m, const BNT& u) { bn_mod_pmers(n, n, m, u); return *this; } BNT& BNT::FastModulo(const BNT& m, const BNT& u) { /** * NOTE: BNT::SlowModulo always uses RELIC's bn_mod_basic, no matter what RELIC compilation flags are used. * * Montgomery modular reduction functions: FastModulo much slower than SlowModulo * bn_mod_monty * bn_mod_monty_back * bn_mod_monty_basic * bn_mod_monty_comba * bn_mod_monty_conv * bn_mod_pre_monty * * Barrett modular reduction function: slower than Montgomery, but SlowModulo almost as fast as FastModulo * bn_mod_barrt * bn_mod_pre_barrt * * * PMERS modular reduction: much much slower than Barrett (20x), FastModulo is insanely slower than SlowModulo * bn_mod_pmers * bn_mod_pre_pmers */ #if BN_MOD == MONTY FastModuloMonty(m, u); #else //# if BN_MOD == BARRT // loginfo << "Using BN_MOD = BARRT" << std::endl; //# elif BN_MOD == PMERS // loginfo << "Using BN_MOD = PMERS" << std::endl; //# elif BN_MOD == BASIC // loginfo << "Using BN_MOD = BASIC" << std::endl; //#else // loginfo << "Using unknown BN_MOD = " << BN_MOD << std::endl; //#endif bn_mod(n, n, m, u); #endif return *this; } // WARNING: Microbenchmarking this must be done on a single thread, so be careful! //#define INVERT_MICROBENCH #ifdef INVERT_MICROBENCH AveragingTimer __inv_microbench_timer_dig("bn_gcd_ext_dig time: "); AveragingTimer __inv_microbench_timer_leh("bn_gcd_ext_lehme time: "); #endif BNT BNT::invertModPrime(const dig_t& a, const BNT& p) { assertTrue(bn_is_prime(p)); BNT gcd, inv, ign; // NOTE: This is faster than Lehme method // FIXME: RELIC: Setting 'ing' to nullptr seems to segfault for no reason. #ifdef INVERT_MICROBENCH { __inv_microbench_timer_dig.startLap(); #endif // NOTE: This is faster than bn_gcd_ext_lehme (but only works on small dig_t numbers) bn_gcd_ext_dig(gcd, ign, inv, p, a); #ifdef INVERT_MICROBENCH __inv_microbench_timer_dig.endLap(); if(__inv_microbench_timer_dig.numIterations() % 1000 == 0) { logperf << __inv_microbench_timer_dig << endl; } } #endif assertEqual((BNT(a) * inv).SlowModulo(p), BNT::One()); if(inv >= p || inv < 0) { inv.SlowModulo(p); } else { //logperf << "Avoided reducing mod p (dig_t)" << endl; } return inv; } BNT BNT::invertModPrime(const BNT& p) const { // n * inv + [?] * p == 1 <=> n * inv (mod p) + [?] * p (mod p) == 1 (mod p) <=> n * inv (mod p) == 1 (mod p) assertTrue(bn_is_prime(p)); // WARNING: 'bn_gcd_ext_basic' does not seem to work when a < 0, |a| > m (e.g., a = -9, m = 7) but works when |a| < m assertFalse(*this < 0 && -(*this) > p); // Picked fastest GCD (implemented in various ways in RELIC: basic, Lehmer and Stein) BNT gcd, inv; //bn_gcd_ext_basic(gcd, inv, nullptr, n, p); //bn_gcd_ext_stein(gcd, inv, nullptr, n, p); // faster than basic #ifdef INVERT_MICROBENCH { __inv_microbench_timer_leh.startLap(); #endif bn_gcd_ext_lehme(gcd, inv, nullptr, n, p); // faster than stein #ifdef INVERT_MICROBENCH __inv_microbench_timer_leh.endLap(); if(__inv_microbench_timer_leh.numIterations() % 1000 == 0) { logperf << __inv_microbench_timer_leh << endl; } } #endif assertEqual(((*this) * inv).SlowModulo(p), BNT::One()); // Q: Is it faster to compute n^{fieldOrder-1}? A: Tested and nope! // BNT inv; // BNT pm2; // bn_sub_dig(pm2, p, static_cast<dig_t>(2)); // bn_mxp(inv, n, pm2, p); if(inv >= p || inv < 0) { inv.SlowModulo(p); } else { //logperf << "Avoided reducing mod p (Lehme)" << endl; } return inv; } /** * G1T */ void G1T::toBytes(unsigned char * buf, int size) const { assertGreaterThanOrEqual(size, getByteCount()); g1_write_bin(buf, size, n, 1); //LOG_DEBUG(GL, "Wrote G1T of " << size << " bytes"); } void G1T::fromBytes(const unsigned char * buf, int size) { //LOG_DEBUG(GL, "Reading G1T of " << size << " bytes"); g1_read_bin(n, buf, size); } std::string G1T::toString() const { return toStringHelper(*this); } void G1T::fromString(const std::string& str) { fromStringHelper(*this, str); } /** * G2T */ void G2T::toBytes(unsigned char * buf, int size) const { assertGreaterThanOrEqual(size, getByteCount()); // FIXME: RELIC: g2_write_bin should take const g2_t g2_write_bin(buf, size, const_cast<g2_t&>(n), 1); } void G2T::fromBytes(const unsigned char * buf, int size) { g2_read_bin(n, buf, size); } std::string G2T::toString() const { return toStringHelper(*this); } void G2T::fromString(const std::string& str) { fromStringHelper(*this, str); } /** * GTT */ const GTT& GTT::Zero() { // FIXME: RELIC: Missing gt_is_zero define (as fp2_is_zero or fp12_is_zero) static GTT zero; assertTrue(gt_cmp_dig(zero, 0) == CMP_EQ); return zero; } /** * std::ostream overload */ std::ostream& operator<<(std::ostream& o, const BNT& num) { o << num.toString(); return o; } std::ostream& operator<<(std::ostream& o, const G1T& num) { // Print as hexadecimal string o << num.toString(); return o; } std::ostream& operator<<(std::ostream& o, const G2T& num) { o << num.toString(); return o; } std::ostream& operator<<(std::ostream& o, const GTT& num) { // Print as hexadecimal string // FIXME: RELIC: For some reason gt_size_bin fails on zero if(num.isZero()) { o << "00"; return o; } // FIXME: RELIC: For some reason gt_size_bin fails on one if(num.isUnity()) { o << "01"; return o; } // FIXME: RELIC: gt_size_bin should take const gt_t int size = gt_size_bin(const_cast<GTT&>(num), 1); AutoByteBuf buf(size); // FIXME: RELIC: gt_size_bin should take const gt_t gt_write_bin(buf, size, const_cast<GTT&>(num), 1); o << Utils::bin2hex(buf, size); return o; } } /* namespace Relic */ } /* namespace BLS */
27.08589
136
0.644394
[ "object" ]
a9f4cc40eed670a5bf7dd0986fc037a5826889b4
4,702
cpp
C++
_site/Competitive Programming/Codeforces/1182C.cpp
anujkyadav07/anuj-k-yadav.github.io
ac5cccc8cdada000ba559538cd84921437b3c5e6
[ "MIT" ]
1
2019-06-10T04:39:49.000Z
2019-06-10T04:39:49.000Z
_site/Competitive Programming/Codeforces/1182C.cpp
anujkyadav07/anuj-k-yadav.github.io
ac5cccc8cdada000ba559538cd84921437b3c5e6
[ "MIT" ]
2
2021-09-27T23:34:07.000Z
2022-02-26T05:54:27.000Z
_site/Competitive Programming/Codeforces/1182C.cpp
anujkyadav07/anuj-k-yadav.github.io
ac5cccc8cdada000ba559538cd84921437b3c5e6
[ "MIT" ]
3
2019-06-23T14:15:08.000Z
2019-07-09T20:40:58.000Z
#include <bits/stdc++.h> using namespace std; /* Template file for Online Algorithmic Competitions */ /* Typedefs */ /* Basic types */ typedef long long ll; typedef long double ld; typedef unsigned long long ull; /* STL containers */ typedef vector <int> vi; typedef vector <ll> vll; typedef pair <int, int> pii; typedef pair <ll, ll> pll; typedef vector < pii > vpii; typedef vector < pll > vpll; typedef vector <string> vs; typedef vector < vi > vvi; typedef vector < vll > vvll; typedef vector < vpii > vvpii; typedef set <int> si; /* Macros */ /* Loops */ #define fl(i, a, b) for(ll i = (a); i < (b); i ++) #define fll(i,n) fl(i,0,n) #define rep(i, n) fl(i, 1, (n)) #define loop(i, n) fl(i, 0, (n) - 1) #define rfl(i, a, b) for(int i(a); i >= (b); i --) #define rrep(i, n) rfl(i, (n), 1) /* Algorithmic functions */ #define srt(v) sort((v).begin(), (v).end()) #define rem_duplicate(v) (v).erase(unique((v).begin(), (v).end()), (v).end()) /* STL container methods */ #define pb push_back #define mp make_pair #define eb emplace_back /* String methods */ #define dig(i) (s[i] - '0') #define slen(s) s.length() /* Shorthand notations */ #define fr first #define sc second #define re return #define sz(x) ((int) (x).size()) #define all(x) (x).begin(), (x).end() #define sqr(x) ((x) * (x)) #define fill(x, y) memset(x, y, sizeof(x)) #define clr(a) fill(a, 0) #define endl '\n' /* Mathematical */ #define IINF 0x3f3f3f3f #define LLINF 1000111000111000111LL #define PI 3.14159265358979323 /* Debugging purpose */ #define trace1(x) cerr << #x << ": " << x << endl #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl /* Fast Input Output */ #define high_functioning_sociopath ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) /* Constants */ const ll MOD = 1000000007LL; const ll MAX = 100010LL; const int N = 1e6 + 5; /* Templates */ template<typename T> T power(T x, T y, ll m = MOD){T ans = 1; x %= m; while(y > 0){ if(y & 1LL) ans = (ans * x)%m; y >>= 1LL; x = (x*x)%m; } return ans%m; } void Sieve(int n) { bool prime[n+1]; memset(prime, true, sizeof(prime)); for (int p=2; p*p<=n; p++) { if (prime[p] == true) { for (int i=p*p; i<=n; i += p) prime[i] = false; } } for (int p=2; p<=n; p++) if (prime[p]) cout << p << " "; } int n; string s[N]; map<int, map<int, vector<string> > > v; bool isVowel(char ch) { if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') return 1; return 0; } int cnt(string &s) { int cnt = 0; for(int i = 0; i < s.size(); i++) if(isVowel(s[i])) cnt++; return cnt; } char getLast(string &s) { for(int i = s.size() - 1; i >= 0; i--) if(isVowel(s[i])) return s[i]; } int32_t main() { high_functioning_sociopath; cin >> n; for(int i = 1; i <= n; i++) { cin >> s[i]; v[cnt(s[i])][getLast(s[i]) - 'a'].push_back(s[i]); } vector<string> f, s; for(int i = 1; i <= n; i++) { vector<string> temp; for(int j = 0; j <= 25; j++) { while(v[i][j].size() > 1) { s.push_back(v[i][j].back()); v[i][j].pop_back(); s.push_back(v[i][j].back()); v[i][j].pop_back(); } if(v[i][j].size()) temp.push_back(v[i][j].back()); } while(temp.size() > 1) { f.push_back(temp.back()); temp.pop_back(); f.push_back(temp.back()); temp.pop_back(); } } vector<string> ans; while(s.size() >= 2) { if(f.size() >= 2) { ans.push_back(f.back()); f.pop_back(); ans.push_back(s.back()); s.pop_back(); ans.push_back(f.back()); f.pop_back(); ans.push_back(s.back()); s.pop_back(); } else if(s.size() >= 4) { int sz = s.size(); ans.push_back(s[sz - 1]); ans.push_back(s[sz - 3]); ans.push_back(s[sz - 2]); ans.push_back(s[sz - 4]); s.pop_back(); s.pop_back(); s.pop_back(); s.pop_back(); } else break; } cout << ans.size() / 4 << endl; for(int i = 0; i < ans.size(); i += 2) cout << ans[i] << " " << ans[i + 1] << endl; return 0; }
25.835165
156
0.47852
[ "vector" ]
a9f606c0c802e10d44f27504dbbee720f0000b9c
3,041
cpp
C++
src/functions/func_strings_impl.cpp
jsoniq/jsoniq
f7af29417f809d64d1f0b2622d880bc4d87f2e42
[ "Apache-2.0" ]
94
2015-01-18T09:40:36.000Z
2022-03-02T21:14:55.000Z
src/functions/func_strings_impl.cpp
jsoniq/jsoniq
f7af29417f809d64d1f0b2622d880bc4d87f2e42
[ "Apache-2.0" ]
72
2015-01-05T22:00:31.000Z
2021-07-17T11:35:03.000Z
src/functions/func_strings_impl.cpp
jsoniq/jsoniq
f7af29417f809d64d1f0b2622d880bc4d87f2e42
[ "Apache-2.0" ]
27
2015-01-18T20:20:54.000Z
2020-11-01T18:01:07.000Z
/* * Copyright 2006-2008 The FLWOR Foundation. * * 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 "stdafx.h" #include "common/shared_types.h" #include "types/typeops.h" #include "functions/function.h" #include "functions/function_impl.h" #include "functions/func_strings.h" #include "system/globalenv.h" #include "compiler/expression/expr_consts.h" namespace zorba { /******************************************************************************* ********************************************************************************/ BoolAnnotationValue fn_concat::ignoresSortedNodes( expr* fo, csize input) const { return ANNOTATION_TRUE; } BoolAnnotationValue fn_concat::ignoresDuplicateNodes( expr* fo, csize input) const { return ANNOTATION_TRUE; } /******************************************************************************* ********************************************************************************/ function* fn_substring::specialize( static_context* sctx, const std::vector<xqtref_t>& argTypes) const { assert(false); return NULL; } /******************************************************************************* ********************************************************************************/ xqtref_t fn_analyze_string_3_0::getReturnType(const fo_expr* caller) const { return GENV_TYPESYSTEM.create_node_type( store::StoreConsts::elementNode, createQName(static_context::W3C_FN_NS,"","analyze-string-result"), NULL, SequenceType::QUANT_ONE, false, false); } /******************************************************************************* ********************************************************************************/ void populate_context_strings_impl(static_context* sctx) { { DECL_WITH_KIND(sctx, fn_analyze_string_3_0, (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string"), GENV_TYPESYSTEM.STRING_TYPE_QUESTION, GENV_TYPESYSTEM.STRING_TYPE_ONE, GENV_TYPESYSTEM.ELEMENT_TYPE_ONE), FunctionConsts::FN_ANALYZE_STRING_2); } { DECL_WITH_KIND(sctx, fn_analyze_string_3_0, (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string"), GENV_TYPESYSTEM.STRING_TYPE_QUESTION, GENV_TYPESYSTEM.STRING_TYPE_ONE, GENV_TYPESYSTEM.STRING_TYPE_ONE, GENV_TYPESYSTEM.ELEMENT_TYPE_ONE), FunctionConsts::FN_ANALYZE_STRING_3); } } } /* vim:set et sw=2 ts=2: */
27.151786
84
0.561657
[ "vector" ]
a9fb6aeaed4c0ee58dafa0c01c176ed4ee5c9728
7,929
cpp
C++
src/xodr/test/xodr/test_parse_road_object.cpp
jad-nohra-aid/hackatum-2019
06500fc1124e32f7de0d5240c2a59bb522ffb059
[ "MIT" ]
2
2019-11-12T15:25:42.000Z
2021-11-29T08:35:10.000Z
src/xodr/test/xodr/test_parse_road_object.cpp
jad-nohra-aid/hackatum-2019
06500fc1124e32f7de0d5240c2a59bb522ffb059
[ "MIT" ]
null
null
null
src/xodr/test/xodr/test_parse_road_object.cpp
jad-nohra-aid/hackatum-2019
06500fc1124e32f7de0d5240c2a59bb522ffb059
[ "MIT" ]
1
2020-12-19T11:53:33.000Z
2020-12-19T11:53:33.000Z
#include "road_object.h" #include "xodr_map.h" #include "road_object_outline.h" #include "../test_config.h" #include <gtest/gtest.h> namespace aid { namespace xodr { TEST(ParseRoadObject, testParseWidthLength) { XodrReader xml = XodrReader::fromText( "<object type='tree' name='ForestTree06.flt' id='tree 12' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none' length='10'" " width='11' height='20' hdg='1' pitch='.1' roll='.01'/>"); xml.readStartElement("object"); RoadObject roadObject = std::move(RoadObject::parseXml(xml).value()); EXPECT_EQ(roadObject.type(), RoadObject::Type::TREE); EXPECT_EQ(roadObject.name(), "ForestTree06.flt"); EXPECT_EQ(roadObject.id(), "tree 12"); EXPECT_EQ(roadObject.s(), 25); EXPECT_EQ(roadObject.t(), -10); EXPECT_EQ(roadObject.zOffset(), 1); EXPECT_EQ(roadObject.validLength(), 2); EXPECT_EQ(roadObject.orientation(), RoadObject::Orientation::NONE); EXPECT_EQ(roadObject.hasBoxGeometry(), true); EXPECT_EQ(roadObject.hasCylinderGeometry(), false); EXPECT_EQ(roadObject.hasOutlineGeometry(), false); EXPECT_EQ(roadObject.length(), 10); EXPECT_EQ(roadObject.width(), 11); EXPECT_EQ(roadObject.height(), 20); EXPECT_EQ(roadObject.heading(), 1); EXPECT_EQ(roadObject.pitch(), .1); EXPECT_EQ(roadObject.roll(), .01); } TEST(ParseRoadObject, testParseRadius) { XodrReader xml = XodrReader::fromText( "<object type='tree' name='ForestTree06.flt' id='tree 12' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none' radius='10'" " height='20' hdg='1' pitch='.1' roll='.01'/>"); xml.readStartElement("object"); RoadObject roadObject = std::move(RoadObject::parseXml(xml).value()); EXPECT_EQ(roadObject.type(), RoadObject::Type::TREE); EXPECT_EQ(roadObject.name(), "ForestTree06.flt"); EXPECT_EQ(roadObject.id(), "tree 12"); EXPECT_EQ(roadObject.s(), 25); EXPECT_EQ(roadObject.t(), -10); EXPECT_EQ(roadObject.zOffset(), 1); EXPECT_EQ(roadObject.validLength(), 2); EXPECT_EQ(roadObject.orientation(), RoadObject::Orientation::NONE); EXPECT_EQ(roadObject.hasBoxGeometry(), false); EXPECT_EQ(roadObject.hasCylinderGeometry(), true); EXPECT_EQ(roadObject.hasOutlineGeometry(), false); EXPECT_EQ(roadObject.radius(), 10); EXPECT_EQ(roadObject.height(), 20); EXPECT_EQ(roadObject.heading(), 1); EXPECT_EQ(roadObject.pitch(), .1); EXPECT_EQ(roadObject.roll(), .01); } TEST(ParseRoadObject, testParseWidthLengthAndRadius) { XodrReader xml = XodrReader::fromText( "<object type='tree' name='ForestTree06.flt' id='tree 12' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none' length='10'" " width='11' radius='12' height='20' hdg='1' pitch='.1' roll='.01'/>"); xml.readStartElement("object"); XodrParseResult<RoadObject> result(RoadObject::parseXml((xml))); EXPECT_EQ(result.errors().size(), 1); } TEST(ParseRoadObject, testParseWidthNoLength) { XodrReader xml = XodrReader::fromText( "<object type='tree' name='ForestTree06.flt' id='tree 12' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none'" " width='11' height='20' hdg='1' pitch='.1' roll='.01'/>"); xml.readStartElement("object"); XodrParseResult<RoadObject> result(RoadObject::parseXml((xml))); EXPECT_EQ(result.errors().size(), 1); } TEST(ParseRoadObject, testLengthNoWidth) { XodrReader xml = XodrReader::fromText( "<object type='tree' name='ForestTree06.flt' id='tree 12' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none' length='10'" " height='20' radius='30' hdg='1' pitch='.1' roll='.01'/>"); xml.readStartElement("object"); XodrParseResult<RoadObject> result(RoadObject::parseXml((xml))); EXPECT_EQ(result.errors().size(), 2); } TEST(ParseRoadObject, testLengthWidthNoHeight) { XodrReader xml = XodrReader::fromText( "<object type='tree' name='ForestTree06.flt' id='tree 12' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none' length='10'" " width='20' radius='30' hdg='1' pitch='.1' roll='.01'/>"); xml.readStartElement("object"); XodrParseResult<RoadObject> result(RoadObject::parseXml((xml))); EXPECT_EQ(result.errors().size(), 2); } TEST(ParseRoadObject, testParseRadiusNoHeight) { XodrReader xml = XodrReader::fromText( "<object type='tree' name='ForestTree06.flt' id='tree 12' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none' radius='10'" " hdg='1' pitch='.1' roll='.01'/>"); xml.readStartElement("object"); XodrParseResult<RoadObject> result(RoadObject::parseXml((xml))); EXPECT_EQ(result.errors().size(), 1); } TEST(ParseRoadObject, testParseOutline) { XodrReader xml = XodrReader::fromText( "<object type='building' name='Tower' id='tower 1' s='25' t='-10' " " zOffset='1' validLength='2' orientation='none' hdg='1' pitch='.1' roll='.01'>" " <outline>" " <cornerRoad s='.5' t='3' dz='.1' height='4'/>" " <cornerLocal u='1' v='2' z='3' height='4'/>" " </outline>" "</object>"); xml.readStartElement("object"); RoadObject roadObject = std::move(RoadObject::parseXml(xml).value()); EXPECT_EQ(roadObject.type(), RoadObject::Type::BUILDING); EXPECT_EQ(roadObject.name(), "Tower"); EXPECT_EQ(roadObject.id(), "tower 1"); EXPECT_EQ(roadObject.s(), 25); EXPECT_EQ(roadObject.t(), -10); EXPECT_EQ(roadObject.zOffset(), 1); EXPECT_EQ(roadObject.validLength(), 2); EXPECT_EQ(roadObject.orientation(), RoadObject::Orientation::NONE); EXPECT_EQ(roadObject.hasBoxGeometry(), false); EXPECT_EQ(roadObject.hasCylinderGeometry(), false); EXPECT_EQ(roadObject.hasOutlineGeometry(), true); EXPECT_EQ(roadObject.heading(), 1); EXPECT_EQ(roadObject.pitch(), .1); EXPECT_EQ(roadObject.roll(), .01); const RoadObjectOutline& outline = roadObject.outline(); const auto& corners = outline.corners(); EXPECT_EQ(corners.size(), 2); { const RoadObjectOutline::Corner& corner = corners[0]; EXPECT_EQ(corner.which(), 0); const auto& cornerRoad = boost::get<RoadObjectOutline::CornerRoad>(corner); EXPECT_EQ(cornerRoad.s(), .5); EXPECT_EQ(cornerRoad.t(), 3); EXPECT_EQ(cornerRoad.dz(), .1); EXPECT_EQ(cornerRoad.height(), 4); } { const RoadObjectOutline::Corner& corner = corners[1]; EXPECT_EQ(corner.which(), 1); const auto& cornerLocal = boost::get<RoadObjectOutline::CornerLocal>(corner); EXPECT_EQ(cornerLocal.u(), 1); EXPECT_EQ(cornerLocal.v(), 2); EXPECT_EQ(cornerLocal.z(), 3); EXPECT_EQ(cornerLocal.height(), 4); } } TEST(ParseRoadObject, testParseFullDocBox) { XodrReader xml = XodrReader::fromFile(std::string(TEST_DATA_PATH_PREFIX) + "xodr/test_road_objects/box_road_objects.xodr"); xml.readStartElement("OpenDRIVE"); XodrMap xodrMap = std::move(XodrMap::parseXml(xml).value()); xodrMap.validate(); } TEST(ParseRoadObject, testParseFullDocCylinder) { XodrReader xml = XodrReader::fromFile(std::string(TEST_DATA_PATH_PREFIX) + "xodr/test_road_objects/cylinder_road_objects.xodr"); xml.readStartElement("OpenDRIVE"); XodrMap xodrMap = std::move(XodrMap::parseXml(xml).value()); xodrMap.validate(); } TEST(ParseRoadObject, testParseFullDocOutline) { XodrReader xml = XodrReader::fromFile(std::string(TEST_DATA_PATH_PREFIX) + "xodr/test_road_objects/outline_road_objects.xodr"); xml.readStartElement("OpenDRIVE"); XodrMap xodrMap = std::move(XodrMap::parseXml(xml).value()); xodrMap.validate(); } }} // namespace aid::xodr
34.624454
119
0.653424
[ "object" ]
e71063a24ca8fdb518bbe4c896208dd8af0e8fce
566
cpp
C++
services/http/recommender/LexicalRecommender.cpp
DavidYRB/LaiScholar
df9bfbd187869ffcef63deb1d8b1db868d148ec7
[ "Apache-2.0" ]
null
null
null
services/http/recommender/LexicalRecommender.cpp
DavidYRB/LaiScholar
df9bfbd187869ffcef63deb1d8b1db868d148ec7
[ "Apache-2.0" ]
null
null
null
services/http/recommender/LexicalRecommender.cpp
DavidYRB/LaiScholar
df9bfbd187869ffcef63deb1d8b1db868d148ec7
[ "Apache-2.0" ]
null
null
null
#include "services/http/recommender/LexicalRecommender.h" #include <algorithm> namespace services { namespace http { namespace recommender { std::vector<data_source::QueryResult> LexicalRecommender::recommend(const std::string &key) { std::vector<data_source::QueryResult> result = getDataSource()->query(key); std::sort(result.begin(), result.end(), [](const data_source::QueryResult& q1, const data_source::QueryResult& q2){ return q1.title < q2.title; }); return result; } } // namespace recommender } // namespace http } // namespace services
29.789474
93
0.733216
[ "vector" ]
e711f640ccfbf08e66ff011dc47855a0fdaa35ca
6,840
cpp
C++
src/libraries/regionModels/thermoBaffleModels/thermalBaffleModel/thermalBaffleModel.cpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
src/libraries/regionModels/thermoBaffleModels/thermalBaffleModel/thermalBaffleModel.cpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
src/libraries/regionModels/thermoBaffleModels/thermalBaffleModel/thermalBaffleModel.cpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
/*---------------------------------------------------------------------------*\ Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of CAELUS. CAELUS 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. CAELUS 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 CAELUS. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "thermalBaffleModel.hpp" #include "fvMesh.hpp" #include "mappedVariableThicknessWallPolyPatch.hpp" #include "wedgePolyPatch.hpp" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace CML { namespace regionModels { namespace thermalBaffleModels { // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTypeNameAndDebug(thermalBaffleModel, 0); defineRunTimeSelectionTable(thermalBaffleModel, mesh); defineRunTimeSelectionTable(thermalBaffleModel, dictionary); // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // bool thermalBaffleModel::read() { regionModel1D::read(); return true; } bool thermalBaffleModel::read(const dictionary& dict) { regionModel1D::read(dict); return true; } void thermalBaffleModel::init() { if (active_) { const polyBoundaryMesh& rbm = regionMesh().boundaryMesh(); // Check if region mesh in 1-D label nTotalEdges = 0; const label patchi = intCoupledPatchIDs_[0]; nTotalEdges = 2*nLayers_*rbm[patchi].nInternalEdges(); nTotalEdges += nLayers_*(rbm[patchi].nEdges() - rbm[patchi].nInternalEdges()); reduce(nTotalEdges, sumOp<label>()); label nFaces = 0; forAll(rbm, patchi) { if ( rbm[patchi].size() && ( isA<wedgePolyPatch>(rbm[patchi]) || isA<emptyPolyPatch>(rbm[patchi]) ) ) { nFaces += rbm[patchi].size(); } } reduce(nFaces, sumOp<label>()); if (nTotalEdges == nFaces) { oneD_ = true; Info << "\nThe thermal baffle is 1D \n" << endl; } else { Info << "\nThe thermal baffle is 3D \n" << endl; } forAll(intCoupledPatchIDs_, i) { const label patchi = intCoupledPatchIDs_[i]; const polyPatch& pp = rbm[patchi]; if ( !isA<mappedVariableThicknessWallPolyPatch>(pp) && oneD_ && !constantThickness_ ) { FatalErrorInFunction << "' not type '" << mappedVariableThicknessWallPolyPatch::typeName << "'. This is necessary for 1D solution " << " and variable thickness" << "\n for patch. " << pp.name() << exit(FatalError); } else if (!isA<mappedWallPolyPatch>(pp)) { FatalErrorInFunction << "' not type '" << mappedWallPolyPatch::typeName << "'. This is necessary for 3D solution" << "\n for patch. " << pp.name() << exit(FatalError); } } if (oneD_ && !constantThickness_) { const label patchi = intCoupledPatchIDs_[0]; const polyPatch& pp = rbm[patchi]; const mappedVariableThicknessWallPolyPatch& ppCoupled = refCast < const mappedVariableThicknessWallPolyPatch >(pp); thickness_ = ppCoupled.thickness(); // Check that thickness has the right size if (thickness_.size() != pp.size()) { FatalErrorInFunction << " coupled patches in thermalBaffle are " << nl << " different sizes from list thickness" << nl << exit(FatalError); } // Calculate thickness of the baffle on the first face only. if (delta_.value() == 0.0) { forAll(ppCoupled, localFacei) { label facei = ppCoupled.start() + localFacei; label faceO = boundaryFaceOppositeFace_[localFacei]; delta_.value() = mag ( regionMesh().faceCentres()[facei] - regionMesh().faceCentres()[faceO] ); break; } } } } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // thermalBaffleModel::thermalBaffleModel(const fvMesh& mesh) : regionModel1D(mesh, "thermalBaffle"), thickness_(), delta_("delta", dimLength, 0.0), oneD_(false), constantThickness_(true) {} thermalBaffleModel::thermalBaffleModel ( const word& modelType, const fvMesh& mesh, const dictionary& dict ) : regionModel1D(mesh, "thermalBaffle", modelType, dict, true), thickness_(), delta_("delta", dimLength, 0.0), oneD_(false), constantThickness_(dict.lookupOrDefault<bool>("constantThickness", true)) { init(); } thermalBaffleModel::thermalBaffleModel ( const word& modelType, const fvMesh& mesh ) : regionModel1D(mesh, "thermalBaffle", modelType), thickness_(), delta_("delta", dimLength, 0.0), oneD_(false), constantThickness_(lookupOrDefault<bool>("constantThickness", true)) { init(); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // thermalBaffleModel::~thermalBaffleModel() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // void thermalBaffleModel::preEvolveRegion() {} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace thermalBaffleModels } // End namespace regionModels } // End namespace CML // ************************************************************************* //
28.381743
79
0.491813
[ "mesh", "3d" ]
e71aa596588b7dad77197311fc0a0d5e7dccc3fa
2,897
hpp
C++
openstudiocore/src/model/SetpointManagerWarmest.hpp
jasondegraw/OpenStudio
2ab13f6e5e48940929041444e40ad9d36f80f552
[ "blessing" ]
1
2016-12-29T08:45:03.000Z
2016-12-29T08:45:03.000Z
openstudiocore/src/model/SetpointManagerWarmest.hpp
jasondegraw/OpenStudio
2ab13f6e5e48940929041444e40ad9d36f80f552
[ "blessing" ]
null
null
null
openstudiocore/src/model/SetpointManagerWarmest.hpp
jasondegraw/OpenStudio
2ab13f6e5e48940929041444e40ad9d36f80f552
[ "blessing" ]
null
null
null
/********************************************************************** * Copyright (c) 2008-2016, Alliance for Sustainable Energy. * All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA **********************************************************************/ #ifndef MODEL_SETPOINTMANAGERWARMEST_HPP #define MODEL_SETPOINTMANAGERWARMEST_HPP #include "ModelAPI.hpp" #include "SetpointManager.hpp" namespace openstudio { namespace model { class Node; namespace detail { class SetpointManagerWarmest_Impl; } // detail /** SetpointManagerWarmest is a SetpointManager that wraps the OpenStudio IDD object 'OS:SetpointManager:Warmest'. */ class MODEL_API SetpointManagerWarmest : public SetpointManager { public: explicit SetpointManagerWarmest(const Model& model); virtual ~SetpointManagerWarmest() {} static IddObjectType iddObjectType(); static std::vector<std::string> controlVariableValues(); static std::vector<std::string> strategyValues(); std::string controlVariable() const; bool setControlVariable(const std::string& controlVariable); double minimumSetpointTemperature() const; bool setMinimumSetpointTemperature(double minimumSetpointTemperature); double maximumSetpointTemperature() const; bool setMaximumSetpointTemperature(double maximumSetpointTemperature); std::string strategy() const; bool setStrategy(const std::string& strategy); boost::optional<Node> setpointNode() const; protected: /// @cond typedef detail::SetpointManagerWarmest_Impl ImplType; explicit SetpointManagerWarmest(std::shared_ptr<detail::SetpointManagerWarmest_Impl> impl); friend class detail::SetpointManagerWarmest_Impl; friend class Model; friend class IdfObject; friend class openstudio::detail::IdfObject_Impl; /// @endcond private: REGISTER_LOGGER("openstudio.model.SetpointManagerWarmest"); }; /** \relates SetpointManagerWarmest*/ typedef boost::optional<SetpointManagerWarmest> OptionalSetpointManagerWarmest; /** \relates SetpointManagerWarmest*/ typedef std::vector<SetpointManagerWarmest> SetpointManagerWarmestVector; } // model } // openstudio #endif // MODEL_SETPOINTMANAGERWARMEST_HPP
29.262626
117
0.73835
[ "object", "vector", "model" ]
e71b558f552bff484aa4c370b5712797067302a4
21,828
cpp
C++
foo_uie_console/main.cpp
msquared2/console_panel
a9f82a094af68e6105d7efe8afcfbcb556d04672
[ "0BSD" ]
null
null
null
foo_uie_console/main.cpp
msquared2/console_panel
a9f82a094af68e6105d7efe8afcfbcb556d04672
[ "0BSD" ]
null
null
null
foo_uie_console/main.cpp
msquared2/console_panel
a9f82a094af68e6105d7efe8afcfbcb556d04672
[ "0BSD" ]
null
null
null
/** * \file main.cpp * * \brief Console panel component * * This component is an example of a multiple instance panel that takes keyboard input * * It demonstrates the following relevant techniques: * - Subclassing the child control to process keyboard shortcuts * - Setting the font and colours of the child window * - Keeping a list of active windows and updating them from a callback (in this case designed * such that the callback may come from any thread) * - That's about it ? */ #define NOMINMAX #include <algorithm> #include <deque> #include <mutex> #include <vector> #include "../ui_helpers/stdafx.h" #include "../pfc/pfc.h" #include <windows.h> #include <commctrl.h> #include <windowsx.h> #include "../foobar2000/SDK/foobar2000.h" #include "../columns_ui-sdk/ui_extension.h" /** Declare some component information */ DECLARE_COMPONENT_VERSION("Console panel", "3.0.0-beta.1", "compiled: " __DATE__ "\n" "with Panel API version: " UI_EXTENSION_VERSION ); constexpr auto IDC_EDIT = 1001; constexpr auto MSG_UPDATE = WM_USER + 2; constexpr auto ID_TIMER = 667; /** \brief The maximum number of message we cache/display */ constexpr t_size maximum_messages = 200; enum class EdgeStyle : int { None = 0, Sunken = 1, Grey = 2, }; cfg_int cfg_last_edge_style(GUID{0x05550547, 0xbf98, 0x088c, 0xbe, 0x0e, 0x24, 0x95, 0xe4, 0x9b, 0x88, 0xc7}, static_cast<int>(EdgeStyle::None)); cfg_bool cfg_last_hide_trailing_newline( {0x5db0b4d6, 0xf429, 0x4fc5, 0xb9, 0x1d, 0x29, 0x8e, 0xf3, 0x34, 0x75, 0x16}, false); constexpr GUID console_font_id = {0x26059feb, 0x488b, 0x4ce1, {0x82, 0x4e, 0x4d, 0xf1, 0x13, 0xb4, 0x55, 0x8e}}; constexpr GUID console_colours_client_id = {0x9d814898, 0x0db4, 0x4591, {0xa7, 0xaa, 0x4e, 0x94, 0xdd, 0x07, 0xb3, 0x87}}; /** * This is the unique GUID identifying our panel. You should not re-use this one * and generate your own using GUIDGEN. */ constexpr GUID window_id{0x3c85d0a9, 0x19d5, 0x4144, {0xbc, 0xc2, 0x94, 0x9a, 0xb7, 0x64, 0x23, 0x3a}}; constexpr auto current_config_version = 0; class Message { public: SYSTEMTIME m_time{}; std::string m_message; Message(std::string_view message) : m_message(message) { GetLocalTime(&m_time); } }; class ConsoleWindow : public uie::container_uie_window_v3 { public: static void s_update_all_fonts(); static void s_update_colours(); static void s_update_window_themes(); static void s_on_message_received(const char* ptr, t_size len); // from any thread const GUID& get_extension_guid() const override { return window_id; } void get_name(pfc::string_base& out) const override { out.set_string("Console"); } void get_category(pfc::string_base& out) const override { out.set_string("Panels"); } unsigned get_type() const override { /** In this case we are only of type type_panel */ return ui_extension::type_panel; } uie::container_window_v3_config get_window_config() override { return {L"{89A3759F-348A-4e3f-BF43-3D16BC059186}"}; } void get_config(stream_writer* writer, abort_callback& abort) const override; void set_config(stream_reader* reader, t_size p_size, abort_callback& abort) override; void get_menu_items(uie::menu_hook_t& p_hook) override; long get_edit_ex_styles() const; void update_content(); void update_content_throttled(); EdgeStyle get_edge_style() const { return m_edge_style; } void set_edge_style(EdgeStyle edge_style); bool get_hide_trailing_newline() const { return m_hide_trailing_newline; } void set_hide_trailing_newline(bool hide_trailing_newline); private: static LRESULT WINAPI hook_proc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp); static void s_clear(); LRESULT on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp) override; LRESULT on_hook(HWND wnd, UINT msg, WPARAM wp, LPARAM lp); void set_window_theme() const; void copy() const; static std::mutex s_mutex; static HFONT s_font; static wil::unique_hbrush s_background_brush; static std::deque<Message> s_messages; static std::vector<HWND> s_notify_list; static std::vector<service_ptr_t<ConsoleWindow>> s_windows; HWND m_wnd_edit{}; WNDPROC m_editproc{}; LARGE_INTEGER m_time_last_update{}; bool m_timer_active{}; EdgeStyle m_edge_style{cfg_last_edge_style.get_value()}; bool m_hide_trailing_newline{cfg_last_hide_trailing_newline.get_value()}; }; std::vector<HWND> ConsoleWindow::s_notify_list; std::vector<service_ptr_t<ConsoleWindow>> ConsoleWindow::s_windows; HFONT ConsoleWindow::s_font{}; wil::unique_hbrush ConsoleWindow::s_background_brush; std::deque<Message> ConsoleWindow::s_messages; std::mutex ConsoleWindow::s_mutex; void ConsoleWindow::s_update_all_fonts() { if (s_font != nullptr) { for (auto&& window : s_windows) { const HWND wnd = window->m_wnd_edit; if (wnd) SetWindowFont(wnd, nullptr, FALSE); } DeleteObject(s_font); } s_font = cui::fonts::helper(console_font_id).get_font(); for (auto&& window : s_windows) { const HWND wnd = window->m_wnd_edit; if (wnd) { SetWindowFont(wnd, s_font, TRUE); } } } void ConsoleWindow::s_update_colours() { s_background_brush.reset( CreateSolidBrush(cui::colours::helper(console_colours_client_id).get_colour(cui::colours::colour_background))); for (auto&& window : s_windows) { const HWND wnd = window->m_wnd_edit; if (wnd) RedrawWindow(wnd, nullptr, nullptr, RDW_INVALIDATE); } } void ConsoleWindow::s_update_window_themes() { for (auto&& window : s_windows) { window->set_window_theme(); } } void ConsoleWindow::set_edge_style(EdgeStyle edge_style) { m_edge_style = edge_style; cfg_last_edge_style = static_cast<int32_t>(edge_style); const auto flags = get_edit_ex_styles(); if (m_wnd_edit) { SetWindowLongPtr(m_wnd_edit, GWL_EXSTYLE, flags); SetWindowPos(m_wnd_edit, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); } } void ConsoleWindow::set_hide_trailing_newline(bool hide_trailing_newline) { cfg_last_hide_trailing_newline = m_hide_trailing_newline = hide_trailing_newline; update_content_throttled(); } void ConsoleWindow::s_on_message_received(const char* ptr, t_size len) { std::scoped_lock<std::mutex> _(s_mutex); pfc::string8 buffer; /** Sort out line break messes */ { const char* start = ptr; const char* pos = ptr; while (t_size(pos - ptr) < len && *pos) { while (t_size(pos - ptr + 1) < len && pos[1] && pos[0] != '\n') pos++; { if (pos[0] == '\n') buffer.add_string(start, pos - start - ((pos > ptr && (pos[-1]) == '\r') ? 1 : 0)); else buffer.add_string(start, pos + 1 - start); buffer.add_byte('\r'); buffer.add_byte('\n'); // if ((pos-ptr)<len && *pos) { start = pos + 1; pos++; } } } } s_messages.emplace_back(Message({buffer.get_ptr(), buffer.get_length()})); if (s_messages.size() == maximum_messages) s_messages.pop_front(); /** Post a notification to all instances of the panel to update their display */ for (auto&& wnd : s_notify_list) { PostMessage(wnd, MSG_UPDATE, 0, 0); } } void ConsoleWindow::copy() const { DWORD start{}; DWORD end{}; SendMessage(m_wnd_edit, EM_GETSEL, reinterpret_cast<WPARAM>(&start), reinterpret_cast<LPARAM>(&end)); const auto has_selection = start != end; if (has_selection) { SendMessage(m_wnd_edit, WM_COPY, NULL, NULL); } else { const auto text = uGetWindowText(m_wnd_edit); uih::set_clipboard_text(text.get_ptr()); } } void ConsoleWindow::s_clear() { std::scoped_lock<std::mutex> _(s_mutex); /** Clear all messages */ s_messages.clear(); /** Post a notification to all instances of the panel to update their display */ for (auto&& wnd : s_notify_list) { PostMessage(wnd, MSG_UPDATE, 0, 0); } } void ConsoleWindow::get_config(stream_writer* writer, abort_callback& abort) const { writer->write_lendian_t(current_config_version, abort); writer->write_lendian_t(static_cast<int32_t>(m_edge_style), abort); writer->write_object_t(m_hide_trailing_newline, abort); } void ConsoleWindow::set_config(stream_reader* reader, t_size p_size, abort_callback& abort) { int32_t version{}; try { reader->read_lendian_t(version, abort); } catch (const exception_io_data_truncation&) { return; } if (version <= current_config_version) { int32_t edge_style{}; reader->read_lendian_t(edge_style, abort); m_edge_style = EdgeStyle{edge_style}; // Gracefully handle the new 'hide trailing newline' config bits when updating the component try { reader->read_object_t(m_hide_trailing_newline, abort); } catch (const exception_io_data_truncation&) { } } } class EdgeStyleMenuNode : public uie::menu_node_popup_t { public: EdgeStyleMenuNode(service_ptr_t<ConsoleWindow> window) { const auto current_edge_style = window->get_edge_style(); m_nodes.emplace_back("None", "Set the edge style to 'None'", current_edge_style == EdgeStyle::None ? state_radiochecked : 0, [window] { window->set_edge_style(EdgeStyle::None); }); m_nodes.emplace_back("Sunken", "Set the edge style to 'Sunken'", current_edge_style == EdgeStyle::Sunken ? state_radiochecked : 0, [window] { window->set_edge_style(EdgeStyle::Sunken); }); m_nodes.emplace_back("Grey", "Set the edge style to 'Grey'", current_edge_style == EdgeStyle::Grey ? state_radiochecked : 0, [window] { window->set_edge_style(EdgeStyle::Grey); }); } t_size get_children_count() const override { return m_nodes.size(); } void get_child(t_size index, uie::menu_node_ptr& p_out) const override { if (index < m_nodes.size()) p_out = new uie::simple_command_menu_node(m_nodes[index]); } bool get_display_data(pfc::string_base& p_out, unsigned& p_state) const override { p_out = "Edge style"; return true; } private: std::vector<uie::simple_command_menu_node> m_nodes; }; void ConsoleWindow::get_menu_items(uie::menu_hook_t& p_hook) { p_hook.add_node(new EdgeStyleMenuNode(this)); p_hook.add_node(new uie::simple_command_menu_node("Hide trailing newline", "Toggles visibility of the trailing newline.", get_hide_trailing_newline() ? uih::Menu::flag_checked : 0, [this, self = ptr{this}] { set_hide_trailing_newline(!get_hide_trailing_newline()); })); } long ConsoleWindow::get_edit_ex_styles() const { if (m_edge_style == EdgeStyle::Sunken) return WS_EX_CLIENTEDGE; if (m_edge_style == EdgeStyle::Grey) return WS_EX_STATICEDGE; return 0; } void ConsoleWindow::update_content() { std::scoped_lock<std::mutex> _(s_mutex); pfc::string8_fastalloc buffer; buffer.prealloc(1024); for (auto&& message : s_messages) { buffer << "[" << pfc::format_int(message.m_time.wHour, 2) << ":" << pfc::format_int(message.m_time.wMinute, 2) << ":" << pfc::format_int(message.m_time.wSecond, 2) << "] " << message.m_message.c_str(); } if (m_hide_trailing_newline && !buffer.is_empty()) buffer.truncate(std::string_view(buffer.c_str()).find_last_not_of("\r\n") + 1); uSetWindowText(m_wnd_edit, buffer); const int len = Edit_GetLineCount(m_wnd_edit); Edit_Scroll(m_wnd_edit, len, 0); QueryPerformanceCounter(&m_time_last_update); } void ConsoleWindow::update_content_throttled() { if (m_timer_active) return; LARGE_INTEGER current = {0}, freq = {0}; QueryPerformanceCounter(&current); QueryPerformanceFrequency(&freq); t_uint64 tenth = 5; if (m_time_last_update.QuadPart) { tenth = (current.QuadPart - m_time_last_update.QuadPart) / (freq.QuadPart / 100); } if (tenth < 25) { SetTimer(get_wnd(), ID_TIMER, 250 - t_uint32(tenth) * 10, nullptr); m_timer_active = true; } else update_content(); } LRESULT ConsoleWindow::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp) { switch (msg) { case WM_CREATE: { /** * Store a pointer to ourselves in this list, used for global notifications (in the main thread) * which updates instances of our panel. */ s_windows.emplace_back(this); { std::scoped_lock<std::mutex> _(s_mutex); /** Store a window handle in this list, used in global notifications (in any thread) which * updates the panels */ s_notify_list.emplace_back(wnd); } const auto edit_ex_styles = get_edit_ex_styles(); /** Create our edit window */ m_wnd_edit = CreateWindowEx(edit_ex_styles, WC_EDIT, _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOVSCROLL | WS_VSCROLL | ES_READONLY | ES_MULTILINE, 0, 0, 0, 0, wnd, reinterpret_cast<HMENU>(static_cast<INT_PTR>(IDC_EDIT)), core_api::get_my_instance(), nullptr); if (m_wnd_edit) { set_window_theme(); if (s_font) { /** Nth, n>1, instance; use exisiting font handle */ SetWindowFont(m_wnd_edit, s_font, FALSE); } else /** First window - create the font handle */ s_update_all_fonts(); if (!s_background_brush) s_update_colours(); /** Store a pointer to ourself in the user data field of the edit window */ SetWindowLongPtr(m_wnd_edit, GWLP_USERDATA, reinterpret_cast<LPARAM>(this)); /** Subclass the edit window */ m_editproc = reinterpret_cast<WNDPROC>( SetWindowLongPtr(m_wnd_edit, GWLP_WNDPROC, reinterpret_cast<LPARAM>(hook_proc))); SendMessage(wnd, MSG_UPDATE, 0, 0); } } break; case WM_TIMER: if (wp == ID_TIMER) { KillTimer(wnd, ID_TIMER); m_timer_active = false; update_content(); return 0; } break; /** Update the edit window's text */ case MSG_UPDATE: update_content_throttled(); break; case WM_SIZE: /** Reposition the edit window. */ SetWindowPos(m_wnd_edit, nullptr, 0, 0, LOWORD(lp), HIWORD(lp), SWP_NOZORDER); break; case WM_CTLCOLORSTATIC: { const auto dc = reinterpret_cast<HDC>(wp); cui::colours::helper helper(console_colours_client_id); SetTextColor(dc, helper.get_colour(cui::colours::colour_text)); SetBkColor(dc, helper.get_colour(cui::colours::colour_background)); return reinterpret_cast<LRESULT>(s_background_brush.get()); } case WM_ERASEBKGND: return FALSE; case WM_DESTROY: m_wnd_edit = nullptr; s_windows.erase(std::remove(s_windows.begin(), s_windows.end(), this), s_windows.end()); { std::scoped_lock<std::mutex> _(s_mutex); s_notify_list.erase(std::remove(s_notify_list.begin(), s_notify_list.end(), wnd), s_notify_list.end()); } break; case WM_NCDESTROY: if (s_windows.empty()) { DeleteFont(s_font); s_font = nullptr; s_background_brush.reset(); } break; } return DefWindowProc(wnd, msg, wp, lp); } LRESULT WINAPI ConsoleWindow::hook_proc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp) { auto* self = reinterpret_cast<ConsoleWindow*>(GetWindowLongPtr(wnd, GWLP_USERDATA)); return self ? self->on_hook(wnd, msg, wp, lp) : DefWindowProc(wnd, msg, wp, lp); } LRESULT ConsoleWindow::on_hook(HWND wnd, UINT msg, WPARAM wp, LPARAM lp) { switch (msg) { case WM_ERASEBKGND: return FALSE; case WM_PAINT: uih::paint_subclassed_window_with_buffering(wnd, m_editproc); return 0; case WM_KEYDOWN: /** * It's possible to assign right, left, up and down keys to keyboard shortcuts. But we would rather * let the edit control process those. */ if (get_host()->get_keyboard_shortcuts_enabled() && wp != VK_LEFT && wp != VK_RIGHT && wp != VK_UP && wp != VK_DOWN && g_process_keydown_keyboard_shortcuts(wp)) { return 0; } if (wp == VK_TAB) { g_on_tab(wnd); return 0; } break; case WM_SYSKEYDOWN: if (get_host()->get_keyboard_shortcuts_enabled() && g_process_keydown_keyboard_shortcuts(wp)) return 0; break; case WM_GETDLGCODE: break; case WM_CONTEXTMENU: if (wnd == reinterpret_cast<HWND>(wp)) { enum { ID_COPY = 1, ID_CLEAR, ID_EDGE_STYLE_NONE, ID_EDGE_STYLE_SUNKEN, ID_EDGE_STYLE_GREY, ID_HIDE_TRAILING_NEWLINE }; POINT pt = {GET_X_LPARAM(lp), GET_Y_LPARAM(lp)}; if (pt.x == -1 && pt.y == -1) { RECT rc; GetRelativeRect(wnd, HWND_DESKTOP, &rc); pt.x = rc.left + (rc.right - rc.left) / 2; pt.y = rc.top + (rc.bottom - rc.top) / 2; } uih::Menu menu; menu.append_command(L"&Copy", ID_COPY); menu.append_separator(); menu.append_command(L"&Clear", ID_CLEAR); menu.append_separator(); uih::Menu edge_style_submenu; edge_style_submenu.append_command( L"&None", ID_EDGE_STYLE_NONE, m_edge_style == EdgeStyle::None ? uih::Menu::flag_radiochecked : 0); edge_style_submenu.append_command( L"&Sunken", ID_EDGE_STYLE_SUNKEN, m_edge_style == EdgeStyle::Sunken ? uih::Menu::flag_radiochecked : 0); edge_style_submenu.append_command( L"&Grey", ID_EDGE_STYLE_GREY, m_edge_style == EdgeStyle::Grey ? uih::Menu::flag_radiochecked : 0); menu.append_submenu(L"&Edge style", edge_style_submenu.detach()); menu.append_command(L"&Hide trailing newline", ID_HIDE_TRAILING_NEWLINE, m_hide_trailing_newline ? uih::Menu::flag_checked : 0); const auto cmd = menu.run(wnd, pt); switch (cmd) { case ID_COPY: copy(); break; case ID_CLEAR: s_clear(); break; case ID_EDGE_STYLE_NONE: set_edge_style(EdgeStyle::None); break; case ID_EDGE_STYLE_SUNKEN: set_edge_style(EdgeStyle::Sunken); break; case ID_EDGE_STYLE_GREY: set_edge_style(EdgeStyle::Grey); break; case ID_HIDE_TRAILING_NEWLINE: set_hide_trailing_newline(!m_hide_trailing_newline); break; } return 0; } break; } return CallWindowProc(m_editproc, wnd, msg, wp, lp); } void ConsoleWindow::set_window_theme() const { if (!m_wnd_edit) return; SetWindowTheme(m_wnd_edit, cui::colours::is_dark_mode_active() ? L"DarkMode_Explorer" : nullptr, nullptr); } static ui_extension::window_factory<ConsoleWindow> console_window_factory; class ConsoleReceiver : public console_receiver { /** * We assume that this function may be called from any thread. * * However, in most callbacks you would want to use, you can assume calls * come from the main thread. * * Check the documentation of the callback to find out if this is true for * the callback you wish to use. */ void print(const char* p_message, size_t p_message_length) override { ConsoleWindow::s_on_message_received(p_message, p_message_length); } }; static service_factory_single_t<ConsoleReceiver> console_console_receiver; class ConsoleFontClient : public cui::fonts::client { public: const GUID& get_client_guid() const override { return console_font_id; } void get_name(pfc::string_base& p_out) const override { p_out = "Console"; } cui::fonts::font_type_t get_default_font_type() const override { return cui::fonts::font_type_labels; } void on_font_changed() const override { ConsoleWindow::s_update_all_fonts(); } }; class ConsoleColourClient : public cui::colours::client { public: const GUID& get_client_guid() const override { return console_colours_client_id; } void get_name(pfc::string_base& p_out) const override { p_out = "Console"; } uint32_t get_supported_colours() const override { return cui::colours::colour_flag_background | cui::colours::colour_flag_text; } uint32_t get_supported_bools() const override { return cui::colours::bool_flag_dark_mode_enabled; } bool get_themes_supported() const override { return false; } void on_bool_changed(uint32_t mask) const override { if (mask & cui::colours::bool_flag_dark_mode_enabled) { ConsoleWindow::s_update_window_themes(); } } void on_colour_changed(uint32_t mask) const override { ConsoleWindow::s_update_colours(); } }; static ConsoleFontClient::factory<ConsoleFontClient> console_font_client; static ConsoleColourClient::factory<ConsoleColourClient> console_colour_client;
33.633282
120
0.644997
[ "vector" ]
e71e64fe012d4496935047cbbe9e71dea01efe1d
9,761
hpp
C++
include/UnityEngine/Profiling/Memory/Experimental/MemoryProfiler.hpp
RedBrumbler/virtuoso-codegen
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
[ "Unlicense" ]
null
null
null
include/UnityEngine/Profiling/Memory/Experimental/MemoryProfiler.hpp
RedBrumbler/virtuoso-codegen
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
[ "Unlicense" ]
null
null
null
include/UnityEngine/Profiling/Memory/Experimental/MemoryProfiler.hpp
RedBrumbler/virtuoso-codegen
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
[ "Unlicense" ]
null
null
null
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" #include "beatsaber-hook/shared/utils/byref.hpp" // Including type: UnityEngine.Profiling.Experimental.DebugScreenCapture #include "UnityEngine/Profiling/Experimental/DebugScreenCapture.hpp" #include "beatsaber-hook/shared/utils/typedefs-array.hpp" #include "beatsaber-hook/shared/utils/typedefs-string.hpp" // Completed includes // Begin forward declares // Forward declaring namespace: System namespace System { // Forward declaring type: Action`2<T1, T2> template<typename T1, typename T2> class Action_2; // Forward declaring type: Action`3<T1, T2, T3> template<typename T1, typename T2, typename T3> class Action_3; // Forward declaring type: Action`1<T> template<typename T> class Action_1; // Forward declaring type: IntPtr struct IntPtr; } // Forward declaring namespace: UnityEngine::Profiling::Memory::Experimental namespace UnityEngine::Profiling::Memory::Experimental { // Forward declaring type: MetaData class MetaData; } // Forward declaring namespace: UnityEngine namespace UnityEngine { // Skipping declaration: TextureFormat because it is already included! } // Completed forward declares // Type namespace: UnityEngine.Profiling.Memory.Experimental namespace UnityEngine::Profiling::Memory::Experimental { // Forward declaring type: MemoryProfiler class MemoryProfiler; } #include "beatsaber-hook/shared/utils/il2cpp-type-check.hpp" NEED_NO_BOX(::UnityEngine::Profiling::Memory::Experimental::MemoryProfiler); DEFINE_IL2CPP_ARG_TYPE(::UnityEngine::Profiling::Memory::Experimental::MemoryProfiler*, "UnityEngine.Profiling.Memory.Experimental", "MemoryProfiler"); // Type namespace: UnityEngine.Profiling.Memory.Experimental namespace UnityEngine::Profiling::Memory::Experimental { // Size: 0x10 #pragma pack(push, 1) // Autogenerated type: UnityEngine.Profiling.Memory.Experimental.MemoryProfiler // [TokenAttribute] Offset: FFFFFFFF // [NativeHeaderAttribute] Offset: 567DE0 class MemoryProfiler : public ::Il2CppObject { public: // [DebuggerBrowsableAttribute] Offset: 0x56B6AC // Get static field: static private System.Action`2<System.String,System.Boolean> m_SnapshotFinished static ::System::Action_2<::StringW, bool>* _get_m_SnapshotFinished(); // Set static field: static private System.Action`2<System.String,System.Boolean> m_SnapshotFinished static void _set_m_SnapshotFinished(::System::Action_2<::StringW, bool>* value); // [DebuggerBrowsableAttribute] Offset: 0x56B6E8 // Get static field: static private System.Action`3<System.String,System.Boolean,UnityEngine.Profiling.Experimental.DebugScreenCapture> m_SaveScreenshotToDisk static ::System::Action_3<::StringW, bool, ::UnityEngine::Profiling::Experimental::DebugScreenCapture>* _get_m_SaveScreenshotToDisk(); // Set static field: static private System.Action`3<System.String,System.Boolean,UnityEngine.Profiling.Experimental.DebugScreenCapture> m_SaveScreenshotToDisk static void _set_m_SaveScreenshotToDisk(::System::Action_3<::StringW, bool, ::UnityEngine::Profiling::Experimental::DebugScreenCapture>* value); // [DebuggerBrowsableAttribute] Offset: 0x56B724 // Get static field: static private System.Action`1<UnityEngine.Profiling.Memory.Experimental.MetaData> createMetaData static ::System::Action_1<::UnityEngine::Profiling::Memory::Experimental::MetaData*>* _get_createMetaData(); // Set static field: static private System.Action`1<UnityEngine.Profiling.Memory.Experimental.MetaData> createMetaData static void _set_createMetaData(::System::Action_1<::UnityEngine::Profiling::Memory::Experimental::MetaData*>* value); // static private System.Byte[] PrepareMetadata() // Offset: 0x9C6E30 static ::ArrayW<uint8_t> PrepareMetadata(); // static System.Int32 WriteIntToByteArray(System.Byte[] array, System.Int32 offset, System.Int32 value) // Offset: 0x9C6FCC static int WriteIntToByteArray(::ArrayW<uint8_t> array, int offset, int value); // static System.Int32 WriteStringToByteArray(System.Byte[] array, System.Int32 offset, System.String value) // Offset: 0x9C706C static int WriteStringToByteArray(::ArrayW<uint8_t> array, int offset, ::StringW value); // static private System.Void FinalizeSnapshot(System.String path, System.Boolean result) // Offset: 0x9C7114 static void FinalizeSnapshot(::StringW path, bool result); // static private System.Void SaveScreenshotToDisk(System.String path, System.Boolean result, System.IntPtr pixelsPtr, System.Int32 pixelsCount, UnityEngine.TextureFormat format, System.Int32 width, System.Int32 height) // Offset: 0x9C71A8 static void SaveScreenshotToDisk(::StringW path, bool result, ::System::IntPtr pixelsPtr, int pixelsCount, ::UnityEngine::TextureFormat format, int width, int height); }; // UnityEngine.Profiling.Memory.Experimental.MemoryProfiler #pragma pack(pop) } #include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" // Writing MetadataGetter for method: UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::PrepareMetadata // Il2CppName: PrepareMetadata template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::ArrayW<uint8_t> (*)()>(&UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::PrepareMetadata)> { static const MethodInfo* get() { return ::il2cpp_utils::FindMethod(classof(UnityEngine::Profiling::Memory::Experimental::MemoryProfiler*), "PrepareMetadata", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{}); } }; // Writing MetadataGetter for method: UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::WriteIntToByteArray // Il2CppName: WriteIntToByteArray template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<int (*)(::ArrayW<uint8_t>, int, int)>(&UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::WriteIntToByteArray)> { static const MethodInfo* get() { static auto* array = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Byte"), 1)->byval_arg; static auto* offset = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg; static auto* value = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg; return ::il2cpp_utils::FindMethod(classof(UnityEngine::Profiling::Memory::Experimental::MemoryProfiler*), "WriteIntToByteArray", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{array, offset, value}); } }; // Writing MetadataGetter for method: UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::WriteStringToByteArray // Il2CppName: WriteStringToByteArray template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<int (*)(::ArrayW<uint8_t>, int, ::StringW)>(&UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::WriteStringToByteArray)> { static const MethodInfo* get() { static auto* array = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Byte"), 1)->byval_arg; static auto* offset = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg; static auto* value = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg; return ::il2cpp_utils::FindMethod(classof(UnityEngine::Profiling::Memory::Experimental::MemoryProfiler*), "WriteStringToByteArray", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{array, offset, value}); } }; // Writing MetadataGetter for method: UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::FinalizeSnapshot // Il2CppName: FinalizeSnapshot template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::StringW, bool)>(&UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::FinalizeSnapshot)> { static const MethodInfo* get() { static auto* path = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg; static auto* result = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg; return ::il2cpp_utils::FindMethod(classof(UnityEngine::Profiling::Memory::Experimental::MemoryProfiler*), "FinalizeSnapshot", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{path, result}); } }; // Writing MetadataGetter for method: UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::SaveScreenshotToDisk // Il2CppName: SaveScreenshotToDisk template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)(::StringW, bool, ::System::IntPtr, int, ::UnityEngine::TextureFormat, int, int)>(&UnityEngine::Profiling::Memory::Experimental::MemoryProfiler::SaveScreenshotToDisk)> { static const MethodInfo* get() { static auto* path = &::il2cpp_utils::GetClassFromName("System", "String")->byval_arg; static auto* result = &::il2cpp_utils::GetClassFromName("System", "Boolean")->byval_arg; static auto* pixelsPtr = &::il2cpp_utils::GetClassFromName("System", "IntPtr")->byval_arg; static auto* pixelsCount = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg; static auto* format = &::il2cpp_utils::GetClassFromName("UnityEngine", "TextureFormat")->byval_arg; static auto* width = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg; static auto* height = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg; return ::il2cpp_utils::FindMethod(classof(UnityEngine::Profiling::Memory::Experimental::MemoryProfiler*), "SaveScreenshotToDisk", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{path, result, pixelsPtr, pixelsCount, format, width, height}); } };
67.784722
258
0.760885
[ "vector" ]
e7252286940bd8f41915d51673d4b1e42f213a61
12,042
cpp
C++
openstudiocore/src/utilities/units/Quantity.cpp
BIMDataHub/OpenStudio-1
13ec115b00aa6a2af1426ceb26446f05014c8c8d
[ "blessing" ]
4
2015-05-02T21:04:15.000Z
2015-10-28T09:47:22.000Z
openstudiocore/src/utilities/units/Quantity.cpp
BIMDataHub/OpenStudio-1
13ec115b00aa6a2af1426ceb26446f05014c8c8d
[ "blessing" ]
null
null
null
openstudiocore/src/utilities/units/Quantity.cpp
BIMDataHub/OpenStudio-1
13ec115b00aa6a2af1426ceb26446f05014c8c8d
[ "blessing" ]
1
2020-11-12T21:52:36.000Z
2020-11-12T21:52:36.000Z
/********************************************************************** * Copyright (c) 2008-2015, Alliance for Sustainable Energy. * All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA **********************************************************************/ #include "Quantity.hpp" #include "UnitFactory.hpp" #include "ScaleFactory.hpp" #include "IPUnit.hpp" #include "IPUnit_Impl.hpp" #include "TemperatureUnit.hpp" #include "TemperatureUnit_Impl.hpp" #include "../math/FloatCompare.hpp" #include "../core/Assert.hpp" #include <cmath> int _QuantityType = qRegisterMetaType<openstudio::Quantity>("openstudio::Quantity"); namespace openstudio{ Quantity::Quantity(const UnitSystem& system) : m_value(0.0), m_units(createDimensionlessUnit(system)) {} Quantity::Quantity(double value, const UnitSystem& system) : m_value(value), m_units(createDimensionlessUnit(system)) {} Quantity::Quantity(double value,const Unit& units) : m_value(value), m_units(units.clone()) {} Quantity::Quantity(const Quantity &q) : m_value(q.value()), m_units(q.units()) {} Quantity& Quantity::operator=(const Quantity& q) { if (this == &q) { return *this; } m_value = q.value(); m_units = q.units(); return *this; } double Quantity::value() const { return m_value; } void Quantity::setValue(double newValue) { m_value = newValue; } Unit Quantity::units() const { return m_units.clone(); } UnitSystem Quantity::system() const { return m_units.system(); } bool Quantity::isTemperature() const { return m_units.optionalCast<TemperatureUnit>(); } std::vector<std::string> Quantity::baseUnits() const { return m_units.baseUnits(); } int Quantity::baseUnitExponent(const std::string& baseUnit) const { return m_units.baseUnitExponent(baseUnit); } void Quantity::setBaseUnitExponent( const std::string& baseUnit, int exponent) { m_units.setBaseUnitExponent( baseUnit, exponent ); } std::string Quantity::standardUnitsString(bool withScale) const { return m_units.standardString(withScale); } std::string Quantity::prettyUnitsString(bool withScale) const { return m_units.prettyString(withScale); } void Quantity::setPrettyUnitsString( const std::string& str ) { return m_units.setPrettyString( str ); } const Scale& Quantity::scale() const { return m_units.scale(); } bool Quantity::setScale(int scaleExponent) { ScaleConstant candidate = ScaleFactory::instance().createScale(scaleExponent); double candidateValue = candidate().value; if (candidateValue == 0.0) { return false; } m_value = m_value * (scale().value / candidateValue); bool ok = m_units.setScale(scaleExponent); OS_ASSERT(ok); return true; } bool Quantity::setScale(const std::string& scaleAbbreviation) { ScaleConstant candidate = ScaleFactory::instance().createScale(scaleAbbreviation); double candidateValue = candidate().value; if (candidateValue == 0.0) { return false; } m_value = m_value * (scale().value / candidateValue); bool ok = m_units.setScale(scaleAbbreviation); OS_ASSERT(ok); return true; } bool Quantity::isAbsolute() const { OptionalTemperatureUnit tu = m_units.optionalCast<TemperatureUnit>(); if(!tu) { LOG_AND_THROW("Could not evaluate Quantity::isAbsolute for quantity " << *this << " because it is in system " << system().valueName() << ", not Celsius or Fahrenheit."); } return tu->isAbsolute(); } bool Quantity::isRelative() const { return !isAbsolute(); } void Quantity::setAsAbsolute() { OptionalTemperatureUnit tu = m_units.optionalCast<TemperatureUnit>(); if(!tu) { LOG_AND_THROW("Could not Quantity::setAsAbsolute for quantity " << *this << " because it is in system " << system().valueName() << ", not Celsius or Fahrenheit."); } tu->setAsAbsolute(); } void Quantity::setAsRelative() { OptionalTemperatureUnit tu = m_units.optionalCast<TemperatureUnit>(); if(!tu) { LOG_AND_THROW("Could not Quantity::setAsRelative for quantity " << *this << " because it is in system " << system().valueName() << ", not Celsius or Fahrenheit."); } tu->setAsRelative(); } void Quantity::lbmToLbf() { OptionalIPUnit iu = m_units.optionalCast<IPUnit>(); if(!iu) { LOG_AND_THROW("Cannot convert non-IP quantity " << *this << " in system " << system().valueName() << " from pound-mass to pound-force."); } // convert from (value * lb_m^x * ...) to (value * lb_f^x * ...) // lb_m^x * (1/gc)^x = lb_f^x * s^{2x} / ft^x int x = baseUnitExponent("lb_m"); if (x != 0) { iu->lbmToLbf(); m_value /= std::pow(IPUnit::gc(),x); } OS_ASSERT(baseUnitExponent("lb_m") == 0); } void Quantity::lbfToLbm() { OptionalIPUnit iu = m_units.optionalCast<IPUnit>(); if(!iu) { LOG_AND_THROW("Cannot convert non-IP quantity " << *this << " in system " << system().valueName() << " from pound-force to pound-mass."); } // convert from (value * lb_f^x * ...) to (value * lb_m^x * ...) // lb_f^x * gc^x = lb_m^x * ft^x / s^{2x} int x = baseUnitExponent("lb_f"); if (x != 0) { iu->lbfToLbm(); m_value *= std::pow(IPUnit::gc(),x); } OS_ASSERT(baseUnitExponent("lb_f") == 0); } Quantity& Quantity::operator+=(const Quantity& rQuantity) { if (this == &rQuantity) { m_value *= 2.0; return *this; } if (m_units != rQuantity.m_units) { LOG_AND_THROW("Cannot add quantities with different units."); } if (scale() != rQuantity.scale()) { Quantity wRQuantity(rQuantity); wRQuantity.setScale(scale().exponent); m_value += wRQuantity.value(); } else { m_value += rQuantity.value(); } if (isTemperature() && rQuantity.isTemperature()) { if (!isAbsolute() && rQuantity.isAbsolute()) { setAsAbsolute(); } } return *this; } Quantity& Quantity::operator-=(const Quantity& rQuantity) { if (this == &rQuantity) { m_value = 0.0; return *this; } if (m_units != rQuantity.m_units) { LOG_AND_THROW("Cannot subtract quantities with different units."); } if (scale() != rQuantity.scale()) { Quantity wRQuantity(rQuantity); wRQuantity.setScale(scale().exponent); m_value -= wRQuantity.value(); } else { m_value -= rQuantity.value(); } if (isTemperature() && rQuantity.isTemperature()) { if (isAbsolute() && rQuantity.isAbsolute()) { // units must be the same, check that exponent on this is 1 std::vector<std::string> bus = baseUnits(); assert(bus.size() == 1); if (baseUnitExponent(bus[0]) == 1) { setAsRelative(); } } else if (!isAbsolute() && rQuantity.isAbsolute()) { setAsAbsolute(); } } return *this; } Quantity& Quantity::operator*=(const Quantity& rQuantity) { ScaleOpReturnType resultScale; if (this == &rQuantity) { m_value = std::pow(m_value,2); m_units.pow(2); resultScale = openstudio::pow(scale(),2); } else { // unit *= will throw if m_units is not base-class and rQuantity.m_units is different system if ((system() != rQuantity.system()) && (system() != UnitSystem::Mixed)) { m_units = m_units.cloneToMixed(); } // ETH@20100517 ugly workaround for temperature units OptionalTemperatureUnit tu1 = m_units.optionalCast<TemperatureUnit>(); OptionalTemperatureUnit tu2 = rQuantity.m_units.optionalCast<TemperatureUnit>(); if (tu1 && tu2) { *tu1 *= *tu2; } else { m_units *= rQuantity.m_units; } m_value *= rQuantity.value(); resultScale = scale()*rQuantity.scale(); } m_value *= resultScale.second; return *this; } Quantity& Quantity::operator/=(const Quantity& rQuantity) { if (this == &rQuantity) { // result = 1 m_units /= m_units; m_value = 1.0; } else { // unit /= will throw if m_units is not base-class and rQuantity.m_units is different system if ((system() != rQuantity.system()) && (system() != UnitSystem::Mixed)) { m_units = m_units.cloneToMixed(); } // ETH@20100517 ugly workaround for temperature units OptionalTemperatureUnit tu1 = m_units.optionalCast<TemperatureUnit>(); OptionalTemperatureUnit tu2 = rQuantity.m_units.optionalCast<TemperatureUnit>(); if (tu1 && tu2) { *tu1 /= *tu2; } else { m_units /= rQuantity.m_units; } m_value /= rQuantity.value(); ScaleOpReturnType resultScale = scale()/rQuantity.scale(); m_value *= resultScale.second; } return *this; } Quantity& Quantity::operator*=(double d) { m_value *= d; return *this; } Quantity& Quantity::operator/=(double d) { m_value /= d; return *this; } Quantity& Quantity::pow(int expNum,int expDenom) { // try unit first--may throw m_units.pow(expNum,expDenom); ScaleOpReturnType resultScale = openstudio::pow(scale(),expNum,expDenom); m_value = std::pow(m_value,double(expNum)/double(expDenom)); m_value = m_value*resultScale.second; return *this; } std::ostream& operator<<(std::ostream& os,const Quantity& q) { os << q.value(); std::stringstream unitString; unitString << q.m_units; if (unitString.str() != "") { os << " " << unitString.str(); } return os; } Quantity operator-(const Quantity& rQuantity) { Quantity result(rQuantity); result.setValue(-result.value()); return result; } Quantity operator+(const Quantity& lQuantity,const Quantity& rQuantity) { Quantity result(lQuantity); result += rQuantity; return result; } Quantity operator-(const Quantity& lQuantity,const Quantity& rQuantity) { Quantity result(lQuantity); result -= rQuantity; return result; } Quantity operator*(const Quantity& lQuantity,const Quantity& rQuantity) { Quantity result(lQuantity); result *= rQuantity; return result; } Quantity operator/(const Quantity& lQuantity,const Quantity& rQuantity) { Quantity result(lQuantity); result /= rQuantity; return result; } Quantity pow(const Quantity& rQuantity,int expNum,int expDenom) { Quantity result(rQuantity); result.pow(expNum,expDenom); return result; } Quantity operator*(const Quantity& lQuantity,double d) { Quantity result(lQuantity); result *= d; return result; } Quantity operator*(double d,const Quantity& rQuantity) { return rQuantity*d; } Quantity operator/(const Quantity& lQuantity,double d) { Quantity result(lQuantity); result /= d; return result; } Quantity operator/(double d,const Quantity& rQuantity) { Quantity result(d,rQuantity.system()); result /= rQuantity; return result; } bool operator==(const Quantity& lQuantity,const Quantity& rQuantity) { if ((lQuantity.system() == rQuantity.system()) && (lQuantity.units() == rQuantity.units())) { Quantity wl(lQuantity), wr(rQuantity); wl.setScale(0); wr.setScale(0); return equal(wl.value(),wr.value()); } return false; } bool operator!=(const Quantity& lQuantity,const Quantity& rQuantity) { return !(lQuantity == rQuantity); } } // openstudio
27.939675
99
0.644328
[ "vector" ]
e725cf08874fcf50125aeabc89106d17ff586c51
2,490
cpp
C++
201703-3.cpp
ZubinGou/CCF-CSP
6d8b8de66c4ffc6c058efdf021e3a546fccdea44
[ "MIT" ]
null
null
null
201703-3.cpp
ZubinGou/CCF-CSP
6d8b8de66c4ffc6c058efdf021e3a546fccdea44
[ "MIT" ]
null
null
null
201703-3.cpp
ZubinGou/CCF-CSP
6d8b8de66c4ffc6c058efdf021e3a546fccdea44
[ "MIT" ]
null
null
null
// #include <bits/stdc++.h> #include <iostream> #include <vector> #include <string> #include <unordered_map> #include <queue> #include <list> #include <climits> #include <algorithm> using namespace std; /* 1. 解析区块,区块内部解析行内 2. 行内替换强调 `_` 奇偶分别为<em>, </em> 3. parse_url */ string parse_inline(string str) { string res; // deal with _ int odd = 1; for (auto c : str) { if (c == '_') { res += (odd ? "<em>" : "</em>"); odd = 1 - odd; } else res.push_back(c); } // deal with link string res_link; for (int i = 0; i < res.size(); i++) { if (res[i] == '[') { string text, link; i++; for (; i < res.size() && res[i] != ']'; i++) { text.push_back(res[i]); } i += 2; // jump over ] ( for (; i < res.size() && res[i] != ')'; i++) { link.push_back(res[i]); } res_link += "<a href=\"" + link + "\">" + text + "</a>"; } else res_link.push_back(res[i]); } return res_link; } string ltrim(string str) { size_t found = str.find_first_not_of(" "); return str.substr(found); } int main() { // freopen("201703-3.test", "r", stdin); ios::sync_with_stdio(false); string line; while (getline(cin, line)) { if (line.empty()) continue; if (line[0] == '#') { size_t found = line.find_first_not_of("#"); string level = to_string(found); // while (line[found] == ' ') found++; string res = "<h" + level + ">" + ltrim(line.substr(found)) + "</h" + level + ">"; res = parse_inline(res); cout << res << endl; } else if (line[0] == '*') { cout << "<ul>" << endl; cout << "<li>" << parse_inline(ltrim(line.substr(2))) << "</li>" << endl; while (getline(cin, line)) { if (line.empty()) break; else cout << "<li>" << parse_inline(ltrim(line.substr(2))) << "</li>" << endl; } cout << "</ul>" << endl; } else { cout << "<p>" + parse_inline(line); while (getline(cin, line)) { if (line.empty()) break; else cout << endl << parse_inline(line); } cout << "</p>" << endl; } } return 0; }
27.362637
94
0.429317
[ "vector" ]
e7279b840a419a248acc9a4478ab6e31ccf940c8
10,596
cpp
C++
modules/base/rendering/renderablenodeline.cpp
scivis-exhibitions/OpenSpace
5b69cf45f110354ecf3bdbcee8cf9d2c75b07e9e
[ "MIT" ]
489
2015-07-14T22:23:10.000Z
2022-03-30T07:59:47.000Z
modules/base/rendering/renderablenodeline.cpp
scivis-exhibitions/OpenSpace
5b69cf45f110354ecf3bdbcee8cf9d2c75b07e9e
[ "MIT" ]
1,575
2016-07-12T18:10:22.000Z
2022-03-31T20:12:55.000Z
modules/base/rendering/renderablenodeline.cpp
scivis-exhibitions/OpenSpace
5b69cf45f110354ecf3bdbcee8cf9d2c75b07e9e
[ "MIT" ]
101
2016-03-01T02:22:01.000Z
2022-02-25T15:36:27.000Z
/***************************************************************************************** * * * OpenSpace * * * * Copyright (c) 2014-2021 * * * * 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 <modules/base/rendering/renderablenodeline.h> #include <modules/base/basemodule.h> #include <openspace/documentation/verifier.h> #include <openspace/engine/globals.h> #include <openspace/navigation/navigationhandler.h> #include <openspace/navigation/orbitalnavigator.h> #include <openspace/rendering/renderengine.h> #include <openspace/scene/scene.h> #include <openspace/scene/translation.h> #include <openspace/util/updatestructures.h> #include <ghoul/filesystem/filesystem.h> #include <ghoul/logging/logmanager.h> #include <ghoul/opengl/openglstatecache.h> #include <ghoul/opengl/programobject.h> namespace { constexpr const char* _loggerCat = "RenderableNodeLine"; constexpr const char* ProgramName = "NodeLineProgram"; constexpr const char* Root = "Root"; constexpr openspace::properties::Property::PropertyInfo StartNodeInfo = { "StartNode", "Start Node", "The identifier of the node the line starts from. " "Defaults to 'Root' if not specified. " }; constexpr openspace::properties::Property::PropertyInfo EndNodeInfo = { "EndNode", "End Node", "The identifier of the node the line ends at. " "Defaults to 'Root' if not specified. " }; constexpr openspace::properties::Property::PropertyInfo LineColorInfo = { "Color", "Color", "This value determines the RGB color for the line." }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", "This value specifies the line width." }; // Returns a position that is relative to the current anchor node. This is a method to // handle precision problems that occur when approaching a line end point glm::dvec3 coordinatePosFromAnchorNode(const glm::dvec3& worldPos) { using namespace openspace; glm::dvec3 anchorNodePos(0.0); const interaction::OrbitalNavigator& nav = global::navigationHandler->orbitalNavigator(); if (nav.anchorNode()) { anchorNodePos = nav.anchorNode()->worldPosition(); } glm::dvec3 diffPos = worldPos - anchorNodePos; return diffPos; } struct [[codegen::Dictionary(RenderableNodeLine)]] Parameters { // [[codegen::verbatim(StartNodeInfo.description)]] std::optional<std::string> startNode; // [[codegen::verbatim(EndNodeInfo.description)]] std::optional<std::string> endNode; // [[codegen::verbatim(LineColorInfo.description)]] std::optional<glm::vec3> color [[codegen::color()]]; // [[codegen::verbatim(LineWidthInfo.description)]] std::optional<float> lineWidth; }; #include "renderablenodeline_codegen.cpp" } // namespace namespace openspace { documentation::Documentation RenderableNodeLine::Documentation() { return codegen::doc<Parameters>("base_renderable_renderablenodeline"); } RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _start(StartNodeInfo, Root) , _end(EndNodeInfo, Root) , _lineColor(LineColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _lineWidth(LineWidthInfo, 2.f, 1.f, 20.f) { const Parameters p = codegen::bake<Parameters>(dictionary); _start = p.startNode.value_or(_start); _start.onChange([&]() { validateNodes(); }); addProperty(_start); _end = p.endNode.value_or(_end); _end.onChange([&]() { validateNodes(); }); addProperty(_end); _lineColor = p.color.value_or(_lineColor); _lineColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_lineColor); _lineWidth = p.lineWidth.value_or(_lineWidth); addProperty(_lineWidth); addProperty(_opacity); } double RenderableNodeLine::distance() const { return glm::distance(_startPos, _endPos); } std::string RenderableNodeLine::start() const { return _start; } std::string RenderableNodeLine::end() const { return _end; } void RenderableNodeLine::initializeGL() { _program = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr<ghoul::opengl::ProgramObject> { return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/line_vs.glsl"), absPath("${MODULE_BASE}/shaders/line_fs.glsl") ); } ); // Generate glGenVertexArrays(1, &_vaoId); glGenBuffers(1, &_vBufferId); bindGL(); glVertexAttribPointer(_locVertex, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), nullptr); glEnableVertexAttribArray(_locVertex); unbindGL(); } void RenderableNodeLine::deinitializeGL() { glDeleteVertexArrays(1, &_vaoId); _vaoId = 0; glDeleteBuffers(1, &_vBufferId); _vBufferId = 0; BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { global::renderEngine->removeRenderProgram(p); } ); _program = nullptr; } bool RenderableNodeLine::isReady() const { bool ready = true; ready &= (_program != nullptr); return ready; } void RenderableNodeLine::unbindGL() { glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); } void RenderableNodeLine::bindGL() { glBindVertexArray(_vaoId); glBindBuffer(GL_ARRAY_BUFFER, _vBufferId); } void RenderableNodeLine::updateVertexData() { _vertexArray.clear(); // Update the positions of the nodes _startPos = coordinatePosFromAnchorNode( global::renderEngine->scene()->sceneGraphNode(_start)->worldPosition() ); _endPos = coordinatePosFromAnchorNode( global::renderEngine->scene()->sceneGraphNode(_end)->worldPosition() ); _vertexArray.push_back(static_cast<float>(_startPos.x)); _vertexArray.push_back(static_cast<float>(_startPos.y)); _vertexArray.push_back(static_cast<float>(_startPos.z)); _vertexArray.push_back(static_cast<float>(_endPos.x)); _vertexArray.push_back(static_cast<float>(_endPos.y)); _vertexArray.push_back(static_cast<float>(_endPos.z)); bindGL(); glBufferData( GL_ARRAY_BUFFER, _vertexArray.size() * sizeof(float), _vertexArray.data(), GL_DYNAMIC_DRAW ); // update vertex attributes glVertexAttribPointer(_locVertex, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), nullptr); unbindGL(); } void RenderableNodeLine::render(const RenderData& data, RendererTasks&) { updateVertexData(); _program->activate(); glm::dmat4 anchorTranslation(1.0); // Update anchor node information, used to counter precision problems if (global::navigationHandler->orbitalNavigator().anchorNode()) { anchorTranslation = glm::translate( glm::dmat4(1.0), global::navigationHandler->orbitalNavigator().anchorNode()->worldPosition() ); } const glm::dmat4 modelTransform = glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * glm::dmat4(data.modelTransform.rotation) * glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)); const glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform * anchorTranslation; _program->setUniform("modelViewTransform", glm::mat4(modelViewTransform)); _program->setUniform("projectionTransform", data.camera.projectionMatrix()); _program->setUniform("color", glm::vec4(_lineColor.value(), _opacity)); // Change GL state: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnablei(GL_BLEND, 0); glEnable(GL_LINE_SMOOTH); glLineWidth(_lineWidth); // Bind and draw bindGL(); glDrawArrays(GL_LINES, 0, 2); // Restore GL State unbindGL(); _program->deactivate(); global::renderEngine->openglStateCache().resetBlendState(); global::renderEngine->openglStateCache().resetLineState(); } void RenderableNodeLine::validateNodes() { if (!global::renderEngine->scene()->sceneGraphNode(_start)) { LERROR(fmt::format( "There is no scenegraph node with id {}, defaults to 'Root'", _start )); _start = Root; } if (!global::renderEngine->scene()->sceneGraphNode(_end)) { LERROR(fmt::format( "There is no scenegraph node with id {}, defaults to 'Root'", _end )); _end = Root; } } } // namespace openspace
35.676768
90
0.621933
[ "render" ]
e72b2ebaae11ea9303b5c94e7bb393d298eb6332
1,908
cpp
C++
examples/00-FeedForward/main.cpp
ppff/ENNlib
5440452203929c6063f226924eb86d6dfab2a685
[ "WTFPL" ]
2
2015-10-31T20:04:09.000Z
2016-07-03T09:30:01.000Z
examples/00-FeedForward/main.cpp
ppff/ENNlib
5440452203929c6063f226924eb86d6dfab2a685
[ "WTFPL" ]
null
null
null
examples/00-FeedForward/main.cpp
ppff/ENNlib
5440452203929c6063f226924eb86d6dfab2a685
[ "WTFPL" ]
null
null
null
#include <iostream> #include <vector> #include "enn.hpp" int main() { std::cout << "ENNlib example n0 : initiation to neural networks." << std::endl; std::cout << "We will create a very simple neural network (2 inputs connected to 1 output) and try computing some values." << std::endl; std::cout << "It is called a feed forward neural network because there are no cycles in the network." << std::endl; //Create the network std::cout << std::endl; std::cout << "Let's create a network with 2 input neurons connected to 1 output neurons with the following weights: 0.4 and 0.6." << std::endl; ENN::NeuralNetwork nn; nn.addLayer(2); //2 input neurons. nn.addLayer(1); //1 output neuron. nn.connect(0, 0, 1, 0); //Connect input0 to output nn.connect(0, 1, 1, 0); //Connect input1 to output //Set weights nn.setConnectionWeight(0, 0, 1, 0, 0.4); nn.setConnectionWeight(0, 1, 1, 0, 0.6); //Print the network std::cout << "The neural network's formula (as returned by the network) is: " << nn.toString() << " (should be tanh(0.4*x0 + 0.6*x1))." << std::endl; //Process some values std::cout << std::endl; std::cout << "Let's now make the NN compute some values and compare them to what we should get with our function." << std::endl; std::vector<ENN::LearningVector> values { {0.1, 0.5}, {0.2, 0.9}, {1.5, -0.5} }; for (ENN::LearningVector & pairOfInputs : values) { ENN::LearningVector results = nn.process(pairOfInputs); float expectedResult = tanh(0.4*pairOfInputs[0] + 0.6*pairOfInputs[1]); std::cout << "Input (" << pairOfInputs[0] << ", " << pairOfInputs[1] << ") => output " << results[0] << " (should be " << expectedResult << " -- difference: " << expectedResult - results[0] << ")." << std::endl; } std::cout << "If the differences aren't null (or very close to 0), you might want to burn your PC right now." << std::endl; return EXIT_SUCCESS; }
40.595745
213
0.65304
[ "vector" ]
e72cab6670833920c3af129975386fd44f2507e0
8,267
cpp
C++
inference-engine/tests_deprecated/unit/engines/mkldnn/test_layers.cpp
JOCh1958/openvino
070201feeec5550b7cf8ec5a0ffd72dc879750be
[ "Apache-2.0" ]
1
2021-04-06T03:32:12.000Z
2021-04-06T03:32:12.000Z
inference-engine/tests_deprecated/unit/engines/mkldnn/test_layers.cpp
JOCh1958/openvino
070201feeec5550b7cf8ec5a0ffd72dc879750be
[ "Apache-2.0" ]
28
2021-09-24T09:29:02.000Z
2022-03-28T13:20:46.000Z
inference-engine/tests_deprecated/unit/engines/mkldnn/test_layers.cpp
JOCh1958/openvino
070201feeec5550b7cf8ec5a0ffd72dc879750be
[ "Apache-2.0" ]
1
2020-08-30T11:48:03.000Z
2020-08-30T11:48:03.000Z
// Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // //#include <gtest/gtest.h> //#include "mkldnn_layers.h" // //using namespace std; // //class MKLDNNLayersTests : public ::testing::Test { //protected: // virtual void TearDown() override{ // } // // virtual void SetUp() override{ // } // //}; // //TEST_F(MKLDNNLayersTests, canCreateContext) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> dl ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreateConvLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // InferenceEngine::TBlob<float>::Ptr blobPtr(new InferenceEngine::TBlob<float>()); // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context(blobPtr, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::ConvolutionLayer convLayer({}); // InferenceEngine::DataPtr dPtr(new InferenceEngine::Data("testData")); // dPtr->dims = {0, 0, 0, 0}; // // convLayer.insData.push_back(dPtr); // convLayer.outData.push_back(dPtr); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&convLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::ConvLayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreateLRNLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::NormLayer normLayer({}); // InferenceEngine::DataPtr dPtr(new InferenceEngine::Data("testData")); // dPtr->dims = {1, 1, 27, 27}; // // normLayer.insData.push_back(dPtr); // normLayer.outData.push_back(dPtr); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&normLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::LRNLayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreatePoolingLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::PoolingLayer poolingLayer({}); // InferenceEngine::DataPtr dPtr(new InferenceEngine::Data("testData")); // dPtr->dims = {1, 1, 27, 27}; // // poolingLayer.insData.push_back(dPtr); // poolingLayer.outData.push_back(dPtr); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&poolingLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::PoolingLayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreateSplitLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::SplitLayer splitLayer({}); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&splitLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::SplitLayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreateConcatLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::ConcatLayer concatLayer({}); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&concatLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::ConcatLayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreateFullyConnectedLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // InferenceEngine::TBlob<float>::Ptr blobPtr(new InferenceEngine::TBlob<float>()); // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context(blobPtr, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::FullyConnectedLayer fcLayer({}); // InferenceEngine::DataPtr dPtr(new InferenceEngine::Data("testData")); // dPtr->dims = {0, 0, 0, 0}; // InferenceEngine::DataPtr dPtr2(new InferenceEngine::Data("testData2")); // dPtr2->dims = {0, 0}; // // fcLayer.insData.push_back(dPtr); // fcLayer.outData.push_back(dPtr2); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&fcLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::FullyConnectedLayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreateSoftMaxLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::SoftMaxLayer softmaxLayer({}); // InferenceEngine::DataPtr dPtr(new InferenceEngine::Data("testData")); // dPtr->dims = {0, 0, 0, 0}; // InferenceEngine::DataPtr dPtr2(new InferenceEngine::Data("testData2")); // dPtr2->dims = {0, 0}; // // softmaxLayer.insData.push_back(dPtr); // softmaxLayer.outData.push_back(dPtr2); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&softmaxLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::SoftMaxLayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canCreateReLULayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::ReLULayer reLULayer({}); // InferenceEngine::DataPtr dPtr(new InferenceEngine::Data("testData")); // dPtr->dims = {1, 1, 27, 27}; // // reLULayer.insData.push_back(dPtr); // reLULayer.outData.push_back(dPtr); // unique_ptr<MKLDNNPlugin::Layer> dl ( MKLDNNPlugin::LayerRegistry::CreateLayer(&reLULayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get()))); // // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::ReLULayer*>(dl.get())); //} // //TEST_F(MKLDNNLayersTests, canNotCreateCNNLayer) { // std::vector<float> sd; // std::vector<float> dd; // std::vector<size_t> ds; // unique_ptr<MKLDNNPlugin::Context> ctx ( new MKLDNNPlugin::Context({}, mkldnn::engine(mkldnn::engine::cpu, 0), &sd, &dd, &ds)); // ASSERT_NE(nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())); // // InferenceEngine::CNNLayer cnnLayer({}); // EXPECT_THROW(MKLDNNPlugin::LayerRegistry::CreateLayer(&cnnLayer, nullptr, dynamic_cast<MKLDNNPlugin::Context*>(ctx.get())) , InferenceEngine::Exception); //} // //TEST_F(MKLDNNLayersTests, canNotCreateLayerWithoutContext) { // InferenceEngine::ConvolutionLayer convLayer({}); // EXPECT_THROW(MKLDNNPlugin::LayerRegistry::CreateLayer(&convLayer, nullptr, nullptr), InferenceEngine::Exception); //}
45.174863
159
0.681747
[ "vector" ]
e72e365751f1743488f775498ab6cb0c472debe4
23,221
cpp
C++
Source/Core/LayoutDetails.cpp
aquawicket/RmlUi
d56f17e49ca2ee88aadeb304228cd1eae14e3f51
[ "MIT" ]
null
null
null
Source/Core/LayoutDetails.cpp
aquawicket/RmlUi
d56f17e49ca2ee88aadeb304228cd1eae14e3f51
[ "MIT" ]
null
null
null
Source/Core/LayoutDetails.cpp
aquawicket/RmlUi
d56f17e49ca2ee88aadeb304228cd1eae14e3f51
[ "MIT" ]
null
null
null
/* * This source file is part of RmlUi, the HTML/CSS Interface Middleware * * For the latest information, see http://github.com/mikke89/RmlUi * * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd * Copyright (c) 2019 The RmlUi Team, and contributors * * 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 "LayoutDetails.h" #include "../../Include/RmlUi/Core/ComputedValues.h" #include "../../Include/RmlUi/Core/Element.h" #include "../../Include/RmlUi/Core/ElementScroll.h" #include "../../Include/RmlUi/Core/Math.h" #include "../../Include/RmlUi/Core/Profiling.h" #include "LayoutEngine.h" #include <float.h> namespace Rml { // Convert width or height of a border box to the width or height of its corresponding content box. static inline float BorderSizeToContentSize(float border_size, float border_padding_edges_size) { if (border_size < 0.0f || border_size == FLT_MAX) return border_size; return Math::Max(0.0f, border_size - border_padding_edges_size); } // Generates the box for an element. void LayoutDetails::BuildBox(Box& box, Vector2f containing_block, Element* element, BoxContext box_context, float override_shrink_to_fit_width) { if (!element) { box.SetContent(containing_block); return; } const ComputedValues& computed = element->GetComputedValues(); // Calculate the padding area. box.SetEdge(Box::PADDING, Box::TOP, Math::Max(0.0f, ResolveValue(computed.padding_top(), containing_block.x))); box.SetEdge(Box::PADDING, Box::RIGHT, Math::Max(0.0f, ResolveValue(computed.padding_right(), containing_block.x))); box.SetEdge(Box::PADDING, Box::BOTTOM, Math::Max(0.0f, ResolveValue(computed.padding_bottom(), containing_block.x))); box.SetEdge(Box::PADDING, Box::LEFT, Math::Max(0.0f, ResolveValue(computed.padding_left(), containing_block.x))); // Calculate the border area. box.SetEdge(Box::BORDER, Box::TOP, Math::Max(0.0f, computed.border_top_width())); box.SetEdge(Box::BORDER, Box::RIGHT, Math::Max(0.0f, computed.border_right_width())); box.SetEdge(Box::BORDER, Box::BOTTOM, Math::Max(0.0f, computed.border_bottom_width())); box.SetEdge(Box::BORDER, Box::LEFT, Math::Max(0.0f, computed.border_left_width())); // Prepare sizing of the content area. Vector2f content_area(-1, -1); Vector2f min_size = Vector2f(0, 0); Vector2f max_size = Vector2f(FLT_MAX, FLT_MAX); // Intrinsic size for replaced elements. Vector2f intrinsic_size(-1, -1); float intrinsic_ratio = -1; const bool replaced_element = element->GetIntrinsicDimensions(intrinsic_size, intrinsic_ratio); // Calculate the content area and constraints. 'auto' width and height are handled later. // For inline non-replaced elements, width and height are ignored, so we can skip the calculations. if (box_context == BoxContext::Block || box_context == BoxContext::FlexOrTable || replaced_element) { if (content_area.x < 0 && computed.width().type != Style::Width::Auto) content_area.x = ResolveValue(computed.width(), containing_block.x); if (content_area.y < 0 && computed.height().type != Style::Width::Auto) content_area.y = ResolveValue(computed.height(), containing_block.y); min_size = Vector2f( ResolveValue(computed.min_width(), containing_block.x), ResolveValue(computed.min_height(), containing_block.y) ); max_size = Vector2f( (computed.max_width().value < 0.f ? FLT_MAX : ResolveValue(computed.max_width(), containing_block.x)), (computed.max_height().value < 0.f ? FLT_MAX : ResolveValue(computed.max_height(), containing_block.y)) ); // Adjust sizes for the given box sizing model. if (computed.box_sizing() == Style::BoxSizing::BorderBox) { const float border_padding_width = box.GetSizeAcross(Box::HORIZONTAL, Box::BORDER, Box::PADDING); const float border_padding_height = box.GetSizeAcross(Box::VERTICAL, Box::BORDER, Box::PADDING); min_size.x = BorderSizeToContentSize(min_size.x, border_padding_width); max_size.x = BorderSizeToContentSize(max_size.x, border_padding_width); content_area.x = BorderSizeToContentSize(content_area.x, border_padding_width); min_size.y = BorderSizeToContentSize(min_size.y, border_padding_height); max_size.y = BorderSizeToContentSize(max_size.y, border_padding_height); content_area.y = BorderSizeToContentSize(content_area.y, border_padding_height); } if (content_area.x >= 0) content_area.x = Math::Clamp(content_area.x, min_size.x, max_size.x); if (content_area.y >= 0) content_area.y = Math::Clamp(content_area.y, min_size.y, max_size.y); if (replaced_element) content_area = CalculateSizeForReplacedElement(content_area, min_size, max_size, intrinsic_size, intrinsic_ratio); } box.SetContent(content_area); // Evaluate the margins, and width and height if they are auto. BuildBoxSizeAndMargins(box, min_size, max_size, containing_block, element, box_context, replaced_element, override_shrink_to_fit_width); } // Generates the box for an element placed in a block box. void LayoutDetails::BuildBox(Box& box, float& min_height, float& max_height, LayoutBlockBox* containing_box, Element* element, BoxContext box_context, float override_shrink_to_fit_width) { Vector2f containing_block = LayoutDetails::GetContainingBlock(containing_box); BuildBox(box, containing_block, element, box_context, override_shrink_to_fit_width); if (element) GetDefiniteMinMaxHeight(min_height, max_height, element->GetComputedValues(), box, containing_block.y); else min_height = max_height = box.GetSize().y; } void LayoutDetails::GetMinMaxWidth(float& min_width, float& max_width, const ComputedValues& computed, const Box& box, float containing_block_width) { min_width = ResolveValue(computed.min_width(), containing_block_width); max_width = (computed.max_width().value < 0.f ? FLT_MAX : ResolveValue(computed.max_width(), containing_block_width)); if (computed.box_sizing() == Style::BoxSizing::BorderBox) { const float border_padding_width = box.GetSizeAcross(Box::HORIZONTAL, Box::BORDER, Box::PADDING); min_width = BorderSizeToContentSize(min_width, border_padding_width); max_width = BorderSizeToContentSize(max_width, border_padding_width); } } void LayoutDetails::GetMinMaxHeight(float& min_height, float& max_height, const ComputedValues& computed, const Box& box, float containing_block_height) { min_height = ResolveValue(computed.min_height(), containing_block_height); max_height = (computed.max_height().value < 0.f ? FLT_MAX : ResolveValue(computed.max_height(), containing_block_height)); if (computed.box_sizing() == Style::BoxSizing::BorderBox) { const float border_padding_height = box.GetSizeAcross(Box::VERTICAL, Box::BORDER, Box::PADDING); min_height = BorderSizeToContentSize(min_height, border_padding_height); max_height = BorderSizeToContentSize(max_height, border_padding_height); } } void LayoutDetails::GetDefiniteMinMaxHeight(float& min_height, float& max_height, const ComputedValues& computed, const Box& box, float containing_block_height) { const float box_height = box.GetSize().y; if (box_height < 0) { GetMinMaxHeight(min_height, max_height, computed, box, containing_block_height); } else { min_height = box_height; max_height = box_height; } } // Returns the fully-resolved, fixed-width and -height containing block from a block box. Vector2f LayoutDetails::GetContainingBlock(const LayoutBlockBox* containing_box) { RMLUI_ASSERT(containing_box); Vector2f containing_block; containing_block.x = containing_box->GetBox().GetSize(Box::CONTENT).x; if (containing_box->GetElement() != nullptr) containing_block.x -= containing_box->GetElement()->GetElementScroll()->GetScrollbarSize(ElementScroll::VERTICAL); while ((containing_block.y = containing_box->GetBox().GetSize(Box::CONTENT).y) < 0) { containing_box = containing_box->GetParent(); if (containing_box == nullptr) { RMLUI_ERROR; containing_block.y = 0; } } if (containing_box != nullptr && containing_box->GetElement() != nullptr) containing_block.y -= containing_box->GetElement()->GetElementScroll()->GetScrollbarSize(ElementScroll::HORIZONTAL); containing_block.x = Math::Max(0.0f, containing_block.x); containing_block.y = Math::Max(0.0f, containing_block.y); return containing_block; } void LayoutDetails::BuildBoxSizeAndMargins(Box& box, Vector2f min_size, Vector2f max_size, Vector2f containing_block, Element* element, BoxContext box_context, bool replaced_element, float override_shrink_to_fit_width) { const ComputedValues& computed = element->GetComputedValues(); if (box_context == BoxContext::Inline || box_context == BoxContext::FlexOrTable) { // For inline elements, their calculations are straightforward. No worrying about auto margins and dimensions, etc. // Evaluate the margins. Any declared as 'auto' will resolve to 0. box.SetEdge(Box::MARGIN, Box::TOP, ResolveValue(computed.margin_top(), containing_block.x)); box.SetEdge(Box::MARGIN, Box::RIGHT, ResolveValue(computed.margin_right(), containing_block.x)); box.SetEdge(Box::MARGIN, Box::BOTTOM, ResolveValue(computed.margin_bottom(), containing_block.x)); box.SetEdge(Box::MARGIN, Box::LEFT, ResolveValue(computed.margin_left(), containing_block.x)); } else { // The element is block, so we need to run the box through the ringer to potentially evaluate auto margins and dimensions. BuildBoxWidth(box, computed, min_size.x, max_size.x, containing_block, element, replaced_element, override_shrink_to_fit_width); BuildBoxHeight(box, computed, min_size.y, max_size.y, containing_block.y); } } float LayoutDetails::GetShrinkToFitWidth(Element* element, Vector2f containing_block) { RMLUI_ASSERT(element); Box box; float min_height, max_height; LayoutDetails::BuildBox(box, containing_block, element, BoxContext::Block, containing_block.x); LayoutDetails::GetDefiniteMinMaxHeight(min_height, max_height, element->GetComputedValues(), box, containing_block.y); // First we need to format the element, then we get the shrink-to-fit width based on the largest line or box. LayoutBlockBox containing_block_box(nullptr, nullptr, Box(containing_block), 0.0f, FLT_MAX); // Here we fix the element's width to its containing block so that any content is wrapped at this width. // We can consider to instead set this to infinity and clamp it to the available width later after formatting, // but right now the formatting procedure doesn't work well with such numbers. LayoutBlockBox* block_context_box = containing_block_box.AddBlockElement(element, box, min_height, max_height); // @performance. Some formatting can be simplified, eg. absolute elements do not contribute to the shrink-to-fit width. // Also, children of elements with a fixed width and height don't need to be formatted further. for (int i = 0; i < element->GetNumChildren(); i++) { if (!LayoutEngine::FormatElement(block_context_box, element->GetChild(i))) i = -1; } // We only do layouting to get the fit-to-shrink width here, and for this purpose we may get // away with not closing the boxes. This is avoided for performance reasons. //block_context_box->Close(); return Math::Min(containing_block.x, block_context_box->GetShrinkToFitWidth()); } ComputedAxisSize LayoutDetails::BuildComputedHorizontalSize(const ComputedValues& computed) { return ComputedAxisSize{computed.width(), computed.min_width(), computed.max_width(), computed.padding_left(), computed.padding_right(), computed.margin_left(), computed.margin_right(), computed.border_left_width(), computed.border_right_width(), computed.box_sizing()}; } ComputedAxisSize LayoutDetails::BuildComputedVerticalSize(const ComputedValues& computed) { return ComputedAxisSize{computed.height(), computed.min_height(), computed.max_height(), computed.padding_top(), computed.padding_bottom(), computed.margin_top(), computed.margin_bottom(), computed.border_top_width(), computed.border_bottom_width(), computed.box_sizing()}; } void LayoutDetails::GetEdgeSizes(float& margin_a, float& margin_b, float& padding_border_a, float& padding_border_b, const ComputedAxisSize& computed_size, const float base_value) { margin_a = ResolveValue(computed_size.margin_a, base_value); margin_b = ResolveValue(computed_size.margin_b, base_value); padding_border_a = Math::Max(0.0f, ResolveValue(computed_size.padding_a, base_value)) + Math::Max(0.0f, computed_size.border_a); padding_border_b = Math::Max(0.0f, ResolveValue(computed_size.padding_b, base_value)) + Math::Max(0.0f, computed_size.border_b); } Vector2f LayoutDetails::CalculateSizeForReplacedElement(const Vector2f specified_content_size, const Vector2f min_size, const Vector2f max_size, const Vector2f intrinsic_size, const float intrinsic_ratio) { // Start with the element's specified width and height. If any of them are auto, use the element's intrinsic // dimensions and ratio to find a suitable content size. Vector2f content_size = specified_content_size; const bool auto_width = (content_size.x < 0); const bool auto_height = (content_size.y < 0); if (auto_width) content_size.x = intrinsic_size.x; if (auto_height) content_size.y = intrinsic_size.y; // Use a fallback size if we still couldn't determine the size. if (content_size.x < 0) content_size.x = 300; if (content_size.y < 0) content_size.y = 150; // Resolve the size constraints. const float min_width = min_size.x; const float max_width = max_size.x; const float min_height = min_size.y; const float max_height = max_size.y; // If we have an intrinsic ratio and one of the dimensions is 'auto', then scale it such that the ratio is preserved. if (intrinsic_ratio > 0) { if (auto_width && !auto_height) { content_size.x = content_size.y * intrinsic_ratio; } else if (auto_height && !auto_width) { content_size.y = content_size.x / intrinsic_ratio; } else if (auto_width && auto_height) { // If both width and height are auto, try to preserve the ratio under the respective min/max constraints. const float w = content_size.x; const float h = content_size.y; if ((w < min_width && h > max_height) || (w > max_width && h < min_height)) { // Cannot preserve aspect ratio, let it be clamped. } else if (w < min_width && h < min_height) { // Increase the size such that both min-constraints are respected. The non-scaled axis will // be clamped below, preserving the aspect ratio. if (min_width <= min_height * intrinsic_ratio) content_size.x = min_height * intrinsic_ratio; else content_size.y = min_width / intrinsic_ratio; } else if (w > max_width && h > max_height) { // Shrink the size such that both max-constraints are respected. The non-scaled axis will // be clamped below, preserving the aspect ratio. if (max_width <= max_height * intrinsic_ratio) content_size.y = max_width / intrinsic_ratio; else content_size.x = max_height * intrinsic_ratio; } else { // Single constraint violations. if (w < min_width) content_size.y = min_width / intrinsic_ratio; else if (w > max_width) content_size.y = max_width / intrinsic_ratio; else if (h < min_height) content_size.x = min_height * intrinsic_ratio; else if (h > max_height) content_size.x = max_height * intrinsic_ratio; } } } content_size.x = Math::Clamp(content_size.x, min_width, max_width); content_size.y = Math::Clamp(content_size.y, min_height, max_height); return content_size; } // Builds the block-specific width and horizontal margins of a Box. void LayoutDetails::BuildBoxWidth(Box& box, const ComputedValues& computed, float min_width, float max_width, Vector2f containing_block, Element* element, bool replaced_element, float override_shrink_to_fit_width) { RMLUI_ZoneScoped; Vector2f content_area = box.GetSize(); // Determine if the element has automatic margins. bool margins_auto[2]; int num_auto_margins = 0; for (int i = 0; i < 2; ++i) { const Style::Margin margin_value = (i == 0 ? computed.margin_left() : computed.margin_right()); if (margin_value.type == Style::Margin::Auto) { margins_auto[i] = true; num_auto_margins++; box.SetEdge(Box::MARGIN, i == 0 ? Box::LEFT : Box::RIGHT, 0); } else { margins_auto[i] = false; box.SetEdge(Box::MARGIN, i == 0 ? Box::LEFT : Box::RIGHT, ResolveValue(margin_value, containing_block.x)); } } const bool width_auto = (content_area.x < 0); // If the width is set to auto, we need to calculate the width if (width_auto) { // Apply the shrink-to-fit algorithm here to find the width of the element. // See CSS 2.1 section 10.3.7 for when this should be applied. const bool shrink_to_fit = !replaced_element && ((computed.float_() != Style::Float::None) || ((computed.position() == Style::Position::Absolute || computed.position() == Style::Position::Fixed) && (computed.left().type == Style::Left::Auto || computed.right().type == Style::Right::Auto)) || (computed.display() == Style::Display::InlineBlock)); float left = 0.0f, right = 0.0f; // If we are dealing with an absolutely positioned element we need to // consider if the left and right properties are set, since the width can be affected. if (computed.position() == Style::Position::Absolute || computed.position() == Style::Position::Fixed) { if (computed.left().type != Style::Left::Auto) left = ResolveValue(computed.left(), containing_block.x); if (computed.right().type != Style::Right::Auto) right = ResolveValue(computed.right(), containing_block.x); } if (shrink_to_fit && override_shrink_to_fit_width < 0) { content_area.x = GetShrinkToFitWidth(element, containing_block); override_shrink_to_fit_width = content_area.x; } else if (shrink_to_fit) { content_area.x = override_shrink_to_fit_width; } else { // We resolve any auto margins to 0 and the width is set to whatever is left of the containing block. content_area.x = containing_block.x - (left + box.GetCumulativeEdge(Box::CONTENT, Box::LEFT) + box.GetCumulativeEdge(Box::CONTENT, Box::RIGHT) + right); content_area.x = Math::Max(0.0f, content_area.x); } } // Otherwise, the margins that are set to auto will pick up the remaining width of the containing block. else if (num_auto_margins > 0) { const float margin = (containing_block.x - box.GetSizeAcross(Box::HORIZONTAL, Box::MARGIN)) / float(num_auto_margins); if (margins_auto[0]) box.SetEdge(Box::MARGIN, Box::LEFT, margin); if (margins_auto[1]) box.SetEdge(Box::MARGIN, Box::RIGHT, margin); } // Clamp the calculated width; if the width is changed by the clamp, then the margins need to be recalculated if // they were set to auto. const float clamped_width = Math::Clamp(content_area.x, min_width, max_width); if (clamped_width != content_area.x) { content_area.x = clamped_width; box.SetContent(content_area); if (num_auto_margins > 0) BuildBoxWidth(box, computed, min_width, max_width, containing_block, element, replaced_element, override_shrink_to_fit_width); } else box.SetContent(content_area); } // Builds the block-specific height and vertical margins of a Box. void LayoutDetails::BuildBoxHeight(Box& box, const ComputedValues& computed, float min_height, float max_height, float containing_block_height) { RMLUI_ZoneScoped; Vector2f content_area = box.GetSize(); // Determine if the element has automatic margins. bool margins_auto[2]; int num_auto_margins = 0; for (int i = 0; i < 2; ++i) { const Style::Margin margin_value = (i == 0 ? computed.margin_top() : computed.margin_bottom()); if (margin_value.type == Style::Margin::Auto) { margins_auto[i] = true; num_auto_margins++; box.SetEdge(Box::MARGIN, i == 0 ? Box::TOP : Box::BOTTOM, 0); } else { margins_auto[i] = false; box.SetEdge(Box::MARGIN, i == 0 ? Box::TOP : Box::BOTTOM, ResolveValue(margin_value, containing_block_height)); } } const bool height_auto = (content_area.y < 0); // If the height is set to auto, we need to calculate the height if (height_auto) { // If the height is set to auto for a box in normal flow, the height is set to -1. content_area.y = -1; // But if we are dealing with an absolutely positioned element we need to // consider if the top and bottom properties are set, since the height can be affected. if (computed.position() == Style::Position::Absolute || computed.position() == Style::Position::Fixed) { float top = 0.0f, bottom = 0.0f; if (computed.top().type != Style::Top::Auto && computed.bottom().type != Style::Bottom::Auto) { top = ResolveValue(computed.top(), containing_block_height); bottom = ResolveValue(computed.bottom(), containing_block_height); // The height gets resolved to whatever is left of the containing block content_area.y = containing_block_height - (top + box.GetCumulativeEdge(Box::CONTENT, Box::TOP) + box.GetCumulativeEdge(Box::CONTENT, Box::BOTTOM) + bottom); content_area.y = Math::Max(0.0f, content_area.y); } } } // Otherwise, the margins that are set to auto will pick up the remaining width of the containing block. else if (num_auto_margins > 0) { float margin = 0; if (content_area.y >= 0) margin = (containing_block_height - box.GetSizeAcross(Box::VERTICAL, Box::MARGIN)) / num_auto_margins; if (margins_auto[0]) box.SetEdge(Box::MARGIN, Box::TOP, margin); if (margins_auto[1]) box.SetEdge(Box::MARGIN, Box::BOTTOM, margin); } if (content_area.y >= 0) { // Clamp the calculated height; if the height is changed by the clamp, then the margins need to be recalculated if // they were set to auto. float clamped_height = Math::Clamp(content_area.y, min_height, max_height); if (clamped_height != content_area.y) { content_area.y = clamped_height; box.SetContent(content_area); if (num_auto_margins > 0) BuildBoxHeight(box, computed, min_height, max_height, containing_block_height); return; } } box.SetContent(content_area); } } // namespace Rml
41.026502
213
0.737694
[ "model" ]
e7346af9523c0b3736d8b0604ef0dd2fe22aebe7
29,393
cpp
C++
test/3rdparty/opponents/Steamhammer/Steamhammer/Source/BuildingManager.cpp
ratiotile/StardustDevEnvironment
15c512b81579d8bd663db3fa8e0847d4c27f17e8
[ "MIT" ]
8
2020-09-29T17:11:15.000Z
2022-01-29T20:41:33.000Z
test/3rdparty/opponents/Steamhammer/Steamhammer/Source/BuildingManager.cpp
ratiotile/StardustDevEnvironment
15c512b81579d8bd663db3fa8e0847d4c27f17e8
[ "MIT" ]
1
2021-03-08T17:43:05.000Z
2021-03-09T06:35:04.000Z
test/3rdparty/opponents/Steamhammer/Steamhammer/Source/BuildingManager.cpp
ratiotile/StardustDevEnvironment
15c512b81579d8bd663db3fa8e0847d4c27f17e8
[ "MIT" ]
1
2021-03-01T04:31:30.000Z
2021-03-01T04:31:30.000Z
#include "BuildingManager.h" #include "Bases.h" #include "MapTools.h" #include "Micro.h" #include "ProductionManager.h" #include "ScoutManager.h" #include "The.h" #include "UnitUtil.h" using namespace UAlbertaBot; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- BuildingManager::BuildingManager() : the(The::Root()) , _reservedMinerals(0) , _reservedGas(0) , _stalledForLackOfSpace(false) { } // Called every frame from GameCommander. void BuildingManager::update() { validateBuildings(); // check to see if assigned workers have died en route or while constructing assignWorkersToUnassignedBuildings(); // assign workers to the unassigned buildings and label them 'planned' constructAssignedBuildings(); // for each planned building, if the worker isn't constructing, send the command checkForStartedConstruction(); // check to see if any buildings have started construction and update data structures checkForDeadTerranBuilders(); // if we are terran and a building is under construction without a worker, assign a new one checkForCompletedBuildings(); // check to see if any buildings have completed and update data structures checkReservedResources(); // verify that reserved minerals and gas are counted correctly } // The building took too long to start, or we lost too many workers trying to build it. // If true, the building gets canceled. bool BuildingManager::buildingTimedOut(const Building & b) const { return BWAPI::Broodwar->getFrameCount() - b.startFrame > 60 * 24 || b.buildersSent > 2; } // STEP 1: DO BOOK KEEPING ON BUILDINGS WHICH MAY HAVE DIED OR TIMED OUT void BuildingManager::validateBuildings() { // The purpose of this vector is to avoid changing the list of buildings // while we are in the midst of iterating through it. std::vector< std::reference_wrapper<Building> > toRemove; // Find and remove any buildings which have failed construction and should be deleted. for (Building & b : _buildings) { if (buildingTimedOut(b) && ProductionManager::Instance().isOutOfBook() && (!b.buildingUnit || b.type.getRace() == BWAPI::Races::Terran && !b.builderUnit)) { toRemove.push_back(b); } else if (b.status == BuildingStatus::UnderConstruction) { if (!b.buildingUnit || !b.buildingUnit->exists() || b.buildingUnit->getHitPoints() <= 0 || !b.buildingUnit->getType().isBuilding()) { toRemove.push_back(b); } } } undoBuildings(toRemove); } // STEP 2: ASSIGN WORKERS TO BUILDINGS WITHOUT THEM // Also places the building. void BuildingManager::assignWorkersToUnassignedBuildings() { // for each building that doesn't have a builder, assign one for (Building & b : _buildings) { if (b.status != BuildingStatus::Unassigned) { continue; } // Skip protoss buildings that need pylon power if there is no space for them. if (typeIsStalled(b.type)) { continue; } if (b.buildersSent > 0 && b.type == BWAPI::UnitTypes::Zerg_Hatchery && b.macroLocation != MacroLocation::Macro && UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Larva) == 0) // yes, we may need more production { // This is a zerg expansion which failed--we sent a builder and it never built. // The builder was most likely killed along the way. // Conclude that we need more production and change it to a macro hatchery. b.macroLocation = MacroLocation::Macro; } // The builder may have already been decided before we got this far. // If we don't already have a valid builder, choose one. // NOTE There is a dependency loop here. To get the builder, we want to know the // building's position. But to check its final position we need to know the // builder unit, because other units block the building placement. To solve this, // we get the builder first based on the desired rather than the final position. // Better solutions are possible! if (!b.builderUnit || !b.builderUnit->exists() || b.builderUnit->getPlayer() != BWAPI::Broodwar->self() || !b.builderUnit->getType().isWorker()) { releaseBuilderUnit(b); // does nothing if it's null setBuilderUnit(b); } // No good, we can't get a worker. Give up on the building for this frame. if (!b.builderUnit || !b.builderUnit->exists()) { continue; } // We want the worker before the location, so that we can avoid counting the worker // as an obstacle for the location it is already in--ProductionManager sends the worker early. // Otherwise we may have to re-place the building elsewhere, causing unnecessary movement. BWAPI::TilePosition testLocation = getBuildingLocation(b); if (!testLocation.isValid()) { // The building could not be placed (or was placed incorrectly due to a bug, which should not happen). // Recognize the case where protoss building placement is stalled for lack of space. // In principle, terran or zerg could run out of space, but it doesn't happen in practice. if (b.type.requiresPsi() && testLocation == BWAPI::TilePositions::None) { _stalledForLackOfSpace = true; } releaseBuilderUnit(b); continue; } b.finalPosition = testLocation; ++b.buildersSent; // count workers ever assigned to build it //BWAPI::Broodwar->printf("assign builder %d to %s", b.builderUnit->getID(), UnitTypeName(b.type).c_str()); BuildingPlacer::Instance().reserveTiles(b.finalPosition,b.type.tileWidth(),b.type.tileHeight()); b.status = BuildingStatus::Assigned; } } // STEP 3: ISSUE CONSTRUCTION ORDERS TO ASSIGNED BUILDINGS AS NEEDED void BuildingManager::constructAssignedBuildings() { for (Building & b : _buildings) { if (b.status != BuildingStatus::Assigned) { continue; } if (!b.builderUnit || b.builderUnit->getPlayer() != BWAPI::Broodwar->self() || !b.builderUnit->exists() && b.type != BWAPI::UnitTypes::Zerg_Extractor) { // NOTE A zerg drone builderUnit no longer exists() after starting an extractor. // The geyser unit changes into the building, the drone vanishes. // For other zerg buildings, the drone changes into the building. releaseBuilderUnit(b); //BWAPI::Broodwar->printf("b.builderUnit gone, b.type = %s", UnitTypeName(b.type).c_str()); b.buildCommandGiven = false; b.status = BuildingStatus::Unassigned; BuildingPlacer::Instance().freeTiles(b.finalPosition, b.type.tileWidth(), b.type.tileHeight()); } else if (!b.builderUnit->isConstructing()) { if (!isBuildingPositionExplored(b)) { // We haven't explored the build position. Go there. the.micro.Move(b.builderUnit, b.getCenter()); } // if this is not the first time we've sent this guy to build this // it must be the case that something was in the way else if (b.buildCommandGiven) { // Give it a little time to happen. // This mainly prevents over-frequent retrying. if (BWAPI::Broodwar->getFrameCount() > b.placeBuildingDeadline) { //BWAPI::Broodwar->printf("release and redo builder %d for %s", b.builderUnit->getID(), UnitTypeName(b.type).c_str()); // tell worker manager the unit we had is not needed now, since we might not be able // to get a valid location soon enough releaseBuilderUnit(b); b.buildCommandGiven = false; b.status = BuildingStatus::Unassigned; // This is a normal event that may happen repeatedly before the building starts. // Don't count it as a failure. --b.buildersSent; // Unreserve the building location. The building will mark its own location. BuildingPlacer::Instance().freeTiles(b.finalPosition, b.type.tileWidth(), b.type.tileHeight()); } } else { // Issue the build order and record whether it succeeded. // If the builderUnit is zerg, it changes to !exists() when it builds. b.buildCommandGiven = the.micro.Build(b.builderUnit, b.type, b.finalPosition); if (b.buildCommandGiven) { b.placeBuildingDeadline = BWAPI::Broodwar->getFrameCount() + 2 * BWAPI::Broodwar->getLatencyFrames(); } else { //BWAPI::Broodwar->printf("failed to start cnstruction of %s, error %d", UnitTypeName(b.type).c_str(), BWAPI::Broodwar->getLastError()); } } } } } // STEP 4: UPDATE DATA STRUCTURES FOR BUILDINGS STARTING CONSTRUCTION void BuildingManager::checkForStartedConstruction() { // for each building unit which is being constructed for (const BWAPI::Unit buildingStarted : BWAPI::Broodwar->self()->getUnits()) { // filter out units which aren't buildings under construction if (!buildingStarted->getType().isBuilding() || !buildingStarted->isBeingConstructed()) { continue; } // check all our building status objects to see if we have a match and if we do, update it for (Building & b : _buildings) { if (b.status != BuildingStatus::Assigned) { continue; } // check if the positions match if (b.finalPosition == buildingStarted->getTilePosition()) { // the resources should now be spent, so unreserve them _reservedMinerals -= buildingStarted->getType().mineralPrice(); _reservedGas -= buildingStarted->getType().gasPrice(); // flag it as started and set the buildingUnit b.underConstruction = true; b.buildingUnit = buildingStarted; // The building is started; handle zerg and protoss builders. // Terran builders are dealt with after the building finishes. if (BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Zerg) { // If we are zerg, the builderUnit no longest exists as such. // If the building later gets canceled, a new drone will "mysteriously" appear. // There's no drone to release, but we still want to let the ScoutManager know // that the gas steal is accomplished. If it's not a gas steal, this does nothing. releaseBuilderUnit(b); } else if (BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Protoss) { releaseBuilderUnit(b); } b.status = BuildingStatus::UnderConstruction; BuildingPlacer::Instance().freeTiles(b.finalPosition,b.type.tileWidth(),b.type.tileHeight()); // Only one Building will match. // We keep running the outer loop to look for more buildings starting construction. break; } } } } // STEP 5: IF THE SCV DIED DURING CONSTRUCTION, ASSIGN A NEW ONE void BuildingManager::checkForDeadTerranBuilders() { if (BWAPI::Broodwar->self()->getRace() != BWAPI::Races::Terran) { return; } for (Building & b : _buildings) { if (b.status != BuildingStatus::UnderConstruction) { continue; } UAB_ASSERT(b.buildingUnit, "null buildingUnit"); if (!UnitUtil::IsValidUnit(b.builderUnit)) { releaseBuilderUnit(b); setBuilderUnit(b); if (b.builderUnit) { b.builderUnit->rightClick(b.buildingUnit); } } } } // STEP 6: CHECK FOR COMPLETED BUILDINGS // In case of terran gas steal, stop construction a little early, // so we can cancel the refinery later and recover resources. // Zerg and protoss can't do that. void BuildingManager::checkForCompletedBuildings() { std::vector< std::reference_wrapper<Building> > toRemove; // for each of our buildings under construction for (Building & b : _buildings) { if (b.status != BuildingStatus::UnderConstruction) { continue; } UAB_ASSERT(b.buildingUnit, "null buildingUnit"); if (b.buildingUnit->isCompleted()) { // If we are terran, give the worker back to worker manager. // Zerg and protoss are handled when the building starts. if (BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Terran) { releaseBuilderUnit(b); } // And we don't want to keep the building record any more. toRemove.push_back(b); } else { // The building, whatever it is, is not completed. // If it is a terran gas steal, stop construction early. if (b.isGasSteal && BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Terran && b.builderUnit && b.builderUnit->canHaltConstruction() && b.buildingUnit->getRemainingBuildTime() < 24) { b.builderUnit->haltConstruction(); releaseBuilderUnit(b); // Call the building done. It's as finished as we want it to be. toRemove.push_back(b); } } } removeBuildings(toRemove); } // Error check: Bugs could cause resources to be reserved and never released. // We correct the values as a workaround. // Currently there are no known bugs causing this. void BuildingManager::checkReservedResources() { // Check for errors. int minerals = 0; int gas = 0; for (Building & b : _buildings) { if (b.status == BuildingStatus::Assigned || b.status == BuildingStatus::Unassigned) { minerals += b.type.mineralPrice(); gas += b.type.gasPrice(); } } if (minerals != _reservedMinerals || gas != _reservedGas) { // This message should ideally never happen. If it does, we correct the error and carry on. // BWAPI::Broodwar->printf("reserves wrong: %d %d should be %d %d", _reservedMinerals, _reservedGas, minerals, gas); _reservedMinerals = minerals; _reservedGas = gas; } } // The caller specifies a desired position, which the building should be placed near. // It can be anything. This method handles the usual case, where the desired position is // based on the MacroLocation. // Macrolocations not handled here are special cases and dealt with elsewhere. BWAPI::TilePosition BuildingManager::getStandardDesiredPosition(MacroLocation loc) const { if (loc == MacroLocation::Front) { BWAPI::TilePosition front = Bases::Instance().frontPoint(); if (front.isValid()) { return front; } } else if (loc == MacroLocation::Natural) { Base * natural = Bases::Instance().myNaturalBase(); if (natural) { return natural->getTilePosition(); } } else if (loc == MacroLocation::Center) { // Near the center of the map. return BWAPI::TilePosition(BWAPI::Broodwar->mapWidth() / 2, BWAPI::Broodwar->mapHeight() / 2); } else if (loc == MacroLocation::Proxy) { if (Bases::Instance().enemyStart()) { // We know where the enemy is. We can proxy in or close to the enemy base. // Other code should try to find the enemy base first! BWAPI::TilePosition proxy = BuildingPlacer::Instance().getProxyPosition(Bases::Instance().enemyStart()); if (proxy.isValid()) { // BWAPI::Broodwar->printf("proxy at %d,%d", proxy.x, proxy.y); return proxy; } } // We don't know where the enemy is, or can't find a close proxy position, // but we can at least proxy to the center of the map. return getStandardDesiredPosition(MacroLocation::Center); } // Default: Build in the current main base, which is guaranteed to exist (though it may be empty or in enemy cobtrol). return Bases::Instance().myMainBase()->getTilePosition(); } // Add a new building to be constructed and return it. // The builder may be null. In that case, the building manager will assign a worker on its own later. Building & BuildingManager::addTrackedBuildingTask(const MacroAct & act, BWAPI::TilePosition desiredLocation, BWAPI::Unit builder, bool isGasSteal) { UAB_ASSERT(act.isBuilding(), "trying to build a non-building"); if (isGasSteal) { // BWAPI::Broodwar->printf("gas steal into building manager"); } BWAPI::UnitType type = act.getUnitType(); _reservedMinerals += type.mineralPrice(); _reservedGas += type.gasPrice(); Building b(type, desiredLocation); b.macroLocation = act.getMacroLocation(); b.isGasSteal = isGasSteal; b.status = BuildingStatus::Unassigned; // The builder, if provided, may have been killed, mind controlled, or morphed. if (builder && builder->exists() && builder->getPlayer() == BWAPI::Broodwar->self() && builder->getType().isWorker()) { // BWAPI::Broodwar->printf("build man receives worker %d for %s", builder->getID(), UnitTypeName(type).c_str()); b.builderUnit = builder; } _buildings.push_back(b); // make a "permanent" copy of the Building object return _buildings.back(); // return a reference to the permanent copy } // Add a new building to be constructed. void BuildingManager::addBuildingTask(const MacroAct & act, BWAPI::TilePosition desiredLocation, BWAPI::Unit builder, bool isGasSteal) { (void) addTrackedBuildingTask(act, desiredLocation, builder, isGasSteal); } bool BuildingManager::isBuildingPositionExplored(const Building & b) const { BWAPI::TilePosition tile = b.finalPosition; // For each tile where the building will be built, is the tile explored? for (int x=0; x<b.type.tileWidth(); ++x) { for (int y=0; y<b.type.tileHeight(); ++y) { if (!BWAPI::Broodwar->isExplored(tile.x + x,tile.y + y)) { return false; } } } return true; } char BuildingManager::getBuildingWorkerCode(const Building & b) const { return b.builderUnit == nullptr ? 'X' : 'W'; } void BuildingManager::setBuilderUnit(Building & b) { UAB_ASSERT(!b.builderUnit, "incorrectly replacing builder"); // Grab the closest worker from WorkerManager. // It knows to return the scout wotker if this is a gas steal. b.builderUnit = WorkerManager::Instance().getBuilder(b); if (b.builderUnit) { WorkerManager::Instance().setBuildWorker(b.builderUnit, b.type); // BWAPI::Broodwar->printf("build man assigns worker %d for %s", b.builderUnit ? b.builderUnit->getID() : -1, UnitTypeName(b.type).c_str()); } else { // BWAPI::Broodwar->printf("no builder available to assign"); } } // Notify the worker manager that the worker is free again, // but not if the scout manager owns the worker. void BuildingManager::releaseBuilderUnit(Building & b) { if (b.isGasSteal) { ScoutManager::Instance().gasStealOver(); } else { if (b.builderUnit) { // BWAPI::Broodwar->printf("build man releases worker for %s", UnitTypeName(b.type).c_str()); WorkerManager::Instance().finishedWithWorker(b.builderUnit); } } b.builderUnit = nullptr; } int BuildingManager::getReservedMinerals() const { return _reservedMinerals; } int BuildingManager::getReservedGas() const { return _reservedGas; } // In the building queue with any status. bool BuildingManager::isBeingBuilt(BWAPI::UnitType type) const { for (const Building & b : _buildings) { if (b.type == type) { return true; } } return false; } // Number in the building queue with status other than "under constrution". size_t BuildingManager::getNumUnstarted() const { size_t count = 0; for (const Building & b : _buildings) { if (b.status != BuildingStatus::UnderConstruction) { ++count; } } return count; } // Number of a given type in the building queue with status other than "under constrution". size_t BuildingManager::getNumUnstarted(BWAPI::UnitType type) const { size_t count = 0; for (const Building & b : _buildings) { if (b.type == type && b.status != BuildingStatus::UnderConstruction) { ++count; } } return count; } bool BuildingManager::isGasStealInQueue() const { for (const Building & b : _buildings) { if (b.isGasSteal) { return true; } } return false; } // We have queued an expansion to the given base. // (Or at least some building at the same location.) bool BuildingManager::isBasePlanned(const Base * base) const { for (const Building & b : _buildings) { if (b.finalPosition == base->getTilePosition()) { return true; } } return false; } void BuildingManager::drawBuildingInformation(int x, int y) { if (!Config::Debug::DrawBuildingInfo) { return; } for (const auto unit : BWAPI::Broodwar->self()->getUnits()) { BWAPI::Broodwar->drawTextMap(unit->getPosition().x,unit->getPosition().y+5,"\x07%d",unit->getID()); } BWAPI::Broodwar->drawTextScreen(x,y+20,"\x04 Building"); BWAPI::Broodwar->drawTextScreen(x+150,y+20,"\x04 State"); int yspace = 0; for (const Building & b : _buildings) { if (b.status == BuildingStatus::Unassigned) { int x1 = b.desiredPosition.x * 32; int y1 = b.desiredPosition.y * 32; int x2 = (b.desiredPosition.x + b.type.tileWidth()) * 32; int y2 = (b.desiredPosition.y + b.type.tileHeight()) * 32; char color = yellow; if (typeIsStalled(b.type)) { color = red; } BWAPI::Broodwar->drawTextScreen(x, y + 40 + ((yspace)* 10), "%c %s", color, NiceMacroActName(b.type.getName()).c_str()); BWAPI::Broodwar->drawTextScreen(x + 150, y + 40 + ((yspace++) * 10), "%c Need %c", color, getBuildingWorkerCode(b)); BWAPI::Broodwar->drawBoxMap(x1, y1, x2, y2, BWAPI::Colors::Green, false); } else if (b.status == BuildingStatus::Assigned) { BWAPI::Broodwar->drawTextScreen(x, y + 40 + ((yspace)* 10), "\x03 %s %d", NiceMacroActName(b.type.getName()).c_str(), b.builderUnit->getID()); BWAPI::Broodwar->drawTextScreen(x+150,y+40+((yspace++)*10),"\x03 A %c (%d,%d)",getBuildingWorkerCode(b),b.finalPosition.x,b.finalPosition.y); int x1 = b.finalPosition.x*32; int y1 = b.finalPosition.y*32; int x2 = (b.finalPosition.x + b.type.tileWidth())*32; int y2 = (b.finalPosition.y + b.type.tileHeight())*32; BWAPI::Broodwar->drawLineMap(b.builderUnit->getPosition().x,b.builderUnit->getPosition().y,(x1+x2)/2,(y1+y2)/2,BWAPI::Colors::Orange); BWAPI::Broodwar->drawBoxMap(x1,y1,x2,y2,BWAPI::Colors::Red,false); } else if (b.status == BuildingStatus::UnderConstruction) { BWAPI::Broodwar->drawTextScreen(x,y+40+((yspace)*10),"\x03 %s %d",NiceMacroActName(b.type.getName()).c_str(),b.buildingUnit->getID()); BWAPI::Broodwar->drawTextScreen(x+150,y+40+((yspace++)*10),"\x03 Const %c",getBuildingWorkerCode(b)); } } } BuildingManager & BuildingManager::Instance() { static BuildingManager instance; return instance; } // The buildings queued and not yet started. std::vector<BWAPI::UnitType> BuildingManager::buildingsQueued() { std::vector<BWAPI::UnitType> buildingsQueued; for (const Building & b : _buildings) { if (b.status == BuildingStatus::Unassigned || b.status == BuildingStatus::Assigned) { buildingsQueued.push_back(b.type); } } return buildingsQueued; } // Cancel a given building when possible. // Used as part of the extractor trick or in an emergency. // NOTE CombatCommander::cancelDyingItems() can also cancel buildings, including // morphing zerg structures which the BuildingManager does not handle. void BuildingManager::cancelBuilding(Building & b) { std::vector< std::reference_wrapper<Building> > toRemove; // No matter the status, we don't want to keep the worker. releaseBuilderUnit(b); if (b.status == BuildingStatus::Unassigned) { toRemove.push_back(b); undoBuildings(toRemove); } else if (b.status == BuildingStatus::Assigned) { BuildingPlacer::Instance().freeTiles(b.finalPosition, b.type.tileWidth(), b.type.tileHeight()); toRemove.push_back(b); undoBuildings(toRemove); } else if (b.status == BuildingStatus::UnderConstruction) { if (b.buildingUnit && b.buildingUnit->exists() && !b.buildingUnit->isCompleted()) { the.micro.Cancel(b.buildingUnit); BuildingPlacer::Instance().freeTiles(b.finalPosition, b.type.tileWidth(), b.type.tileHeight()); } toRemove.push_back(b); undoBuildings(toRemove); } else { UAB_ASSERT(false, "unexpected building status"); } } // It's an emergency. Cancel all buildings which are not yet started. void BuildingManager::cancelQueuedBuildings() { std::vector< std::reference_wrapper<Building> > toCancel; for (Building & b : _buildings) { if (b.status == BuildingStatus::Unassigned || b.status == BuildingStatus::Assigned) { toCancel.push_back(b); } } for (Building & b : toCancel) { cancelBuilding(b); } } // It's an emergency. Cancel all buildings of a given type. void BuildingManager::cancelBuildingType(BWAPI::UnitType t) { std::vector< std::reference_wrapper<Building> > toCancel; for (Building & b : _buildings) { if (b.type == t) { toCancel.push_back(b); } } for (Building & b : toCancel) { cancelBuilding(b); } } BWAPI::TilePosition BuildingManager::getBuildingLocation(const Building & b) { if (b.isGasSteal) { Base * enemyBase = Bases::Instance().enemyStart(); UAB_ASSERT(enemyBase, "Should find enemy base before gas steal"); UAB_ASSERT(enemyBase->getGeysers().size() > 0, "Should have spotted an enemy geyser"); for (BWAPI::Unit geyser : enemyBase->getGeysers()) { return geyser->getTilePosition(); } } int numPylons = BWAPI::Broodwar->self()->completedUnitCount(BWAPI::UnitTypes::Protoss_Pylon); if (b.type.requiresPsi() && numPylons == 0) { return BWAPI::TilePositions::None; } if (b.type.isRefinery()) { return BuildingPlacer::Instance().getRefineryPosition(); } if (b.type.isResourceDepot()) { BWAPI::TilePosition front = Bases::Instance().frontPoint(); if (b.macroLocation == MacroLocation::Front && front.isValid() && !the.groundAttacks.inRange(b.type, front)) { // This means build an additional hatchery at our existing front base, wherever it is. return front; } Base * natural = Bases::Instance().myNaturalBase(); if (b.macroLocation == MacroLocation::Natural && natural && !the.groundAttacks.inRange(b.type, natural->getTilePosition())) { return natural->getTilePosition(); } if (b.macroLocation != MacroLocation::Macro && b.macroLocation != MacroLocation::Proxy) { return MapTools::Instance().getNextExpansion(b.macroLocation == MacroLocation::Hidden, true, b.macroLocation != MacroLocation::MinOnly); } // Else if it's a macro hatchery or other location, treat it like any other building. } int distance = Config::Macro::BuildingSpacing; if (b.type == BWAPI::UnitTypes::Terran_Bunker || b.type == BWAPI::UnitTypes::Terran_Missile_Turret || b.type == BWAPI::UnitTypes::Protoss_Photon_Cannon || b.type == BWAPI::UnitTypes::Zerg_Creep_Colony) { // Pack defenses tightly together. distance = 0; } else if (b.type == BWAPI::UnitTypes::Protoss_Pylon) { if (numPylons < 3) { // Early pylons may be spaced differently than other buildings. distance = Config::Macro::PylonSpacing; } else { // Building spacing == 1 is usual. Be more generous with pylons. distance = 2; } } // Get a position within our region. return BuildingPlacer::Instance().getBuildLocationNear(b, distance); } // The buildings failed or were canceled. // Undo any connections with other data structures, then delete. void BuildingManager::undoBuildings(const std::vector< std::reference_wrapper<Building> > & toRemove) { for (Building & b : toRemove) { // If the building was to establish a base, unreserve the base location. if (b.type.isResourceDepot() && b.macroLocation != MacroLocation::Macro && b.finalPosition.isValid()) { Base * base = Bases::Instance().getBaseAtTilePosition(b.finalPosition); if (base) { base->unreserve(); } } releaseBuilderUnit(b); // If the building is not yet under construction, release its resources. if (b.status == BuildingStatus::Unassigned || b.status == BuildingStatus::Assigned) { _reservedMinerals -= b.type.mineralPrice(); _reservedGas -= b.type.gasPrice(); } // Cancel a terran building under construction. Zerg and protoss finish on their own, // but a terran building will be left abandoned. if (b.buildingUnit && b.buildingUnit->getType().getRace() == BWAPI::Races::Terran && b.buildingUnit->exists() && b.buildingUnit->canCancelConstruction()) { the.micro.Cancel(b.buildingUnit); } } removeBuildings(toRemove); } // Remove buildings from the list of buildings--nothing more, nothing less. void BuildingManager::removeBuildings(const std::vector< std::reference_wrapper<Building> > & toRemove) { for (Building & b : toRemove) { auto it = std::find(_buildings.begin(), _buildings.end(), b); if (it != _buildings.end()) { _buildings.erase(it); } } } // Buildings of this type are stalled and can't be built yet. // They are protoss buildings that require pylon power, and can be built after // a pylon finishes and provides powered space. bool BuildingManager::typeIsStalled(BWAPI::UnitType type) const { return _stalledForLackOfSpace && type.requiresPsi(); }
31.948913
153
0.663627
[ "object", "vector" ]
e7399c983afcda792cbeafbab6ef73add9871972
2,046
hpp
C++
include/convenience_functions.hpp
domenn/cppcommonutil
8f8f071a274a57e4d1bcf7f09935a08175c1204e
[ "Unlicense" ]
null
null
null
include/convenience_functions.hpp
domenn/cppcommonutil
8f8f071a274a57e4d1bcf7f09935a08175c1204e
[ "Unlicense" ]
null
null
null
include/convenience_functions.hpp
domenn/cppcommonutil
8f8f071a274a57e4d1bcf7f09935a08175c1204e
[ "Unlicense" ]
null
null
null
#pragma once #include <vector> namespace d_common { namespace vector { /** * \brief Returns index of item. -1 if not exists. * \tparam T types in vector * \param items vector to search * \param to_search item we try to find * \return Index if found. */ template <typename T> int64_t find_in_vector(const std::vector<T>& items, const T& to_search) { auto found = std::find(items.begin(), items.end(), to_search); if (found != items.end()) { return found - items.begin(); } return -1; } /** * \brief Does vector items contain item to_search? * \tparam T types in vector * \param items vector to search * \param to_search item we try to find * \return True if it has item. */ template <typename T> bool contains(const std::vector<T>& items, const T& to_search) { return find_in_vector(items, to_search) >= 0; } /** * \brief Does vector `items` contain anything in `items_to_search`? * * \tparam T types in vector * \tparam container Container of `T`, should have begin() and end() methods. * \param items vector to search. * \param items_to_search items we try to find. * \return True if it has item. */ template <typename T, typename container = std::initializer_list<std::string>> bool contains_one_of(const std::vector<T>& items, const container& items_to_search) { for (const auto& itm : items_to_search) { if (find_in_vector(items, itm) >= 0) { return true; } } return false; } template <typename Tfirst, typename Tsecond> auto vector_of_pairs_to_two_vectors( std::vector<std::pair<Tfirst, Tsecond>>&& input_item) { std::vector<Tfirst> keys; std::vector<Tsecond> values; for (auto it = std::make_move_iterator(input_item.begin()), end = std::make_move_iterator(input_item.end()); it != end; ++it) { keys.push_back(std::move(it->first)); values.push_back(std::move(it->second)); } return std::make_pair(std::move(keys), std::move(values)); } } // namespace vector } // namespace d_common
30.088235
85
0.663734
[ "vector" ]
e73a591526739d497c4f7197b340c432617f17e0
14,323
cpp
C++
catkin_ws/src/aist_modules/aist_new_localization/src/Localization.cpp
mitdo/o2ac-ur
74c82a54a693bf6a3fc995ff63e7c91ac1fda6fd
[ "MIT" ]
32
2021-09-02T12:29:47.000Z
2022-03-30T21:44:10.000Z
catkin_ws/src/aist_modules/aist_new_localization/src/Localization.cpp
kroglice/o2ac-ur
f684f21fd280a22ec061dc5d503801f6fefb2422
[ "MIT" ]
4
2021-09-22T00:51:14.000Z
2022-01-30T11:54:19.000Z
catkin_ws/src/aist_modules/aist_new_localization/src/Localization.cpp
kroglice/o2ac-ur
f684f21fd280a22ec061dc5d503801f6fefb2422
[ "MIT" ]
7
2021-11-02T12:26:09.000Z
2022-02-01T01:45:22.000Z
// Software License Agreement (BSD License) // // Copyright (c) 2021, National Institute of Advanced Industrial Science and Technology (AIST) // 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 National Institute of Advanced Industrial // Science and Technology (AIST) 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. // // Author: Toshio Ueshiba // /*! * \file Localization.cpp * \author Toshio Ueshiba * \brief Server for finding and localizing parts on the tray */ #include <ros/package.h> #include <sensor_msgs/image_encodings.h> #include <pcl/segmentation/sac_segmentation.h> #include <pcl_conversions/pcl_conversions.h> #include <pcl/registration/icp.h> #include <pcl_ros/transforms.h> #include "Localization.h" #include "utils.h" namespace aist_new_localization { /************************************************************************ * static functions * ************************************************************************/ template <class T> static Eigen::Matrix<T, 4, 4> matrix44(const tf::Transform& transform) { const auto& R = transform.getBasis(); const auto& t = transform.getOrigin(); Eigen::Matrix<T, 4, 4> m; m << R[0][0], R[0][1], R[0][2], t[0], R[1][0], R[1][1], R[1][2], t[1], R[2][0], R[2][1], R[2][2], t[2], T(0), T(0), T(0), T(1); return m; } cv::Point3f pclpointToCV(const pcl::PointXYZ& p) { return {p.x, p.y, p.z}; } template <class T, unsigned long int D> static std::ostream& operator <<(std::ostream& out, const boost::array<T, D>& vec) { for (const auto& val : vec) out << ' ' << val; return out << std::endl; } static std::ostream& operator <<(std::ostream& out, const tf::Vector3& v) { return out << ' ' << v.x() << ' ' << v.y() << ' ' << v.z() << std::endl; } static std::ostream& operator <<(std::ostream& out, const tf::Matrix3x3& m) { return out << m.getRow(0) << m.getRow(1) << m.getRow(2); } static std::ostream& operator <<(std::ostream& out, const tf::Quaternion& q) { return out << ' ' << q.x() << ' ' << q.y() << ' ' << q.z() << ' ' << q.w() << std::endl; } static std::ostream& operator <<(std::ostream& out, const tf::Transform& transform) { return out << "origin:" << transform.getOrigin() << "rotation:\n" << transform.getBasis(); } static std::ostream& operator <<(std::ostream& out, const aist_depth_filter::PlaneStamped& plane) { return out << "frame_id: " << plane.header.frame_id << '\n' << plane.plane; } /************************************************************************ * class Localization * ************************************************************************/ Localization::Localization(const ros::NodeHandle& nh) :_nh(nh), _listener(), _camera_info_sub(_nh, "/camera_info", 1), _depth_sub(_nh, "/depth", 1), _sync(sync_policy_t(10), _camera_info_sub, _depth_sub), _model_cloud_pub(_nh.advertise<cloud_t>("model_points", 1)), _data_cloud_pub(_nh.advertise<cloud_t>("data_points", 1)), _localize_srv(_nh, "localize", false), _current_goal(nullptr), _ddr(_nh), _pcd_dir(_nh.param("pcd_dir", ros::package::getPath("o2ac_parts_description") + "/meshes")), _niterations(_nh.param("niterations", 1000000)), _max_distance(_nh.param("max_distance", 0.002)), _transformation_epsilon(1.0e-13), _fitness_epsilon(1.0e-13) { // Setup callback for synced camera_info and depth _sync.registerCallback(&Localization::localize_cb, this); // Setup Localize action server. _localize_srv.registerGoalCallback(boost::bind(&goal_cb, this)); _localize_srv.registerPreemptCallback(boost::bind(&preempt_cb, this)); _localize_srv.start(); // Setup parameters and ddynamic_reconfigure server. _ddr.registerVariable<int>("niterations", &_niterations, "Max. number of iterations", 1000, 1000000); _ddr.registerVariable<double>("max_distance", &_max_distance, "Max correspondence distance", 0.001, 0.1); _ddr.publishServicesTopics(); } void Localization::run() { ros::spin(); } void Localization::goal_cb() { _current_goal = _localize_srv.acceptNewGoal(); ROS_INFO_STREAM("(Localization) Given a goal[" << _current_goal->object_name << ']'); } void Localization::preempt_cb() { _localize_srv.setPreempted(); ROS_INFO_STREAM("(Localization) Cancelled a goal"); } void Localization::localize_cb(const camera_info_cp& camera_info, const image_cp& depth) { if (!_localize_srv.isActive()) return; ROS_INFO_STREAM("(Localization) Activated a goal[" << _current_goal->object_name << "]..."); // Convert the given base plane to camera frame. vector3_t n; value_t d; try { transform_plane(depth->header.frame_id, _current_goal->plane, n, d); } catch (const tf::TransformException& e) { ROS_ERROR_STREAM("(Localization) Error in transform_plane(): " << e.what()); _localize_srv.setAborted(); return; } // Transformation: gaze_point_frame <== URDF model_frame const tf::Transform Tgm({_current_goal->origin.orientation.x, _current_goal->origin.orientation.y, _current_goal->origin.orientation.z, _current_goal->origin.orientation.w}, {_current_goal->origin.position.x, _current_goal->origin.position.y, _current_goal->origin.position.z}); result_t result; result.poses.header = depth->header; value_t min_error = std::numeric_limits<value_t>::max(); for (const auto& pose2d : _current_goal->poses2d) { const auto v = view_vector(camera_info, pose2d.x, pose2d.y); const auto x = (-d/n.dot(v)) * v; auto r = n.cross(vector3_t(std::cos(pose2d.theta), std::sin(pose2d.theta), 0)); r *= (value_t(1)/norm(r)); const auto q = r.cross(n); // Transformation: camera_frame <== gaze_point_frame <== model_frame auto Tcm = tf::Transform({q(0), r(0), n(0), q(1), r(1), n(1), q(2), r(2), n(2)}, {x(0), x(1), x(2)}) * Tgm; if (_current_goal->refine_transform) { // Check border uint32_t check_borders = 0x0; if (_current_goal->check_borders) { if (pose2d.x >= std::floor(0.5*depth->width)) check_borders |= CHECK_LEFT_BORDER; if (pose2d.x <= std::ceil(0.5*depth->width)) check_borders |= CHECK_RIGHT_BORDER; if (pose2d.y >= std::floor(0.5*depth->height)) check_borders |= CHECK_UPPER_BORDER; if (pose2d.y <= std::ceil(0.5*depth->height)) check_borders |= CHECK_LOWER_BORDER; } value_t error; try { Tcm = refine_transform(_current_goal->object_name, Tcm, camera_info, depth, check_borders, error); } catch (const std::exception& err) { _localize_srv.setAborted(); ROS_ERROR_STREAM("(Localization) Aborted: failed to refine transform[" << err.what() << ']'); return; } if (error < min_error) { geometry_msgs::Pose pose; tf::poseTFToMsg(Tcm, pose); result.poses.poses.resize(1); result.poses.poses[0] = pose; result.error = error; min_error = error; } } else { geometry_msgs::Pose pose; tf::poseTFToMsg(Tcm, pose); result.poses.poses.push_back(pose); result.error = 0; } } _localize_srv.setSucceeded(result); ROS_INFO_STREAM("(Localization) Succeeded: " << result.poses.poses.size() << " pose(s) found with error=" << result.error); } void Localization::transform_plane(const std::string& target_frame, const plane_t& plane, vector3_t& normal, value_t& distance) const { tf::StampedTransform transform; _listener.waitForTransform(target_frame, plane.header.frame_id, plane.header.stamp, ros::Duration(1.0)); _listener.lookupTransform(target_frame, plane.header.frame_id, plane.header.stamp, transform); const auto n = transform.getBasis() * tf::Vector3(plane.plane.normal.x, plane.plane.normal.y, plane.plane.normal.z); normal(0) = n.x(); normal(1) = n.y(); normal(2) = n.z(); distance = plane.plane.distance - n.dot(transform.getOrigin()); } Localization::vector3_t Localization::view_vector(const camera_info_cp& camera_info, value_t u, value_t v) { using point2_t = cv::Point_<value_t>; cv::Mat_<value_t> K(3, 3); std::copy_n(std::begin(camera_info->K), 9, K.begin()); cv::Mat_<value_t> D(1, 4); std::copy_n(std::begin(camera_info->D), 4, D.begin()); cv::Mat_<point2_t> uv(1, 1), xy(1, 1); uv(0) = {u, v}; cv::undistortPoints(uv, xy, K, D); return {xy(0).x, xy(0).y, value_t(1)}; } tf::Transform Localization::refine_transform(const std::string& object_name, const tf::Transform& Tcm, const camera_info_cp& camera_info, const image_cp& depth, uint32_t check_borders, value_t& error) const { using namespace sensor_msgs; using pcl_point_t = pcl::PointXYZ; using pcl_cloud_t = pcl::PointCloud<pcl_point_t>; using pcl_cloud_p = pcl_cloud_t::Ptr; using icp_t = pcl::IterativeClosestPoint<pcl_point_t, pcl_point_t>; // Load model PCD and convert to PCL cloud. pcl_cloud_p model_cloud(new pcl_cloud_t); const auto pcd_file = _pcd_dir + '/' + object_name + ".pcd"; if (pcl::io::loadPCDFile<pcl_point_t>(pcd_file, *model_cloud) < 0) throw std::runtime_error("cannot load model PCD: " + pcd_file); model_cloud->header.frame_id = depth->header.frame_id; model_cloud->header.stamp = pcl_conversions::toPCL(depth->header.stamp); // Convert depth image to PCL cloud. pcl_cloud_p data_cloud(new pcl_cloud_t); if (depth->encoding == image_encodings::MONO16 || depth->encoding == image_encodings::TYPE_16UC1) { pcl::fromROSMsg(create_pointcloud<uint16_t>(*camera_info, *depth), *data_cloud); } else if (depth->encoding == image_encodings::TYPE_32FC1) { pcl::fromROSMsg(create_pointcloud<float>(*camera_info, *depth), *data_cloud); } else { throw std::runtime_error("unknown dpeth encoding: " + depth->encoding); } // Show data cloud. cloud_t data_cloud_msg; pcl::toROSMsg(*data_cloud, data_cloud_msg); _data_cloud_pub.publish(data_cloud_msg); // Confirm that model and data cloud are not empty. if (model_cloud->empty()) throw std::runtime_error("empty model cloud!"); if (data_cloud->empty()) throw std::runtime_error("empty data cloud!"); // Set inputs and parameters for ICP. icp_t icp; icp.setInputSource(model_cloud); icp.setInputTarget(data_cloud); icp.setMaximumIterations(_niterations); icp.setMaxCorrespondenceDistance(_max_distance); icp.setTransformationEpsilon(_transformation_epsilon); icp.setEuclideanFitnessEpsilon(_fitness_epsilon); // Perform ICP to refine model pose pcl_cloud_p registered_cloud(new pcl_cloud_t); icp.align(*registered_cloud, matrix44<value_t>(Tcm)); if (!icp.hasConverged()) throw std::runtime_error("convergence failure in ICP"); // Show registered model cloud. cloud_t registered_cloud_msg; pcl::toROSMsg(*registered_cloud, registered_cloud_msg); _model_cloud_pub.publish(registered_cloud_msg); // Check if registered model cloud is involved within the view volume. if (within_view_volume(registered_cloud->begin(), registered_cloud->end(), camera_info, check_borders)) error = icp.getFitnessScore(); else error = std::numeric_limits<value_t>::max(); // Return transformation from URDF model to camera frame. const auto Tcp = icp.getFinalTransformation(); return tf::Transform({Tcp(0, 0), Tcp(0, 1), Tcp(0, 2), Tcp(1, 0), Tcp(1, 1), Tcp(1, 2), Tcp(2, 0), Tcp(2, 1), Tcp(2, 2)}, {Tcp(0, 3), Tcp(1, 3), Tcp(2, 3)}); } template <class ITER> bool Localization::within_view_volume(ITER begin, ITER end, const camera_info_cp& camera_info, uint32_t check_borders) const { const auto v0 = view_vector(camera_info, 0, 0); const auto v1 = view_vector(camera_info, camera_info->width, 0); const auto v2 = view_vector(camera_info, camera_info->width, camera_info->height); const auto v3 = view_vector(camera_info, 0, camera_info->height); std::array<vector3_t, 4> normals = {v0.cross(v1), v1.cross(v2), v2.cross(v3), v3.cross(v0)}; uint32_t mask = 0x1; for (const auto& normal : normals) { if (check_borders & mask) for (auto point = begin; point != end; ++point) if (normal.dot(pclpointToCV(*point)) < 0) { ROS_WARN_STREAM("(Localization) Collision against " << (mask == CHECK_UPPER_BORDER ? "upper" : mask == CHECK_RIGHT_BORDER ? "right" : mask == CHECK_LOWER_BORDER ? "lower" : "left") << " border of bounding box"); return false; } mask <<= 1; } return true; } } // namespace aist_new_localization
32.259009
94
0.653215
[ "model", "transform" ]
e73bcaf018db997e23c3ff459f6d46943559d005
18,286
cpp
C++
SDKs/CryCode/3.7.0/GameDll/VehicleMovementMPVTOL.cpp
amrhead/FireNET
34d439aa0157b0c895b20b2b664fddf4f9b84af1
[ "BSD-2-Clause" ]
4
2017-12-18T20:10:16.000Z
2021-02-07T21:21:24.000Z
SDKs/CryCode/3.7.0/GameDll/VehicleMovementMPVTOL.cpp
amrhead/FireNET
34d439aa0157b0c895b20b2b664fddf4f9b84af1
[ "BSD-2-Clause" ]
null
null
null
SDKs/CryCode/3.7.0/GameDll/VehicleMovementMPVTOL.cpp
amrhead/FireNET
34d439aa0157b0c895b20b2b664fddf4f9b84af1
[ "BSD-2-Clause" ]
3
2019-03-11T21:36:15.000Z
2021-02-07T21:21:26.000Z
#include "StdAfx.h" #include "VehicleMovementMPVTOL.h" #include "VTOLVehicleManager/VTOLVehicleManager.h" #include "PersistantStats.h" #include "GamePhysicsSettings.h" #include "WaypointPath.h" //#include "Utility/CryWatch.h" CVehicleMovementMPVTOL::CVehicleMovementMPVTOL() : m_rollSpeedMultiplier(0.f) , m_destroyerId(0) , m_exhaustsCutOut(false) , m_exhaustsTimer(0.f) , m_stutterStartDamageRatio(0.f) , m_invStutterDamageSpread(1.f) , m_minTimeBetweenStutters(0.f) , m_maxTimeBetweenStutters(0.f) , m_timeBetweenStutterDecayMult(0.f) , m_stutterDurationOn(0.f) , m_stutterDurationOff(0.f) , m_baseStutters(0) , m_maxExtraStutters(0) , m_exhaustStuttersRemaining(0) , m_prevDamageRatio(0.f) , m_maxAngleRad(DEG2RAD(90.f)) , m_maxAngleSpeed(5.f) , m_angularVelMult(5.f) , m_angleSmoothTime(0.5f) , m_insideWingSpeedMult(1.f) , m_insideWingMaxAngleMult(1.f) , m_leftWingRotationRad(0.f) , m_leftWingRotationSmoothRate(0.f) , m_rightWingRotationRad(0.f) , m_rightWingRotationSmoothRate(0.f) , m_pLeftWing(NULL) , m_pRightWing(NULL) { } CVehicleMovementMPVTOL::~CVehicleMovementMPVTOL() { m_pVehicle->UnregisterVehicleEventListener(this); } bool CVehicleMovementMPVTOL::Init(IVehicle* pVehicle, const CVehicleParams& table) { bool success = BaseClass::Init(pVehicle, table); //ToDo: Any VTOL animations/effects setup MOVEMENT_VALUE("rollSpeedMultiplier", m_rollSpeedMultiplier); // Control what needs to be network synced int vtolmanagerControlled = 0; table.getAttr("vtolmanagerControlled", vtolmanagerControlled); if (vtolmanagerControlled && g_pGame->GetGameRules()->GetVTOLVehicleManager()) { // No need to do low level physics synchronisation m_pVehicle->GetGameObject()->DontSyncPhysics(); // Disable some of the additional network serialisation // Disable all pos, rot serialization. All Network syncing is done via catchup along the path, handled by the manager. // The only data sent is the pathId, and the distance along the path (pathLoc) //m_netActionSync.m_actionRep.SetFlags(CNetworkMovementHelicopterCrysis2::k_syncPos|CNetworkMovementHelicopterCrysis2::k_controlPos); m_sendTime = g_pGameCVars->v_MPVTOLNetworkSyncFreq; m_updateAspects |= k_vtolPathUpdate; } if(CVehicleParams stutterParams = table.findChild("EngineStuttering")) { stutterParams.getAttr("stutterStartDamageRatio", m_stutterStartDamageRatio); if(m_stutterStartDamageRatio == 1.f) { GameWarning("CVehicleMovementMPVTOL::Init: stutterStartDamageRatio XML param == 1.0f. Will cause divide by 0 error in release."); m_stutterStartDamageRatio = 0.f; } m_invStutterDamageSpread = __fres(1.f - m_stutterStartDamageRatio); stutterParams.getAttr("minStutters", m_baseStutters); stutterParams.getAttr("maxStutters", m_maxExtraStutters); m_maxExtraStutters -= m_baseStutters; stutterParams.getAttr("minTimeBetweenStutters", m_minTimeBetweenStutters); stutterParams.getAttr("maxTimeBetweenStutters", m_maxTimeBetweenStutters); stutterParams.getAttr("timeBetweenStutterDecayMult", m_timeBetweenStutterDecayMult); stutterParams.getAttr("stutterDurationOn", m_stutterDurationOn); stutterParams.getAttr("stutterDurationOff", m_stutterDurationOff); } if(CVehicleParams wingRotationParams = table.findChild("WingRotation")) { float maxAngleDeg; if(wingRotationParams.getAttr("maxAngleDeg", maxAngleDeg)) { m_maxAngleRad = DEG2RAD(maxAngleDeg); } wingRotationParams.getAttr("canReachMaxAngleAtSpeed", m_maxAngleSpeed); CRY_ASSERT_MESSAGE(m_maxAngleSpeed, "CVehicleMovementMPVTOL::Init - canReachMaxAngleAtSpeed is 0. This will result in divide by 0 error during update."); wingRotationParams.getAttr("angleAngularVelMult", m_angularVelMult); wingRotationParams.getAttr("smoothTime", m_angleSmoothTime); wingRotationParams.getAttr("insideWingSpeedMult", m_insideWingSpeedMult); wingRotationParams.getAttr("insideWingMaxAngleMult", m_insideWingMaxAngleMult); float noiseAmp = 0.f; float noiseFreq = 0.f; wingRotationParams.getAttr("noiseAmplitude", noiseAmp); wingRotationParams.getAttr("noiseFrequency", noiseFreq); m_leftWingNoise.Setup(noiseAmp, noiseFreq, 0x473845); m_rightWingNoise.Setup(noiseAmp, noiseFreq, 0x287463); } if(CVehicleParams noiseOverrideParams = table.findChild("NoiseOverrides")) { int count = noiseOverrideParams.getChildCount(); for(int i = 0; i < count; ++i) { if(i == MAX_NOISE_OVERRIDES) { GameWarning("CVehicleMovementMPVTOL::Init - %i noise overrides specified in XML but only %i currently supported. Needs code change to support more.", count, MAX_NOISE_OVERRIDES); break; } InitMovementNoise(noiseOverrideParams.getChild(i), m_noiseOverrides[i]); } } pVehicle->RegisterVehicleEventListener(this, "CVehicleMovementMPVTOL"); return success; } void CVehicleMovementMPVTOL::PostPhysicalize() { BaseClass::PostPhysicalize(); if(IPhysicalEntity* pPhys = m_pVehicle->GetEntity()->GetPhysics()) { if(CGamePhysicsSettings* pGPS = g_pGame->GetGamePhysicsSettings()) { // Set the Collision Class flags. pGPS->SetCollisionClassFlags( *pPhys, gcc_vtol ); // Make it NOT have vehicle type Physics. pe_params_part ppart; ppart.flagsColliderAND = ~geom_colltype_vehicle; pPhys->SetParams(&ppart); } } } void CVehicleMovementMPVTOL::Reset() { BaseClass::Reset(); m_destroyerId = 0; m_exhaustsCutOut = false; m_exhaustsTimer = 0.f; m_exhaustStuttersRemaining = 0; m_prevDamageRatio = 0.f; m_leftWingRotationRad = 0.f; m_leftWingRotationSmoothRate = 0.f; m_rightWingRotationRad = 0.f; m_rightWingRotationSmoothRate = 0.f; } void CVehicleMovementMPVTOL::Update(const float deltaTime) { BaseClass::Update(deltaTime); //Update wing rotation based on linear and angular velocities if(m_pLeftWing && m_pRightWing) { const float angVelZ = m_physStatus[k_mainThread].w.z; const float speedRatio = min(1.f, __fres(m_maxAngleSpeed)*m_CurrentSpeed); //Move inside and outside wings (in terms of turning circle) at different speeds const bool leftWingIsInside = angVelZ > 0.f; const float maxRadAtCurrentSpeedOutside = m_maxAngleRad * speedRatio * clamp_tpl(m_angularVelMult * angVelZ, -1.f, 1.f); const float maxRadAtCurrentSpeedInside = maxRadAtCurrentSpeedOutside * m_insideWingMaxAngleMult; const float insideSmoothRate = m_angleSmoothTime * (2.f - speedRatio); const float outsideSmoothRate = insideSmoothRate * m_insideWingSpeedMult; if(leftWingIsInside) { SmoothCD(m_leftWingRotationRad, m_leftWingRotationSmoothRate, deltaTime, maxRadAtCurrentSpeedInside, insideSmoothRate); SmoothCD(m_rightWingRotationRad, m_rightWingRotationSmoothRate, deltaTime, maxRadAtCurrentSpeedOutside, outsideSmoothRate); } else { SmoothCD(m_leftWingRotationRad, m_leftWingRotationSmoothRate, deltaTime, maxRadAtCurrentSpeedOutside, outsideSmoothRate); SmoothCD(m_rightWingRotationRad, m_rightWingRotationSmoothRate, deltaTime, maxRadAtCurrentSpeedInside, insideSmoothRate); } const float leftWingNoise = m_leftWingNoise.Update(deltaTime); const float rightWingNoise = m_rightWingNoise.Update(deltaTime); const Quat leftRotation = Quat::CreateRotationX(m_leftWingRotationRad+leftWingNoise); const Quat rightRotation = Quat::CreateRotationX(-m_rightWingRotationRad+rightWingNoise); m_pLeftWing->SetLocalBaseTM(Matrix34(leftRotation)); m_pRightWing->SetLocalBaseTM(Matrix34(rightRotation)); } //Exhausts periodically cut out whilst damaged if(m_exhaustsCutOut || m_exhaustsTimer) { m_exhaustsTimer -= deltaTime; if(m_exhaustsTimer < 0.f) { if(m_exhaustsCutOut) { StartExhaust(); if(--m_exhaustStuttersRemaining > 0) { m_exhaustsTimer = m_stutterDurationOn; } else { m_exhaustsTimer = Random(m_minTimeBetweenStutters, m_maxTimeBetweenStutters); //Time between stutters decreases linearly as more damage is received float progress = m_pVehicle->GetDamageRatio() - m_stutterStartDamageRatio; m_exhaustsTimer *= 1.f - ((progress * m_invStutterDamageSpread) * m_timeBetweenStutterDecayMult); m_exhaustStuttersRemaining = m_baseStutters + Random(m_maxExtraStutters); //Number of stutters next time } } else { StopExhaust(); m_exhaustsTimer = m_stutterDurationOff; } m_exhaustsCutOut = !m_exhaustsCutOut; } } #ifndef _RELEASE // Keep updating this, in case it is changed mid-game. m_sendTime = g_pGameCVars->v_MPVTOLNetworkSyncFreq; #endif } void CVehicleMovementMPVTOL::Serialize(TSerialize ser, EEntityAspects aspects) { CVTOLVehicleManager* pVTOLManager = g_pGame->GetGameRules()->GetVTOLVehicleManager(); if(pVTOLManager && ser.GetSerializationTarget()==eST_Network) { // Don't call CVehicleMovementHelicopter::Serialize(); CVehicleMovementBase::Serialize(ser, aspects); if( (aspects&k_vtolPathUpdate)!=0 ) { SVTOLPathPosParams data(m_pathing.pathingData); // Serialize. data.Serialize(ser); // Apply results. if(ser.IsReading() && !gEnv->bServer) { ReceivedServerPathingData(data); } } } else { BaseClass::Serialize(ser, aspects); } } float CVehicleMovementMPVTOL::GetRollSpeed() const { return gf_PI * m_rollSpeedMultiplier; } void CVehicleMovementMPVTOL::CalculatePitch( const Ang3& worldAngles, const Vec3& desiredMoveDir, float currentSpeed2d, float desiredSpeed, float deltaTime ) { float desiredPitch = m_CurrentVel.z; Limit(desiredPitch, -m_maxPitchAngle, m_maxPitchAngle); m_actionPitch = worldAngles.x + (desiredPitch - worldAngles.x) * deltaTime; } void CVehicleMovementMPVTOL::OnVehicleEvent( EVehicleEvent event, const SVehicleEventParams& params ) { if(event == eVE_Damaged) { //track stat of damage done to vehicle by local player if( params.entityId == g_pGame->GetClientActorId() ) { CPersistantStats* pStats = CPersistantStats::GetInstance(); pStats->IncrementClientStats( EFPS_DamageToFlyers, params.fParam ); } if(params.fParam2 < 1.0f) { if(params.fParam2 >= m_stutterStartDamageRatio && m_prevDamageRatio < m_stutterStartDamageRatio) { m_exhaustsTimer = 0.5f; m_exhaustStuttersRemaining = m_baseStutters + Random(m_maxExtraStutters); } for(int i = 0; i < MAX_NOISE_OVERRIDES; ++i) { CVTolNoise& noise = m_noiseOverrides[i]; if(params.fParam2 >= noise.m_startDamageRatio && m_prevDamageRatio < noise.m_startDamageRatio) { m_pNoise = &noise; } } } else { m_destroyerId = params.entityId; } m_prevDamageRatio = params.fParam2; } BaseClass::OnVehicleEvent(event, params); } void CVehicleMovementMPVTOL::UpdateNetworkError( const Vec3& netPosition, const Quat& netRotation ) { if( !g_pGame->GetGameRules()->GetVTOLVehicleManager() ) { BaseClass::UpdateNetworkError(netPosition,netRotation); } else { m_netPosAdjust.zero(); } } void CVehicleMovementMPVTOL::PostInit() { BaseClass::PostInit(); for (int i = 0; i < m_pVehicle->GetPartCount(); i++) { IVehiclePart* pPart = m_pVehicle->GetPart(i); if(!pPart) continue; if (m_pLeftWing == NULL && strcmpi(pPart->GetName(), "wing_left_pivot") == 0) { m_pLeftWing = pPart; pPart->SetMoveable(); m_pVehicle->SetObjectUpdate(pPart, IVehicle::eVOU_AlwaysUpdate); } else if(m_pRightWing == NULL && strcmpi(pPart->GetName(), "wing_right_pivot") == 0) { m_pRightWing = pPart; pPart->SetMoveable(); m_pVehicle->SetObjectUpdate(pPart, IVehicle::eVOU_AlwaysUpdate); } } CRY_ASSERT_MESSAGE(m_pLeftWing && m_pRightWing, "CVehicleMovementMPVTOL::PostInit - Wing parts not found"); } ////////////////////////////////////////////////////////////////////////// // NOTE: This function must be thread-safe. Before adding stuff contact MarcoC. void CVehicleMovementMPVTOL::ProcessAI( const float deltaTime ) { CryAutoCriticalSection lk(m_lock); const SVehiclePhysicsStatus& physStatus = m_physStatus[k_physicsThread]; if(!m_bApplyNoiseAsVelocity) { m_pNoise->Update(deltaTime); } m_pathing.UpdatePathFollowing(m_pVehicle->GetEntityId(), deltaTime, *this, physStatus, m_bApplyNoiseAsVelocity?Vec3(ZERO):m_pNoise->m_pos); BaseClass::ProcessAI(deltaTime); } void CVehicleMovementMPVTOL::SetPathInfo( const SPathFollowingAttachToPathParameters& params, const CWaypointPath* pPath ) { CryAutoCriticalSection lk(m_lock); m_pathing.SetPathInfo( params, pPath ); // Snap if needed. int snapToNode = -1; if( gEnv->bServer && params.shouldStartAtInitialNode ) { snapToNode = 0; } else if(params.forceSnap) { snapToNode = params.nodeIndex; } if( snapToNode>=0 ) { SVTOLPathPosParams snap; snap.pathId = params.pathIndex; snap.location = (float)snapToNode; SnapToPathLoc(snap); } } void CVehicleMovementMPVTOL::SnapToPathLoc( const SVTOLPathPosParams& data ) { QuatT transform(IDENTITY); if(m_pathing.SnapTo(data, transform)) { m_pVehicle->GetEntity()->SetWorldTM(Matrix34(transform)); } } void CVehicleMovementMPVTOL::ReceivedServerPathingData( const SVTOLPathPosParams& data ) { CryAutoCriticalSection lk(m_lock); //CryLog( "[VTOL] CLUPDATE: path[%d] loc[%f]", data.pathId, data.location ); float netError = 0.f; if( m_pathing.pathingData.pathId==data.pathId && m_pathing.pCachedPathPtr ) { netError = m_pathing.pCachedPathPtr->GetDistance( m_pathing.pathingData.location, data.location, m_pathing.shouldLoop ); if(fabs_tpl(netError) > g_pGameCVars->v_MPVTOLNetworkSnapThreshold) { SnapToPathLoc(data); netError = 0.0f; } } // Let it out of a wait, if the server VTOL is moving on (avoids a snap) if(netError>(g_pGameCVars->v_MPVTOLNetworkSnapThreshold*0.4f) && m_pathing.waitTime) { m_pathing.waitTime = 0.f; m_pathing.targetSpeed = m_pathing.defaultSpeed; } m_pathing.networkError = netError; } void CVehicleMovementMPVTOL::UpdatePathSpeed( const float speed ) { CryAutoCriticalSection lk(m_lock); m_pathing.defaultSpeed = m_pathing.speed = speed; } bool CVehicleMovementMPVTOL::FillPathingParams( struct SPathFollowingAttachToPathParameters& params ) { if(!m_pathing.pCachedPathPtr) return false; CryAutoCriticalSection lk(m_lock); params.pathIndex = m_pathing.pathingData.pathId; params.nodeIndex = m_pathing.currentNode; params.interpNodeIndex = m_pathing.interpolatedNode; params.speed = m_pathing.speed; params.defaultSpeed = m_pathing.defaultSpeed; params.shouldLoop = m_pathing.shouldLoop; params.waitTime = m_pathing.waitTime; return true; } ////////////////////////////////////////////////////////////////////////// void CVehicleMovementMPVTOL::SPathing::Reset() { pathingData.location = 0.f; pathingData.pathId = 0; pCachedPathPtr = NULL; currentNode = -1; interpolatedNode = -1; shouldLoop = false; speed = 0.f; targetSpeed = 0.f; accel = 0.f; defaultSpeed = 0.f; waitTime = 0.f; networkError = 0.f; pathComplete = 0; } void CVehicleMovementMPVTOL::SPathing::SetPathInfo( const SPathFollowingAttachToPathParameters& params, const CWaypointPath* pPath ) { // Set the new path info. pCachedPathPtr = pPath; pathingData.pathId = params.pathIndex; const float fNodeIndex = (float)params.nodeIndex; // Not using CIntToFloat as will load it directly from memory. pathingData.location = max(fNodeIndex, 0.f); interpolatedNode = currentNode = max(0,params.nodeIndex); shouldLoop = params.shouldLoop; targetSpeed = speed = params.speed; defaultSpeed = params.defaultSpeed; waitTime = params.waitTime; networkError = 0.f; pathComplete = 0; } bool CVehicleMovementMPVTOL::SPathing::SnapTo( const SVTOLPathPosParams data, QuatT& rLocation ) { if(pCachedPathPtr && pathingData.pathId==data.pathId) { CWaypointPath::TNodeId node = 0; pCachedPathPtr->GetPathLoc(data.location, rLocation, node); pathingData.location = data.location; currentNode = node; interpolatedNode = node; waitTime = 0.f; networkError = 0.f; pathComplete = 0; return true; } return false; } void CVehicleMovementMPVTOL::SPathing::UpdatePathFollowing( const EntityId vtolId, const float dt, CVehicleMovementMPVTOL& rMovement, const SVehiclePhysicsStatus& physStatus, const Vec3& posNoise ) { //CryWatch("VTOL: id[%d] path[%p] loc[%f] error[%f] wait[%f]", vtolId, pCachedPathPtr, pathingData.location, networkError, waitTime ); if(!pCachedPathPtr) return; networkError *= max(0.f, 1.f-(dt*2.0f)); float networkAdj = networkError; if(waitTime > 0.f) { waitTime -= dt; if(waitTime < 0.f) { waitTime = 0.f; targetSpeed = defaultSpeed; } else { networkAdj = 0.f; targetSpeed = 0.0f; } } CWaypointPath::TNodeId currentInerpolatedNode = interpolatedNode; Vec3 targetPos; if(pCachedPathPtr->GetPosAfterDistance(currentNode, physStatus.centerOfMass, g_pGameCVars->g_VTOLPathingLookAheadDistance, targetPos, interpolatedNode, currentNode, pathingData.location, shouldLoop)) { QuatT location; CWaypointPath::TNodeId locationNode = -1; pCachedPathPtr->GetPathLoc(pathingData.location, location, locationNode); const Vec3 forward(targetPos-location.t); const Vec3 side(forward.y, -forward.x, 0.f); Vec3 noise(side.GetNormalizedSafe(physStatus.q.GetColumn0())*posNoise.x); noise.z = posNoise.z; targetPos += noise; if(waitTime<=0.f && currentInerpolatedNode!=interpolatedNode) { float fValueOut = 0.f; CWaypointPath::E_NodeDataType dataTypeOut; if(pCachedPathPtr->HasDataAtNode(interpolatedNode, dataTypeOut, fValueOut)) { if(dataTypeOut == CWaypointPath::ENDT_Speed) { targetSpeed = fValueOut; } else if(dataTypeOut == CWaypointPath::ENDT_Wait && fValueOut > 0.f) { targetSpeed = speed = 0.f; waitTime = fValueOut; } } else { targetSpeed = defaultSpeed; } } SmoothCD(speed, accel, dt, targetSpeed, 0.2f); const float finalSpeed = max(0.f, speed + clamp_tpl( networkAdj, -speed, g_pGameCVars->v_MPVTOLNetworkCatchupSpeedLimit )); const float scalar = clamp_tpl( (speed>0.1f) ? finalSpeed/speed : 1.f, 1.f, 3.f ); CMovementRequest movementRequest; movementRequest.SetDesiredSpeed(finalSpeed); movementRequest.SetMoveTarget(targetPos); movementRequest.SetBodyTarget(targetPos); movementRequest.SetLookTarget(targetPos); rMovement.RequestMovement(movementRequest); rMovement.SetYawResponseScalar(scalar); } else { pathComplete |= 0x1; } }
30.527546
200
0.750957
[ "transform" ]
e73d17b3ba9898f89c9fed47b3f08cd1cd4aacc3
1,661
hpp
C++
src/Blocks/Block.hpp
Gegel85/GameJam2020
c6f9f0fd83ddea9a069b1775b7e3de6d38e0d59d
[ "CC0-1.0" ]
1
2020-01-31T19:17:42.000Z
2020-01-31T19:17:42.000Z
src/Blocks/Block.hpp
Gegel85/GameJam2020
c6f9f0fd83ddea9a069b1775b7e3de6d38e0d59d
[ "CC0-1.0" ]
null
null
null
src/Blocks/Block.hpp
Gegel85/GameJam2020
c6f9f0fd83ddea9a069b1775b7e3de6d38e0d59d
[ "CC0-1.0" ]
3
2020-01-31T19:18:38.000Z
2020-02-15T13:24:16.000Z
// // Created by andgel on 31/01/2020 // #ifndef DUNGEONINTERN_BLOCK_HPP #define DUNGEONINTERN_BLOCK_HPP #include "../Position.hpp" #include "../Size.hpp" namespace DungeonIntern { //! @brief Every position of the map where you can move is a block. If there is nothing on this tile, use an AirBlock (it will do nothing). class Block { protected: //! @brief For example, a chest will need repair if he is empty or broken (same cost for the player). bool _needRepair = false; //! @brief Position of the block. 0, 0 is the top left corner of the screen. Position<int> _pos; //! @brief Size of the entity. Size<unsigned> _size; public: Block(Orientation orientation, unsigned sx, unsigned sy); virtual ~Block() = default; bool needsRepair() const; //! @brief Called when a character walk on the block. This should push back the character if he isn't allowed to walk on this block. virtual void onWalk(class Entity &entity) = 0; //! @brief For example, using a ladder will make the player go up and ask him to press keys. virtual void use(class Player &) = 0; //! @brief When an enemy use the block (loot for a chest, fall into a trap...) virtual void loot(class Enemy &) = 0; //! @brief For example, filling the chest or repairing it if it is broke. virtual void repair(Player &) = 0; virtual void render() = 0; virtual bool isWalkable(); virtual int heuristic(); void setPosition(Position<int> newPos); const Position<int> &getPosition() const; const Size<unsigned> &getSize() const; bool collideWith(const Position<float> &pos, const Size<unsigned> &size) const; }; } #endif //DUNGEONINTERN_BLOCK_HPP
33.22
140
0.709813
[ "render" ]
8d45a34dc1b2698ac5e3dbb0fb9c112f208ae09f
1,811
cpp
C++
aws-cpp-sdk-ssm/source/model/ResourceDataSyncS3Format.cpp
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-02-12T08:09:30.000Z
2022-02-12T08:09:30.000Z
aws-cpp-sdk-ssm/source/model/ResourceDataSyncS3Format.cpp
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-ssm/source/model/ResourceDataSyncS3Format.cpp
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2022-03-23T15:17:18.000Z
2022-03-23T15:17:18.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/ssm/model/ResourceDataSyncS3Format.h> #include <aws/core/utils/HashingUtils.h> #include <aws/core/Globals.h> #include <aws/core/utils/EnumParseOverflowContainer.h> using namespace Aws::Utils; namespace Aws { namespace SSM { namespace Model { namespace ResourceDataSyncS3FormatMapper { static const int JsonSerDe_HASH = HashingUtils::HashString("JsonSerDe"); ResourceDataSyncS3Format GetResourceDataSyncS3FormatForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == JsonSerDe_HASH) { return ResourceDataSyncS3Format::JsonSerDe; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast<ResourceDataSyncS3Format>(hashCode); } return ResourceDataSyncS3Format::NOT_SET; } Aws::String GetNameForResourceDataSyncS3Format(ResourceDataSyncS3Format enumValue) { switch(enumValue) { case ResourceDataSyncS3Format::JsonSerDe: return "JsonSerDe"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); } return {}; } } } // namespace ResourceDataSyncS3FormatMapper } // namespace Model } // namespace SSM } // namespace Aws
28.296875
92
0.643291
[ "model" ]
8d4af94dd8efce94f62ee55dd4d2a96058f22ed1
6,142
hpp
C++
src/SyncInstructions.hpp
afalchetti/slidesync
a3764f42cc8f95ec3a788c0b7ed81563e48924d9
[ "Apache-2.0" ]
null
null
null
src/SyncInstructions.hpp
afalchetti/slidesync
a3764f42cc8f95ec3a788c0b7ed81563e48924d9
[ "Apache-2.0" ]
null
null
null
src/SyncInstructions.hpp
afalchetti/slidesync
a3764f42cc8f95ec3a788c0b7ed81563e48924d9
[ "Apache-2.0" ]
null
null
null
/// @file SyncInstructions.hpp /// @brief Descriptor of slide synchronization header file // // Part of SlideSync // // Copyright 2017 Angelo Falchetti Pareja // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SYNCINSTRUCTIONS_HPP #define SYNCINSTRUCTIONS_HPP 1 #include <iostream> #include <vector> #include <tuple> #include <string> using std::string; namespace slidesync { // TODO change internal representation to be automatically sorted // so there's no issue with video generation /// @brief Possible instructions to give a synchronized slideshow enum class SyncInstructionCode {Undefined, Next, Previous, GoTo, End}; /// @brief Synchronization instruction struct SyncInstruction { /// @brief Frame index at which this instruction should be executed unsigned int timestamp; /// @brief Command to execute SyncInstructionCode code; /// @brief Extra information for the executed command unsigned int data; /// @brief True if the timestamp refers to an absolute frame index; /// false if it is relative to the previous instruction bool relative; }; /// @brief Slide synchronization descriptor /// /// @remarks Instructions are expected to be added sequentially in time; /// otherwise, other API's behaviour is undefined. In particular /// video generation will read the instructions sequentially and /// will not be able to modify parts of the video it already generated class SyncInstructions { private: /// @brief List of instructions std::vector<SyncInstruction> instructions; /// @brief Footage frame rate. Used for printing timestamps unsigned int framerate; /// @brief Current slide index after following instructions /// @remarks It assumes the presentation start with the first slide. /// If this is not appropriate, you should call GoTo() before anything else. unsigned int current_index; /// @brief Number of slides in the presentation unsigned int length; public: // note that aliasing the internal iterator exposes private definitions into the public API, // i.e. if we were to change the vector<> to a list<> any dependent project would break // (however as long as they reference it using the alias, it can be trivially recompiled // with the new headers). A proper solution would be to define a new iterator class, specific // for this class. The cost is considered so low, especially for this non-performant-sensitive // class, that the simpler solution has been chosen anyway /// @brief Constant iterator typedef std::vector<SyncInstruction>::const_iterator const_iterator; /// @brief Construct a SyncInstructions object with no framerate /// /// The object won't be able to calculate timestamps, so the raw frame indices /// will be used instead when printing. /// /// @param[in] length Number of slides in the presentation. SyncInstructions(unsigned int length); /// @brief Construct a SyncInstructions object with a given framerate /// /// @param[in] length Number of slides in the presentation. /// @param[in] framerate Footage frame rate. SyncInstructions(unsigned int length, unsigned int framerate); /// @brief Construct a SyncInstructions object from its string representation /// /// @param[in] descriptor String representation through a stream reader. SyncInstructions(std::istream& descriptor); /// @brief Add a "next slide" instruction /// /// @param[in] timestamp Frame index. /// @param[in] relative True if the timestamp indicates an absolute timestamp; /// false if it is relative to the previous instruction. /// @returns True if successful; otherwise, false. Trying to move to a /// non-existant or invalid slide will cause a failure. bool Next(unsigned int timestamp, bool relative = false); /// @brief Add a "previous slide" instruction /// /// @param[in] timestamp Frame index. /// @param[in] relative True if the timestamp indicates an absolute timestamp; /// false if it is relative to the previous instruction. /// @returns True if successful; otherwise, false. Trying to move to a /// non-existant or invalid slide will cause a failure. bool Previous(unsigned int timestamp, bool relative = false); /// @brief Add a "go to slide" instruction /// /// @param[in] timestamp Frame index. /// @param[in] index Frame index to jump to. /// @param[in] relative True if the timestamp indicates an absolute timestamp; /// false if it is relative to the previous instruction. /// @returns True if successful; otherwise, false. Trying to move to a /// non-existant or invalid slide will cause a failure. bool GoTo(unsigned int timestamp, unsigned int index, bool relative = false); /// @brief End the presentation /// /// @param[in] timestamp Frame index. /// @param[in] relative True if the timestamp indicates an absolute timestamp; /// false if it is relative to the previous instruction. /// @returns True if successful; otherwise, false. bool End(unsigned int timestamp, bool relative = false); /// @brief Get a constant iterator for the instruction list const_iterator cbegin(); /// @brief Get a constant iterator end mark for the instruction list const_iterator cend(); /// @brief Get the number of frame per second. int Framerate() const; /// @brief Generate an appropriate string representation of the synchronization string ToString() const; }; } #endif
37.224242
95
0.707587
[ "object", "vector" ]
8d4b4997f509e9a563b38100505a4dd8648838e6
870
cpp
C++
src/TileSet.cpp
ThalissonMelo/IDJ-Game
3d31722479b75151a6e1f328c6b71ec7b1022168
[ "MIT" ]
null
null
null
src/TileSet.cpp
ThalissonMelo/IDJ-Game
3d31722479b75151a6e1f328c6b71ec7b1022168
[ "MIT" ]
null
null
null
src/TileSet.cpp
ThalissonMelo/IDJ-Game
3d31722479b75151a6e1f328c6b71ec7b1022168
[ "MIT" ]
null
null
null
#include "TileSet.h" TileSet::TileSet(GameObject& associated, int tileWidth, int tileHeight, string file) : tileSet(associated, file) { this->tileHeight = tileHeight; this->tileWidth = tileWidth; //verificar abertura do tileset this->columns = tileSet.getWidth()/tileWidth; this->rows = tileSet.getHeight()/tileHeight; } void TileSet::RenderTile(unsigned index, float x, float y){ if(index < this->rows*this->columns){ int x_axis = this->tileWidth*(index%this->columns); int y_axis = this->tileHeight*(index/this->columns); tileSet.setClip(x_axis, y_axis, this->tileWidth, this->tileHeight); tileSet.Render(x, y); } } int TileSet::GetTileWidth(){ return this->tileWidth; } int TileSet::GetTileHeight(){ return this->tileHeight; }
29
118
0.628736
[ "render" ]