loki库是C++模板大牛Andrei写的, 里面大量运用模板的特性, 而tc_loki.h借用了loki库的部分代码, 形成了一个基本的文件tc_loki.h, 来看看:

 #ifndef __TC_TYPETRAITS_H
#define __TC_TYPETRAITS_H #include <memory> namespace tars
{
/////////////////////////////////////////////////
// 说明: loki
///////////////////////////////////////////////// namespace TL
{
//只声明, 不定义的类, 作为TYPELIST的末端类型
class NullType; //空类型
struct EmptyType { }; /**
* 数值到类型的映射
*/
template<int v>
struct Int2Type
{
enum { value = v };
}; /**
* 类型到类型的映射
*/
template<typename T>
struct Type2Type
{
typedef T OriginalType;
}; ///////////////////////////////////////////////////////////////////////////
// 以下是TypeList的定义(目前只支持10个参数)
/**
* 定义类型链表
*/
template<typename Head, typename Tail>
struct TypeList
{
typedef Head H;
typedef Tail T;
}; #define TYPELIST_1(T1) TypeList<T1, TL::NullType>
#define TYPELIST_2(T1, T2) TypeList<T1, TL::TYPELIST_1(T2)>
#define TYPELIST_3(T1, T2, T3) TypeList<T1, TL::TYPELIST_2(T2, T3)>
#define TYPELIST_4(T1, T2, T3, T4) TypeList<T1, TL::TYPELIST_3(T2, T3, T4)>
#define TYPELIST_5(T1, T2, T3, T4, T5) TypeList<T1, TL::TYPELIST_4(T2, T3, T4, T5)>
#define TYPELIST_6(T1, T2, T3, T4, T5, T6) TypeList<T1, TL::TYPELIST_5(T2, T3, T4, T5, T6)>
#define TYPELIST_7(T1, T2, T3, T4, T5, T6, T7) TypeList<T1, TL::TYPELIST_6(T2, T3, T4, T5, T6, T7)>
#define TYPELIST_8(T1, T2, T3, T4, T5, T6, T7, T8) TypeList<T1, TL::TYPELIST_7(T2, T3, T4, T5, T6, T7, T8)>
#define TYPELIST_9(T1, T2, T3, T4, T5, T6, T7, T8, T9) TypeList<T1, TL::TYPELIST_8(T2, T3, T4, T5, T6, T7, T8, T9)>
#define TYPELIST_10(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) TypeList<T1, TL::TYPELIST_9(T2, T3, T4, T5, T6, T7, T8, T9, T10)>
#define TYPELIST_11(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) TypeList<T1, TL::TYPELIST_10(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>
#define TYPELIST_12(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) TypeList<T1, TL::TYPELIST_11(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>
#define TYPELIST_13(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) TypeList<T1, TL::TYPELIST_12(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)>
#define TYPELIST_14(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) TypeList<T1, TL::TYPELIST_13(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)>
#define TYPELIST_15(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) TypeList<T1, TL::TYPELIST_14(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)>
#define TYPELIST_16(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) TypeList<T1, TL::TYPELIST_15(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)>
#define TYPELIST_17(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) TypeList<T1, TL::TYPELIST_16(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)>
#define TYPELIST_18(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) TypeList<T1, TL::TYPELIST_17(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)>
#define TYPELIST_19(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) TypeList<T1, TL::TYPELIST_18(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)>
#define TYPELIST_20(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) TypeList<T1, TL::TYPELIST_19(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)> //////////////////////////////////////////////////////////////////////////////
// 以下定义TypeList的编译期的操作函数(通过偏特化实现)
/**
* Length: 取TypeList的长度
*/
template<class TList> struct Length;
template<> struct Length<NullType>
{
enum { value = };
};
template<class Head, class Tail> struct Length<TypeList<Head, Tail> >
{
enum { value = + Length<Tail>::value };
}; /**
* TypeAt, 取链表在i位置上的类型
*/
template<class TList, unsigned int i> struct TypeAt;
template<class Head, class Tail> struct TypeAt<TypeList<Head, Tail>, >
{
typedef Head Result;
};
template<class Head, class Tail, unsigned int i> struct TypeAt<TypeList<Head, Tail>, i>
{
typedef typename TypeAt<Tail, i->::Result Result;
}; /**
* TypeAt, 取链表在i位置上的类型, i超出了返回, 则返回DefaultType
*/
template<class TList, unsigned int index, typename DefaultType = NullType> struct TypeAtNonStrict
{
typedef DefaultType Result;
};
template <class Head, class Tail, typename DefaultType> struct TypeAtNonStrict<TypeList<Head, Tail>, , DefaultType>
{
typedef Head Result;
};
template <class Head, class Tail, unsigned int i, typename DefaultType> struct TypeAtNonStrict<TypeList<Head, Tail>, i, DefaultType>
{
typedef typename TypeAtNonStrict<Tail, i - , DefaultType>::Result Result;
}; /**
* 取链表上类型为T的序号, 没有则返回-1
*/
template<class TList, class T> struct IndexOf;
template<class T> struct IndexOf<NullType, T>
{
enum { value = - };
};
template<class Tail, class T> struct IndexOf<TypeList<T,Tail>, T>
{
enum { value = };
};
template<class Head, class Tail, class T> struct IndexOf<TypeList<Head, Tail>, T>
{
private:
enum { temp = IndexOf<Tail, T>::value };
public:
enum { value = temp == - ? - : + temp };
}; /**
* Append, 添加到链表尾部
*/
template<class TList, class T> struct Append;
template<> struct Append<NullType, NullType>
{
typedef NullType Result;
};
template<class T> struct Append<NullType,T>
{
typedef TYPELIST_1(T) Result;
};
template<class Head, class Tail> struct Append<NullType, TypeList<Head, Tail> >
{
typedef TypeList<Head, Tail> Result;
};
template<class Head, class Tail, class T> struct Append<TypeList<Head, Tail>, T>
{
typedef TypeList<Head, typename Append<Tail, T>::Result> Result;
}; /**
* Erase 删除
*/
template<class TList, class T> struct Erase;
template<class T> struct Erase<NullType, T>
{
typedef NullType Result;
};
template<class T, class Tail> struct Erase<TypeList<T, Tail>, T>
{
typedef Tail Result;
};
template<class Head, class Tail, class T> struct Erase<TypeList<Head, Tail>, T>
{
typedef TypeList<Head, typename Erase<Tail, T>::Result> Result;
}; /**
* EraseAll 删除
*/
template<class TList, class T> struct EraseAll;
template<class T> struct EraseAll<NullType, T>
{
typedef NullType Result;
};
template<class T, class Tail> struct EraseAll<TypeList<T, Tail>, T>
{
typedef typename EraseAll<Tail, T>::Result Result;
};
template<class Head, class Tail, class T> struct EraseAll<TypeList<Head, Tail>, T>
{
typedef TypeList<Head, typename EraseAll<Tail, T>::Result> Result;
}; /**
* 生成TypeList类型
*/
template<class T1=NullType, class T2=NullType, class T3=NullType, class T4=NullType, class T5=NullType,
class T6=NullType, class T7=NullType, class T8=NullType, class T9=NullType, class T10=NullType,
class T11=NullType, class T12=NullType, class T13=NullType, class T14=NullType, class T15=NullType,
class T16=NullType, class T17=NullType, class T18=NullType, class T19=NullType, class T20=NullType>
struct TLMaker
{
private:
typedef TYPELIST_20(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) TmpList;
public:
typedef typename EraseAll<TmpList, NullType>::Result Result;
}; /////////////////////////////////////////////////////////////////////////////////////
//判断类型T是否可以转换成类型U(参考了wbl库, 直接采用loki, 编译时会有警告
//关键:如果能够转换, 则接收U的函数, 也能够接收T
template<class T, class U>
class Conversion
{
protected:
typedef char YES;
struct NO {char dummy[];};
struct any_conversion
{
template <typename P> any_conversion(const volatile P&);
template <typename P> any_conversion(P&);
}; template <typename P> struct conversion_checker
{
static NO _m_check(any_conversion ...);
static YES _m_check(P, int);
}; static T _m_from;
public:
enum
{
//是否可以转换(如果Test(makeT())匹配到了static Small Test(U), 则可以转换)
exists = (sizeof(conversion_checker<U>::_m_check(_m_from, )) == sizeof(YES)),
//是否可以双向转换
exists2Way = exists && Conversion<U, T>::exists,
//是否相同类型
sameType = false
};
}; //偏特化来确定sameType
template<class T>
class Conversion<T, T>
{
public:
enum
{
exists = true,
exists2Way = true,
sameType = true
};
}; //判断两个类是否可以继承
//关键:子类指针可以转换成父类指针, 且不是void*类型
//相同类型, SUPERSUBCLASS判断为true
#define SUPERSUBCLASS(T, U) (TL::Conversion<const U*, const T*>::exists && !TL::Conversion<const T*, const void*>::sameType)
//相同类型, SUPERSUBCLASS_STRICT判断为false
#define SUPERSUBCLASS_STRICT(T, U) (SUPERSUBCLASS(T, U) && !TL::Conversion<const T, const U>::sameType) ///////////////////////////////////////////////////////////////////////////////////////////////
// 类型选择器
template<bool flag, typename U, typename V>
struct TypeSelect
{
typedef U Result;
}; template<typename U, typename V>
struct TypeSelect<false, U, V>
{
typedef V Result;
}; ///////////////////////////////////////////////////////////////////////////////////////
/**
* 类型萃取器, copy至Loki库
*/
template<typename T>
class TypeTraits
{
private: ///////////////////////////////////////////////////////
//提取引用的原始类型(即去掉引用类型)
template<class U>
struct ReferenceTraits
{
enum { result = false };
typedef U Result;
}; template<class U>
struct ReferenceTraits<U&>
{
enum { result = true };
typedef U Result;
}; ///////////////////////////////////////////////////////
//指针类型
template<class U>
struct PointerTraits
{
enum { result = false };
typedef TL::NullType Result;
}; template<class U>
struct PointerTraits<U*>
{
enum { result = true };
typedef U Result;
}; template<class U>
struct PointerTraits<U*&>
{
enum { result = true };
typedef U Result;
}; ///////////////////////////////////////////////////////
//成员函数指针, gcc下面支持有问题, 屏蔽之
template<typename U>
struct PointerToMemberTraits
{
enum { result = false };
}; template<class U, class V>
struct PointerToMemberTraits<U V::*>
{
enum { result = true };
}; template<class U, class V>
struct PointerToMemberTraits<U V::*&>
{
enum { result = true };
}; ///////////////////////////////////////////////////////
// const
template<typename U>
struct UnConstTraits
{
enum { result = false };
typedef U Result;
};
template<typename U>
struct UnConstTraits<const U>
{
enum { result = true };
typedef U Result;
};
template<typename U>
struct UnConstTraits<const U&>
{
enum { result = true };
typedef U& Result;
}; ///////////////////////////////////////////////////////
// volatile
template<typename U>
struct UnVolatileTraits
{
enum { result = false };
typedef U Result;
};
template<typename U>
struct UnVolatileTraits<volatile U>
{
enum { result = true };
typedef U Result;
};
template<typename U>
struct UnVolatileTraits<volatile U&>
{
enum { result = true };
typedef U& Result;
};
public:
//T是否是指针类型
enum { isPointer = PointerTraits<T>::result };
//T是否是引用类型
enum { isReference = ReferenceTraits<T>::result };
//T是否指向成员函数的指针
enum { isMemberPointer = PointerToMemberTraits<T>::result }; //T是否是Const类型
enum { isConst = UnConstTraits<T>::result };
//T是否是Volatile类型
enum { isVolatile = UnVolatileTraits<T>::result }; //如果T是指针类型,则获取T的原类型, 即去掉指针类型
typedef typename PointerTraits<T>::Result PointeeType;
//如果T是引用类型,则获取T的原类型, 即去掉引用类型
typedef typename ReferenceTraits<T>::Result ReferencedType;
//如果T是Const类型,则获取T的原类型, 即去掉Const类型
typedef typename UnConstTraits<T>::Result NonConstType;
//如果T是volatile类型,则获取T的原类型, 即去掉volatile类型
typedef typename UnVolatileTraits<T>::Result NonVolatileType;
//去掉const volatile类型
typedef typename UnVolatileTraits<typename UnConstTraits<T>::Result>::Result UnqualifiedType; public: //////////////////////////////////////////////////////
//
typedef TL::TLMaker<unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long>::Result UnsignedInts;
typedef TL::TLMaker<signed char, short, int, long, long long>::Result SignedInts;
typedef TL::TLMaker<bool, char, wchar_t>::Result OtherInts;
typedef TL::TLMaker<float, double, long double>::Result Floats;
typedef TL::TYPELIST_2(TL::EmptyType, TL::NullType) NullTypes; //无符号整形
enum { isStdUnsignedInt = TL::IndexOf<UnsignedInts, T>::value >= };
//有符号整形
enum { isStdSignedInt = TL::IndexOf<SignedInts, T>::value >= };
//整形
enum { isStdInt = isStdUnsignedInt || isStdSignedInt || TL::IndexOf<OtherInts, T>::value >= };
//浮点类型
enum { isStdFloat = TL::IndexOf<Floats, T>::value >= };
//数值类型
enum { isStdArith = isStdInt || isStdFloat };
//基础类型(包括void)
enum { isStdFundamental = isStdArith || TL::IndexOf<TL::TYPELIST_1(void), T>::value >= };
//空类型
enum { isNullType = TL::IndexOf<NullTypes, T>::value >= };
//简单类型
enum { isBaseType = isStdArith || isPointer || isMemberPointer }; //对于复杂类型, 获取数据的引用类型, 即加上引用类型
typedef typename TypeSelect<isBaseType, T, ReferencedType&>::Result ReferenceType; //对于复杂类型且非空类型, 获取数据的引用类型, 即加上引用类型
//typedef typename TypeSelect<isBaseType || isNullType, T, ReferencedType&>::Result ReferenceTypeEx; //获取数据的原类型, 消除引用的引用这种情况
typedef typename TypeSelect<!isReference, T, ReferencedType&>::Result ParameterType;
}; ////////////////////////////////////////////////////////////////////////////////////////////////////
//下面的使用开始展示TypeList的威力, 用于自动生成class //散乱的继承体系
template<class TList, template <class> class Unit>
class ScatterHierarchy; /*
namespace p
{
//注释copy至loki库
// The following type helps to overcome subtle flaw in the original
// implementation of GenScatterHierarchy.
// The flaw is revealed when the input type list of GenScatterHierarchy
// contains more then tars element of the same type (e.g. LOKI_TYPELIST_2(int, int)).
// In this case GenScatterHierarchy will contain multiple bases of the same
// type and some of them will not be reachable (per 10.3).
// For example before the fix the first element of Tuple<LOKI_TYPELIST_2(int, int)>
// is not reachable in any way!
template<class, class>
struct ScatterHierarchyTag;
}
template<class T1, class T2, template <class> class Unit>
class ScatterHierarchy<TypeList<T1, T2>, Unit> : public ScatterHierarchy<p::ScatterHierarchyTag<T1, T2>, Unit>
, public ScatterHierarchy<T2, Unit>
{
public:
typedef TypeList<T1, T2> TList;
typedef ScatterHierarchy<p::ScatterHierarchyTag<T1, T2>, Unit> LeftBase;
typedef ScatterHierarchy<T2, Unit> RightBase;
template<typename T> struct Rebind
{
typedef Unit<T> Result;
};
};
// In the middle *unique* class that resolve possible ambiguity
template <class T1, class T2, template <class> class Unit>
class ScatterHierarchy<p::ScatterHierarchyTag<T1, T2>, Unit>
: public ScatterHierarchy<T1, Unit>
{
};
*/ //具现化继承体系
template <class T1, class T2, template <class> class Unit>
class ScatterHierarchy<TypeList<T1, T2>, Unit>
: public ScatterHierarchy<T1, Unit>
, public ScatterHierarchy<T2, Unit>
{
public:
typedef TypeList<T1, T2> TList;
typedef ScatterHierarchy<T1, Unit> LeftBase;
typedef ScatterHierarchy<T2, Unit> RightBase;
template <typename T> struct Rebind
{
typedef Unit<T> Result;
};
}; template<class AtomicType, template <class> class Unit>
class ScatterHierarchy : public Unit<AtomicType>
{
public:
typedef Unit<AtomicType> LeftBase; template<typename T> struct Rebind
{
typedef Unit<T> Result;
};
}; template<template <class> class Unit>
class ScatterHierarchy<NullType, Unit>
{
public:
template<typename T> struct Rebind
{
typedef Unit<T> Result;
};
}; /////////////////////////////////////////////////////////////////////
//构建继承体系后, 采用下面的函数获取继承体系中某个类 template<class T, class H>
struct FieldHelperByType
{
typedef typename H::template Rebind<T>::Result ResultType;
static ResultType& dochange(H &obj)
{
return static_cast<ResultType&>(obj);
}
};
template<class T, class H>
struct FieldHelperByType<T, const H>
{
typedef const typename H::template Rebind<T>::Result ResultType;
static ResultType& dochange(const H &obj)
{
return (ResultType&)obj;
}
}; //直接按照类型获取, 如果有两个相同的类型, 则编译不过
template<class T, class H>
typename FieldHelperByType<T, H>::ResultType& field(H &obj)
{
return FieldHelperByType<T, H>::dochange(obj);
} /////////////////////////////////////////////////////////////////////
// 根据索引获取字段
//定义Tuple, 默认的数据操作器(Unit)
template<typename T>
struct TupleUnit
{
T _value;
operator T&() { return _value; }
operator const T&() const { return _value; }
}; template<class TList>
struct Tuple : public ScatterHierarchy<TList, TupleUnit>
{
}; //定义FieldHelperByIndex
template<class H, unsigned int i> struct FieldHelperByIndex; //特化版本的FieldHelperByIndex, 推导出最后一个元素
template<class H>
struct FieldHelperByIndex<H, >
{
typedef typename H::TList::H ElementType;
typedef typename H::template Rebind<ElementType>::Result UnitType; enum
{
isTuple = Conversion<UnitType, TupleUnit<ElementType> >::sameType,
isConst = TypeTraits<H>::isConst
}; typedef const typename H::LeftBase ConstLeftBase;
typedef typename TypeSelect<isConst, ConstLeftBase, typename H::LeftBase>::Result LeftBase;
typedef typename TypeSelect<isTuple, ElementType, UnitType>::Result UnqualifiedResultType;
typedef typename TypeSelect<isConst, const UnqualifiedResultType, UnqualifiedResultType>::Result ResultType; static ResultType &dochange(H& obj)
{
LeftBase &leftBase = obj;
return (ResultType&)leftBase;
}
}; //根据索引获取FieldHelper
template<class H, unsigned int i>
struct FieldHelperByIndex
{
typedef typename TypeAt<typename H::TList, i>::Result ElementType;
typedef typename H::template Rebind<ElementType>::Result UnitType; enum
{
isTuple = Conversion<UnitType, TupleUnit<ElementType> >::sameType,
isConst = TypeTraits<H>::isConst
}; typedef const typename H::RightBase ConstRightBase;
typedef typename TypeSelect<isConst, ConstRightBase, typename H::RightBase>::Result RightBase;
typedef typename TypeSelect<isTuple, ElementType, UnitType>::Result UnqualifiedResultType;
typedef typename TypeSelect<isConst, const UnqualifiedResultType, UnqualifiedResultType>::Result ResultType; static ResultType &dochange(H& obj)
{
RightBase &rightBase = obj;
return FieldHelperByIndex<RightBase, i->::dochange(rightBase);
}
}; //定义按照索引获取
template<unsigned int i, class H>
typename FieldHelperByIndex<H, i>::ResultType &field(H& obj)
{
return FieldHelperByIndex<H, i>::dochange(obj);
}
} }
#endif

