anchor.diff:      {stop, Reason::term(), #state{}} | {stop, Reason::term(), Reply::term(), #state{}}.
   
   handle_call({register_type, Class, Type, Module}, _From, State) ->
  -    State2 = register_type(Class, Type, Module, State),
  -    {reply, ok, State2};
  -
  -handle_call(Msg, _From, State) ->
  -    lager:error("Module ~p received unexpected call ~p", [?MODULE, Msg]),
  -    {noreply, State}.
  -
  -
  -%% @private
  --spec handle_cast(term(), #state{}) ->
  -    {noreply, #state{}} | {stop, term(), #state{}}.
  -
  -handle_cast(Msg, State) ->
  -    lager:error("Module ~p received unexpected cast ~p", [?MODULE, Msg]),
  -    {noreply, State}.
  -
  -
  -%% @private
  --spec handle_info(term(), #state{}) ->
  -    {noreply, #state{}} | {stop, term(), #state{}}.
  -
  -handle_info(Info, State) ->
  -    lager:warning("Module ~p received unexpected info: ~p (~p)", [?MODULE, Info, State]),
  -    {noreply, State}.
  -
  -
  -%% @private
  --spec code_change(term(), #state{}, term()) ->
  -    {ok, #state{}}.
  -
  -code_change(_OldVsn, State, _Extra) ->
  -    {ok, State}.
  -
  -
  -%% @private
  --spec terminate(term(), #state{}) ->
  -    ok.
  -
  -terminate(_Reason, _State) ->
  -    ok.
  -
  -
  -
  -%% ===================================================================
  -%% Internal
  -%% ===================================================================
  -
  -%% @private
  -lookup(Term) ->
  -    lookup(Term, undefined).
  -
  -
  -%% @private
  -lookup(Term, Default) ->
  -    case ets:lookup(?MODULE, Term) of
  -        [] -> Default;
  -        [{_, Val}] -> Val
  -    end.
  -
  -
  -%% @private
  -register_type(Class, Type, Module, _State) ->
       AllModules1 = get_all_modules(Class),
       AllModules2 = lists:usort([Module|AllModules1]),
       AllTypes1 = get_all_types(Class),
  
positive.code: 
  
  %% @doc Gets the obj module for a type
  -spec register(class(), type(), module()) ->
      ok.
  
  register(Class, Type, Module) when is_atom(Module) ->
      code:ensure_loaded(Module),
      Type2 = to_bin(Type),
      gen_server:call(?MODULE, {register_type, Class, Type2, Module}).
  
  
  
  
  % ===================================================================
  
negative.code:         {{all_types, Class}, AllTypes2},
          {{type, Class, Type}, Module},
          {{module, Class, Module}, Type}
      ]),
      {reply, ok, State};
  
  handle_call({update_meta, Class, Type, Fun}, _From, State) ->
      Meta1 = lookup({meta, Class, Type}, #{}),
      try Fun(Meta1) of
          Meta2 when is_map(Meta2) ->
              ets:insert(?MODULE, {{meta, Class, Type}, Meta2}),
              {reply, ok, State};
          Other ->
              lager:warning("NkLIB Types: invalid meta respose (~p ~p): ~p", [Class, Type, Other]),
              {reply, {error, function_error, State}}
      catch
          error:Error ->
          lager:warning("NkLIB Types: invalid meta respose (~p ~p): ~p", [Class, Type, Error]),
          {reply, {error, function_error, State}}
      end;
  
  handle_call(Msg, _From, State) ->
      lager:error("Module ~p received unexpected call ~p", [?MODULE, Msg]),
      {noreply, State}.
  
  
  %% @private
  -spec handle_cast(term(), #state{}) ->
      {noreply, #state{}} | {stop, term(), #state{}}.
  
  handle_cast(Msg, State) ->
      lager:error("Module ~p received unexpected cast ~p", [?MODULE, Msg]),
      {noreply, State}.
  
  
  %% @private
  -spec handle_info(term(), #state{}) ->
      {noreply, #state{}} | {stop, term(), #state{}}.
  
  handle_info(Info, State) ->
      lager:warning("Module ~p received unexpected info: ~p (~p)", [?MODULE, Info, State]),
      {noreply, State}.
  
  
  %% @private
  -spec code_change(term(), #state{}, term()) ->
      {ok, #state{}}.
  
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  
  %% @private
  -spec terminate(term(), #state{}) ->
      ok.
  
  terminate(_Reason, _State) ->
      ok.
  
  
  
  %% ===================================================================
  %% Internal
  %% ===================================================================
  
  %% @private
  lookup(Term) ->
      lookup(Term, undefined).
  
  
  %% @private
  lookup(Term, Default) ->
      case ets:lookup(?MODULE, Term) of
          [] -> Default;
          [{_, Val}] -> Val
      end.
  
  
  
  %% @private
  