是不是有一种看天书的感觉, 确实如此。

也行, 姑且把它当成和STL类似的基础库, 别纠结于它。

转自:https://blog.csdn.net/stpeace/article/details/79772562

【转】tars源码漫谈第1篇------tc_loki.h (牛逼哄哄的loki库)的更多相关文章

  1. UVW源码漫谈(三)

    咱们继续看uvw的源码,这次看的东西比较多,去除底层的一些东西,很多代码都是连贯的,耦合度也比较高了.主要包括下面几个文件的代码: underlying_type.hpp resource.hpp l ...

  2. Hadoop2源码分析-MapReduce篇

    1.概述 前面我们已经对Hadoop有了一个初步认识,接下来我们开始学习Hadoop的一些核心的功能,其中包含mapreduce,fs,hdfs,ipc,io,yarn,今天为大家分享的是mapred ...

  3. Hadoop2源码分析-准备篇

    1.概述 我们已经能够搭建一个高可用的Hadoop平台了,也熟悉并掌握了一个项目在Hadoop平台下的开发流程,基于Hadoop的一些套件我们也能够使用,并且能利用这些套件进行一些任务的开发.在Had ...

  4. 深入出不来nodejs源码-timer模块(C++篇)

    终于可以填上坑了. 简单回顾一下之前JS篇内容,每一次setTimeout的调用,会在一个对象中添加一个键值对,键为延迟时间,值为一个链表,将所有该时间对应的事件串起来,图如下: 而每一个延迟键值对的 ...

  5. JUC源码分析-线程池篇(三)ScheduledThreadPoolExecutor

    JUC源码分析-线程池篇(三)ScheduledThreadPoolExecutor ScheduledThreadPoolExecutor 继承自 ThreadPoolExecutor.它主要用来在 ...

  6. JUC源码分析-线程池篇(二)FutureTask

    JUC源码分析-线程池篇(二)FutureTask JDK5 之后提供了 Callable 和 Future 接口,通过它们就可以在任务执行完毕之后得到任务的执行结果.本文从源代码角度分析下具体的实现 ...

  7. JUC源码分析-线程池篇(三)Timer

    JUC源码分析-线程池篇(三)Timer Timer 是 java.util 包提供的一个定时任务调度器,在主线程之外起一个单独的线程执行指定的计划任务,可以指定执行一次或者反复执行多次. 1. Ti ...

  8. JUC源码分析-线程池篇(一):ThreadPoolExecutor

    JUC源码分析-线程池篇(一):ThreadPoolExecutor Java 中的线程池是运用场景最多的并发框架,几乎所有需要异步或并发执行任务的程序都可以使用线程池.在开发过程中,合理地使用线程池 ...

  9. 鸿蒙内核源码分析(Shell编辑篇) | 两个任务,三个阶段 | 百篇博客分析OpenHarmony源码 | v71.01

    子曰:"我非生而知之者,好古,敏以求之者也." <论语>:述而篇 百篇博客系列篇.本篇为: v71.xx 鸿蒙内核源码分析(Shell编辑篇) | 两个任务,三个阶段 ...

随机推荐

  1. Spring Cloud 2-Ribbon 客户端负载均衡(二)

    Spring Cloud Eureka  1.Hello-Service服务端配置 pom.xml application.yml 启动两个service 2.Ribbon客户端配置 pom.xml ...

  2. excel生成数据地图

    在数据分析过程中,图表是一个十分重要的部分,通过图表可以清晰明了的说明一些数字特征.在众多数据分析图表中,数据地图是常用的一中分析图.在一般的数据分析中,excel已经可以满足绝大部分功能.在本文中, ...

  3. javascipt继承机制(from阮一峰)

    Javascript继承机制的设计思想   我一直很难理解Javascript语言的继承机制. 它没有"子类"和"父类"的概念,也没有"类" ...

  4. WPF 10天修炼 第一天- 入门

    简介 WPF技术基于DirectX,完美的整合了矢量图形.2D或3D绘图技术.文件及多媒体技术.WPF将开发人员和设计人员的职责清楚的分离,提供了一种声明编程语言XAML.同时Expression B ...

  5. Django-DRF-图书增删改查 !!!

      自己封装的 class MyResponse(): def __init__(self): self.status = 100 self.msg = None @property def get_ ...

  6. css 冷知识

    *{margin: 0;padding: 0;} li{list-style-type:none; }ul{list-style: none;}img{border: none;}ul,input,s ...

  7. html form action

    action 行为 一.j_security_check  登陆检查 <!DOCTYPE html> <html> <head> <meta charset= ...

  8. bzoj 3277

    十分之恶心的后缀自动机 (其实是水题,但是我太弱了...) 首先,有一个预备知识:bzoj 2780https://blog.csdn.net/lleozhang/article/details/89 ...

  9. C语言判断水仙花数

    水仙花数 水仙花数(Narcissistic number)也被称为超完全数字不变数(pluperfect digital invariant, PPDI).自恋数.自幂数.阿姆斯壮数或阿姆斯特朗数( ...

  10. [转] 如何写好.babelrc?Babel的presets和plugins配置解析

    什么是Babel The compiler for writing next generation JavaScript. 官网是这么说的,翻译一下就是下一代JavaScript 语法的编译器. 作为 ...